|
From: Darren D. <dd...@co...> - 2006-04-25 21:51:30
|
On Tuesday 25 April 2006 17:27, Nadia Dencheva wrote:
> > >>> tk.getvar('tk_library')
> >
> > u'/usr/stsci/pyssgdev/lib/tk8.4'
> >
> > (The first thing that comes to mind is 'unicode':))
>
> Hmm, turns out this is not a joke.
>
> On a linux machine I get
>
> enchanter> python
> Python 2.4.3 (#2, Apr 17 2006, 10:36:38)
> [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-54)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import Tkinter
> >>> tk=Tkinter.Tk()
> >>> type(tk.getvar('tk_library'))
>
> <type 'str'>
>
> >>> type(tk.getvar('tcl_library'))
>
> <type 'str'>
>
> The same example on MacOSX (python, tcl/tk are X11 based, built in
>
> a local directory) gives:
> >>> type(tk.getvar('tk_library'))
>
> <type 'unicode'>
>
> >>> type(tk.getvar('tcl_library'))
>
> <type 'str'>
>
>
> I'm using tcl/tk 8.3 on linux and tcl/tk 8.4 on the mac.
> Is anyone aware of any changes to Tk 8.4 that could cause this
> behavior?
>
> A possible workaround is
>
> tk.getvar('tk_library').encode('utf8')
This might be related to a unicode bug in python too. I saw a mention
somewhere that python-2.4.3 would include some unicode bug fixes.
|