Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread Ulrich Eckhardt
On Thursday 11 December 2008, Steve Holden wrote: Ulrich Eckhardt wrote: If readdir() returned Unicode text, people would start taking that for granted. If it returned bytes, just the same. Returning a completely unrelated type will give them enough hint that for this thing they have to

Re: [Python-Dev] The endless GIL debate: why not remove thread support instead?

2008-12-12 Thread Stefan Behnel
Hi, replying to the topic only: because many C libraries support threading and Python extension modules can integrate them in a way that allows concurrency in a safe way (although 'safe' is definitely something that is paid for in developer days). Stefan

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread Ulrich Eckhardt
On Thursday 11 December 2008, Adam Olsen wrote: The simplest solution there is to have windows bytes APIs that return raw UTF-16 bytes (note that windows does NOT guaranteed to be valid unicode, despite being much more likely than on linux). Actually, I'm not aware of this case. I only know

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread Stephen J. Turnbull
Toshio Kuratomi writes: Adam Olsen wrote: On Thu, Dec 11, 2008 at 6:55 PM, Stephen J. Turnbull step...@xemacs.org wrote: Unfortunately, even programmers experienced in I18N like Martin, and those with intuition-that-has-the-force-of-lawwink like Guido, express deliberate

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread André Malo
* Adam Olsen wrote: UTF-8 in percent encodings is becoming a defacto standard. Otherwise the browser has to display the percent escapes in the address bar, rather than the intended text. Duh! The address bar should contain the URL, which *is* the intended text. The escapes are there for a

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread Ulrich Eckhardt
On Friday 12 December 2008, Stephen J. Turnbull wrote: I gather that the BFDL's line on this thread of discussion is that forcing programmers to think about encodings every time they call out to the OS is unacceptable Exactly that is not necessary. for n in os.readdir('.'): f =

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread Adam Olsen
On Fri, Dec 12, 2008 at 2:11 AM, André Malo n...@perlig.de wrote: * Adam Olsen wrote: UTF-8 in percent encodings is becoming a defacto standard. Otherwise the browser has to display the percent escapes in the address bar, rather than the intended text. Duh! The address bar should contain

Re: [Python-Dev] The endless GIL debate: why not remove thread support instead?

2008-12-12 Thread Paul Moore
2008/12/12 Sturla Molden stu...@molden.no: Last month there was a discussion on Python-Dev regarding removal of reference counting to remove the GIL. I hope you forgive me for continuing the debate. [...] Python could be better off doing what tcl does. Allow each process to embed multiple

Re: [Python-Dev] The endless GIL debate: why not remove thread support instead?

2008-12-12 Thread Lennart Regebro
On Fri, Dec 12, 2008 at 02:13, Sturla Molden stu...@molden.no wrote: I genuinely think the use of threads should be discouraged. It leads to code that are full of bugs and difficult to maintain - race conditions, deadlocks, and livelocks are common pitfalls. The use of threads for load

Re: [Python-Dev] The endless GIL debate: why not remove thread support instead?

2008-12-12 Thread Sturla Molden
On 12/12/2008 11:52 AM, Lennart Regebro wrote: The use of threads for load balancing should be discouraged, yes. That is not what they are designed for. Threads are designed to allow blocking processes to go on in the background without blocking the main process. It seems that most

Re: [Python-Dev] The endless GIL debate: why not remove thread support instead?

2008-12-12 Thread Nick Coghlan
Sturla Molden wrote: Last month there was a discussion on Python-Dev regarding removal of reference counting to remove the GIL. I hope you forgive me for continuing the debate. Anything to do with removing the GIL/threads/whatever other core language feature someone doesn't like really belongs

Re: [Python-Dev] The endless GIL debate: why not remove thread support instead?

2008-12-12 Thread Nick Coghlan
Paul Moore wrote: 2. I'd like to see isolation based on multiple interpreters, but the problem lies with extensions (and at a lower level with the Python C API) which wasn't designed with isolation in mind. Changing that may be nice, but it's probably too late (or if not, it's likely to be a

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread Antoine Pitrou
Curt Hagenlocher curt at hagenlocher.org writes: On Thu, Dec 11, 2008 at 10:19 PM, Adam Olsen rhamph at gmail.com wrote: I doubt that UTF-16 is used very much (other than on windows). There's this other obscure platform called Java... ;) Does it have a filesystem?

Re: [Python-Dev] Build failure on OpenBSD 4.4-current

2008-12-12 Thread Antoine Pitrou
Hello, Edd Barrett vext01 at gmail.com writes: I just had to move the extern lstat... outside the ifndef HAVE_LSTAT to get python 2.6.1 to build on OpenBSD 4.4-current/i386. Could you please open an issue in http://bugs.python.org ? That way the problem is less likely to be overlooked. By

Re: [Python-Dev] Build failure on OpenBSD 4.4-current

2008-12-12 Thread Edd Barrett
Hi, On Fri, Dec 12, 2008 at 1:17 PM, Antoine Pitrou solip...@pitrou.net wrote: Could you please open an issue in http://bugs.python.org ? That way the problem is less likely to be overlooked. http://bugs.python.org/issue4639 Thanks -- Best Regards Edd

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread Curt Hagenlocher
On Fri, Dec 12, 2008 at 5:06 AM, Antoine Pitrou solip...@pitrou.net wrote: Curt Hagenlocher curt at hagenlocher.org writes: There's this other obscure platform called Java... ;) Does it have a filesystem? No, but it also has to interact with filesystems of possibly invalid or indeterminate

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread Antoine Pitrou
Curt Hagenlocher curt at hagenlocher.org writes: No, but it also has to interact with filesystems of possibly invalid or indeterminate encodings. What does java.io do? My point was that Python doesn't have to interact with the Java IO libraries, while it has to interact with the Unix and

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread Curt Hagenlocher
On Fri, Dec 12, 2008 at 6:19 AM, Antoine Pitrou solip...@pitrou.net wrote: Curt Hagenlocher curt at hagenlocher.org writes: No, but it also has to interact with filesystems of possibly invalid or indeterminate encodings. What does java.io do? My point was that Python doesn't have to

Re: [Python-Dev] The endless GIL debate: why not remove thread support instead?

2008-12-12 Thread Christian Heimes
Nick Coghlan schrieb: Actually, I believe 3.0 already took a big step towards allowing this by changing the way modules are initialised. You are believing correctly. Martin has designed and implemented a nicely working API to store extension module data per interpreter state. For now

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread Scott Dial
Curt Hagenlocher wrote: On Fri, Dec 12, 2008 at 6:19 AM, Antoine Pitrou solip...@pitrou.net wrote: Curt Hagenlocher curt at hagenlocher.org writes: No, but it also has to interact with filesystems of possibly invalid or indeterminate encodings. What does java.io do? My point was that Python

[Python-Dev] 2to3 question about fix_imports.

2008-12-12 Thread Lennart Regebro
The fix_imports fix seems to fix only the first import per line that you have. So if you do for example import urllib2, cStringIO it will not fix cStringIO. Is this a bug or a feature? :-) If it's a feature it should warn at least, right? -- Lennart Regebro: Zope and Plone consulting.

Re: [Python-Dev] 2to3 question about fix_imports.

2008-12-12 Thread Victor Stinner
Le Friday 12 December 2008 17:39:33 Lennart Regebro, vous avez écrit : The fix_imports fix seems to fix only the first import per line that you have. So if you do for example import urllib2, cStringIO it will not fix cStringIO. Is this a bug or a feature? :-) I prefer to see that as a

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread Toshio Kuratomi
Adam Olsen wrote: UTF-8 in percent encodings is becoming a defacto standard. Otherwise the browser has to display the percent escapes in the address bar, rather than the intended text. IOW, inconsistent behaviour is a bug, but translating into UTF-8 is not. ;) I think we should let this

Re: [Python-Dev] The endless GIL debate: why not remove thread support instead?

2008-12-12 Thread Thomas Heller
Christian Heimes schrieb: Nick Coghlan schrieb: Actually, I believe 3.0 already took a big step towards allowing this by changing the way modules are initialised. You are believing correctly. Martin has designed and implemented a nicely working API to store extension module data per

Re: [Python-Dev] The endless GIL debate: why not remove thread support instead?

2008-12-12 Thread Lennart Regebro
On Fri, Dec 12, 2008 at 12:23, Sturla Molden stu...@molden.no wrote: It seems that most programmers with Java or Windows experience don't understand this; hence the ever lasting GIL debate. Yes. Maybe writing this with big letters in the thread module docs would help? I am not suggesting

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread Lennart Regebro
On Fri, Dec 12, 2008 at 16:21, Scott Dial scott+python-...@scottdial.com wrote: See the following email for a summary of existing practice (as of 2004): http://www.mail-archive.com/unic...@unicode.org/msg27352.html Interesting. Quite a lot of them do just drop the undecodable filenames. The

[Python-Dev] Summary of Python tracker Issues

2008-12-12 Thread Python tracker
ACTIVITY SUMMARY (12/05/08 - 12/12/08) Python tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue number. Do NOT respond to this message. 2261 open (+58) / 14206 closed (+37) / 16467 total (+95) Open issues with patches: 763

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread glyph
On 02:23 pm, c...@hagenlocher.org wrote: On Fri, Dec 12, 2008 at 6:19 AM, Antoine Pitrou solip...@pitrou.net wrote: Curt Hagenlocher curt at hagenlocher.org writes: No, but it also has to interact with filesystems of possibly invalid or indeterminate encodings. What does java.io do? My

Re: [Python-Dev] The endless GIL debate: why not remove thread support instead?

2008-12-12 Thread Nick Coghlan
Thomas Heller wrote: Christian Heimes schrieb: Nick Coghlan schrieb: Actually, I believe 3.0 already took a big step towards allowing this by changing the way modules are initialised. You are believing correctly. Martin has designed and implemented a nicely working API to store extension

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread André Malo
* Adam Olsen wrote: On Fri, Dec 12, 2008 at 2:11 AM, André Malo n...@perlig.de wrote: * Adam Olsen wrote: UTF-8 in percent encodings is becoming a defacto standard. Otherwise the browser has to display the percent escapes in the address bar, rather than the intended text. Duh! The

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread Adam Olsen
On Fri, Dec 12, 2008 at 9:47 PM, André Malo n...@perlig.de wrote: * Adam Olsen wrote: On Fri, Dec 12, 2008 at 2:11 AM, André Malo n...@perlig.de wrote: * Adam Olsen wrote: UTF-8 in percent encodings is becoming a defacto standard. Otherwise the browser has to display the percent escapes

Re: [Python-Dev] Python-3.0, unicode, and os.environ

2008-12-12 Thread André Malo
* Adam Olsen wrote: On Fri, Dec 12, 2008 at 9:47 PM, André Malo n...@perlig.de wrote: * Adam Olsen wrote: On Fri, Dec 12, 2008 at 2:11 AM, André Malo n...@perlig.de wrote: * Adam Olsen wrote: UTF-8 in percent encodings is becoming a defacto standard. Otherwise the browser has to

[Python-Dev] Psyco for -OO or -O

2008-12-12 Thread Lie Ryan
I'm sure probably most of you knows about psyco[1], the optimizer. Python has an -O and -OO flag that is intended to be optimization flag, but we know that currently it doesn't do much. Why not add psyco as standard library and let -O or -OO invoke psyco? [1]