473,748 Members | 3,585 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

tkFileDialog and locale under Linux

Hi,

I have problems using tkFileDialog under Linux (Ubuntu 8.04 in my case, but
other Linuxes seem to show the same behaviour).

The following works fine:

import tkFileDialog
f = tkFileDialog.as kopenfilename()

No problem, I can chose a filename.

But when switching the locale (in my case to German) like this:

import locale
locale.setlocal e(locale.LC_ALL , '')

the file dialog won't work anymore. The traceback is:

Traceback (most recent call last):
File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 1406, in __call__
return self.func(*args )
File "TextSTAT.p yw", line 701, in datei_hinzu
dateinamen = tkFileDialog.as kopenfilename(i nitialdir=cfg['FileDir'],
filetypes= (('All', '*.*'),('Text', '*.txt'),('HTML ', '*.htm*'),('MS Word',
'*.doc'),('MS Word 2007', '*.docx'),('Ope nOffice 1.x',
'*.sxw'),('Open Office 2.x', '*.odt')), multiple=1)
File "/usr/lib/python2.5/lib-tk/tkFileDialog.py ", line 125, in
askopenfilename
return Open(**options) .show()
File "/usr/lib/python2.5/lib-tk/tkCommonDialog. py", line 48, in show
s = w.tk.call(self. command, *w._options(sel f.options))
TclError: expected floating-point number but got "0.0"
Switching back to the C-locale solves the problem:
locale.setlocal e(locale.LC_ALL , 'C')

tkFileDialog will work again.

Any ideas?

Best, Matthias

Sep 23 '08 #1
0 1188

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2858
by: Tim Williams | last post by:
I just installed Python 2.3 on my Redhat system. When I tried to run one of my programs that use tkFileDialog.askopenfilename(), I got an error because it returns a tuple instead of a null string when I select Cancel. Python 2.2: Python 2.2.2 (#3, Jan 21 2003, 08:39:06) on linux2 Type "help", "copyright", "credits" or "license" for more information.
3
3783
by: Tim Williams | last post by:
Hi. I'm using Python 2.3 and trying to use tkFileDialog to get a list of files. I get a message about the '-multiple' option is not a valid option in the call to Open. Python 2.3 (#1, Aug 4 2003, 10:43:11) on linux2 Type "help", "copyright", "credits" or "license" for more information.
2
2513
by: Tim Williams | last post by:
I'm using Python 2.3.2 and tkFileDialog in a program I have. I'm trying to use this on Linux (RH 8.0) and Windows 2000. When I first upgraded from v2.2 to v2.3. I noticed that tkFileDialog.askopenfilename() returns a tuple on Cancel instead of ''. I found that the Windows version still returns a string (''). Now I'm finding out that tkFileDialog.Directory().show() does this too. >>> d1=tkFileDialog.Directory().show() >>>...
2
4290
by: Read Roberts | last post by:
I have the current Windows binary install of Python 2.3.4 on my Windows XP system. I am pained to discover that tkFileDialog.askdirectory() returns a mangled path when a directory is selected which has non-ascii Unicode path, as in Kanji characters, i.e. the usull "????" in place of the original UTF-8 code points. . After some time spent Google'ing. I don't find a discussion of this. Is there some option or configuration change I...
4
7852
by: Roger Leigh | last post by:
Hello, I'm writing a fixed-precision floating point class, based on the ideas in the example fixed_pt class in the "Practical C++ Programming" book by Steve Oualline (O' Reilly). This uses a long int to store the value, and the precision (number of decimal points) is variable (it's a templated class): template <size_t _decimal_places = 4> class FixedFloat {
3
3536
by: gelbeiche | last post by:
I have a question regarding the following small C program. #include <locale.h> int main() { char* loc = 0; char before,after; int i;
0
938
by: John Wheez | last post by:
Hi all, I'm using teh tkFileDialog to let teh user select a directory. We have long names which make it difficult to view the directories. For some reason the GUI windows doesn;t expand on Windows like it does on OS X or Linux. Is there a method to make the widths of the tkFileDialog windows larger when using Windows XP?
9
2145
by: cdroulers | last post by:
Hello, I am working on a school project that requires me to get the path of a filename for future treatment. I've tried getting a file with tkFileDialog.askopenfile. ******************************************** import tkFileDialog file = tkFileDialog.askopenfile() print file
4
2124
by: mdmdmd | last post by:
Hello, I wish to collect 4 files from a user. So I have decided to use tkFileDialog askopenfilename. My problem is that after a few file selections the root window is destroyed (the whole program just dissappears) I have created a simple example and was able to reproduce the same thing with this. I've just started using tkinter so I have no idea what I may be doing wrong. If anyone has any ideas please let me know.
0
8823
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9530
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9238
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8237
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4593
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.