IDLE; Pythonwin and windows network drives

  • Thread starter Tuure Laurinolli
  • Start date
T

Tuure Laurinolli

Some time ago I was playing with the idea of using an actual IDE to
write my python code. I first played with IDLE, but noticed that it was
kind of limited and for some reason it worked extremely slowly when
started from a shortcut on desktop(not so when started from shortcut in
start menu).

Then I tried Pythonwin and noticed that it didn't provide any
indentation help at all - to my surprise. I discarded the idea of using
it, but for some reason tried it again later - only to find indentation
working just fine.

A bit of research revealed that the problem was caused by opening a file
residing on a network drive. How strange.

Some more research and the problem became apparent. When python opened
the file and windows code took over python code, it silently changed the
locale to "the right locale", which happens to use , as decimal
delimiter instead of the "standard" . So when pythonwin(or IDLE, they
use the same indentation code) tried to convert a string into float into
int in order to find the line I was on(strange Tkinter stuff), it
promptly raised an exception because "19.3" obviously wasn't a float -
it contained strange characters!

A dive into python source shows that when python locale is normally set
through appropriate module, it preserves the LC_NUMEERIC locale as the
standard C to ensure correct handling of floating point values and only
sets the user-defined locale for the module-specific functions that
actually make use of it(and resets it back to C-locale whenever user
changes the locale).

Also, Pythonwin and IDLE must use some truly wondrous way to open files
which triggers this behavior, standard open() didn't change anything.

Forgive any mad-rambling-like qualities of this post, It's late (or
early, if you will), and I'm nearly asleep already.
 
P

Peter Maas

Tuure said:
Then I tried Pythonwin and noticed that it didn't provide any
indentation help at all - to my surprise. I discarded the idea of using
it, but for some reason tried it again later - only to find indentation
working just fine.

There seem to be some issues with Pythonwin and network drives / UNC paths.
I observed recently that the install of pythonwin (build 201) failed with
a "freopen stderr" message. After moving the setup exe from an UNC path
to a local path everything worked fine. That happened on my Win2k/SP4
machine and the UNC path was on a Samba 3.0.4 server.

Mit freundlichen Gruessen,

Peter Maas
 
T

Thomas Heller

Peter Maas said:
There seem to be some issues with Pythonwin and network drives / UNC paths.
I observed recently that the install of pythonwin (build 201) failed with
a "freopen stderr" message. After moving the setup exe from an UNC path
to a local path everything worked fine. That happened on my Win2k/SP4
machine and the UNC path was on a Samba 3.0.4 server.

That would probably be a bug in the bdist_wininst installer, but I
cannot reproduce it. Although I can only test with my WinXP machine,
and UNC paths on Windows servers.

Can you or anyone else reproduce what you describe?

Thomas
 
D

David Fraser

Thomas said:
That would probably be a bug in the bdist_wininst installer, but I
cannot reproduce it. Although I can only test with my WinXP machine,
and UNC paths on Windows servers.

Can you or anyone else reproduce what you describe?

I have had this bug, I think it may be related to reinstalling pythonwin
on top of intself. I had it on Win2k, also installing from a samba server.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top