Re: [Python-Dev] Status of MS Windows CE port

2008-09-29 Thread Ulrich Eckhardt
On Friday 26 September 2008, Martin v. Löwis wrote: Please don't. Whether or not _UNICODE is defined should have no effect. Well, currently it does make a difference. Simple example: CreateFile(). It's not so simple: Python doesn't actually call CreateFile, AFAICT (well, it does, in

Re: [Python-Dev] Filename as byte string in python 2.6 or 3.0?

2008-09-29 Thread Ulrich Eckhardt
On Sunday 28 September 2008, Gregory P. Smith wrote: broken systems will always exist. Code to deal with them must be possible to write in python 3.0. since any given path (not just fs) can have its own encoding it makes the most sense to me to let the OS deal with the errors and not try to

Re: [Python-Dev] Filename as byte string in python 2.6 or 3.0?

2008-09-29 Thread M.-A. Lemburg
On 2008-09-29 12:50, Ulrich Eckhardt wrote: On Sunday 28 September 2008, Gregory P. Smith wrote: broken systems will always exist. Code to deal with them must be possible to write in python 3.0. since any given path (not just fs) can have its own encoding it makes the most sense to me to

Re: [Python-Dev] Filename as byte string in python 2.6 or 3.0?

2008-09-29 Thread Victor Stinner
Le Monday 29 September 2008 12:50:03 Ulrich Eckhardt, vous avez écrit : (...) uses an ASCII mapping where possible and codepoints from the Private Use Area (PUA) of Unicode for the non-decodable bytes. That sounds to me like a very *ugly* hack. It remembers me my proposition to create an

Re: [Python-Dev] Filename as byte string in python 2.6 or 3.0?

2008-09-29 Thread Ulrich Eckhardt
On Monday 29 September 2008, M.-A. Lemburg wrote: On 2008-09-29 12:50, Ulrich Eckhardt wrote: 1. For POSIX platforms (using a byte string for the path): Here, the first approach is to convert the path to Unicode, according to the locale's CTYPE category. Hopefully, it will be UTF-8, but

[Python-Dev] New proposition for Python3 bytes filename issue

2008-09-29 Thread Victor Stinner
Hi, After reading the previous discussion, here is new proposition. Python 2.x and Windows are not affected by this issue. Only Python3 on POSIX (eg. Linux or *BSD) is affected. Some system are broken, but Python have to be able to open/copy/move/remove files with an invalid filename. The

Re: [Python-Dev] [Python-3000] Filename as byte string in python 2.6 or 3.0?

2008-09-29 Thread Victor Stinner
Le Monday 29 September 2008 06:43:55, vous avez écrit : It will make users happy, and it's simple enough to implement for python 3.0. I dislike your argument. A quick and dirty hack is always faster to implement than a real solution, but we may hits later new issues if we don't choose the

Re: [Python-Dev] Python security team

2008-09-29 Thread Jan Matejek
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brett Cannon napsal(a): On Sat, Sep 27, 2008 at 8:54 AM, Victor Stinner [EMAIL PROTECTED] wrote: First, I would like to access to these informations. Not only this issue, but all security related issues. I have some knowledges about security and I

Re: [Python-Dev] Filename as byte string in python 2.6 or 3.0?

2008-09-29 Thread Ulrich Eckhardt
On Monday 29 September 2008, [EMAIL PROTECTED] wrote: Also, what about MacOS X? AFAIK, OS X guarantees UTF-8 for filesystem encodings. So the OS also provides Unicode filenames and how it deals with broken or legacy media is left up to the OS. Uli -- Sator Laser GmbH Geschäftsführer:

Re: [Python-Dev] Filename as byte string in python 2.6 or 3.0?

2008-09-29 Thread Jean-Paul Calderone
On Mon, 29 Sep 2008 14:34:07 +0200, Ulrich Eckhardt [EMAIL PROTECTED] wrote: On Monday 29 September 2008, [EMAIL PROTECTED] wrote: Also, what about MacOS X? AFAIK, OS X guarantees UTF-8 for filesystem encodings. So the OS also provides Unicode filenames and how it deals with broken or legacy

Re: [Python-Dev] New proposition for Python3 bytes filename issue

2008-09-29 Thread Victor Stinner
Patches are already avaible in the issue #3187 (os.listdir): Le Monday 29 September 2008 14:07:55 Victor Stinner, vous avez écrit : - listdir(unicode) - unicode and raise an error on invalid filename Need raise_decoding_errors.patch (don't clear Unicode error - listdir(bytes) - bytes

Re: [Python-Dev] Filename as byte string in python 2.6 or 3.0?

2008-09-29 Thread glyph
On 11:59 am, [EMAIL PROTECTED] wrote: Sorry, I wasn't clear enough. I'll try to explain further... Let's assume we have a filename like this: 0xc2 0xa9 0x2f 0x7f The first two bytes are the copyright sign encoded in UTF-8, followed by a slash (0x2f, path separator) and a character encoded

Re: [Python-Dev] ',' precedence in documentation

2008-09-29 Thread Michele Simionato
I like Martin's proposals (use a function, remove -O) very much. Actually I wanted to propose the same months ago. Here is my take at the assert function, which I would like to be able to raise even exceptions different from AssertionError: def assert_(cond, exc, *args): Raise an exception if

Re: [Python-Dev] [Python-3000] New proposition for Python3 bytes filename issue

2008-09-29 Thread Steven Bethard
On Mon, Sep 29, 2008 at 6:07 AM, Victor Stinner [EMAIL PROTECTED] wrote: The default behaviour should be to use unicode and raise an error if conversion to unicode fails. It should also be possible to use bytes using bytes arguments and optional arguments (for getcwd). - listdir(unicode) -

Re: [Python-Dev] [Python-3000] New proposition for Python3 bytes filename issue

2008-09-29 Thread Victor Stinner
Le Monday 29 September 2008 17:16:47 Steven Bethard, vous avez écrit : - getcwd() - unicode - getcwd(bytes=True) - bytes Please let's not introduce boolean flags like this. How about ``getcwdb`` in parallel with the old ``getcwdu``? Yeah, you're right. So i wrote a new patch:

Re: [Python-Dev] Python security team

2008-09-29 Thread David Stanek
On Sat, Sep 27, 2008 at 8:45 PM, Brett Cannon [EMAIL PROTECTED] wrote: On Sat, Sep 27, 2008 at 8:54 AM, Victor Stinner [EMAIL PROTECTED] wrote: I would like to know if a Python security team does exist. I sent an email about an imageop issue, and I didn't get any answer. Later I learned that

Re: [Python-Dev] Broken link to NASM download location

2008-09-29 Thread Georg Brandl
Ulrich Eckhardt schrieb: Hi! In trunk/PCbuild/readme.txt it says NASM is available from kernel.org. The project has moved to Sourceforge though, please replace the link with http://nasm.sf.net Fixed in r66681. Thanks! (In the future, it might be better to open an issue at

Re: [Python-Dev] Python security team

2008-09-29 Thread Guido van Rossum
On Mon, Sep 29, 2008 at 5:11 AM, Jan Matejek [EMAIL PROTECTED] wrote: Brett Cannon napsal(a): On Sat, Sep 27, 2008 at 8:54 AM, Victor Stinner [EMAIL PROTECTED] wrote: First, I would like to access to these informations. Not only this issue, but all security related issues. I have some

Re: [Python-Dev] Python security team

2008-09-29 Thread Giampaolo Rodola'
Yeah, right. Let's continue there. --- Giampaolo http://code.google.com/p/pyftpdlib On 29 Set, 22:44, Josiah Carlson [EMAIL PROTECTED] wrote: On Mon, Sep 29, 2008 at 12:02 PM, Giampaolo Rodola' [EMAIL PROTECTED] wrote: On 27 Set, 20:04, Josiah Carlson [EMAIL PROTECTED] wrote: On Sat, Sep

Re: [Python-Dev] [Python-3000] New proposition for Python3 bytes filename issue

2008-09-29 Thread Adam Olsen
On Mon, Sep 29, 2008 at 10:00 AM, Victor Stinner [EMAIL PROTECTED] wrote: Le Monday 29 September 2008 17:16:47 Steven Bethard, vous avez écrit : - getcwd() - unicode - getcwd(bytes=True) - bytes Please let's not introduce boolean flags like this. How about ``getcwdb`` in parallel with

Re: [Python-Dev] [Python-3000] New proposition for Python3 bytes filename issue

2008-09-29 Thread Adam Olsen
On Mon, Sep 29, 2008 at 11:06 AM, Guido van Rossum [EMAIL PROTECTED] wrote: On Mon, Sep 29, 2008 at 9:45 AM, Georg Brandl [EMAIL PROTECTED] wrote: This approach (changing all path-handling functions to accept either bytes or string, but not both) is doomed in my eyes. First, there are lots of

Re: [Python-Dev] [Python-3000] New proposition for Python3 bytes filename issue

2008-09-29 Thread James Y Knight
On Sep 29, 2008, at 6:17 PM, Adam Olsen wrote: I suspect linux will eventually take this route as well. If ext3 had an option for UTF-8 validation I know I'd want it on. That'd move the error to the program creating bogus file names, rather than those trying to read, display, and manage them.

Re: [Python-Dev] Status of MS Windows CE port

2008-09-29 Thread Martin v. Löwis
Ulrich Eckhardt wrote: Well, currently it does make a difference. Simple example: CreateFile(). It's not so simple: Python doesn't actually call CreateFile Martin, CreateFile() was just used as an example. You can substitute it with LoadString() or CreateProcess() if you like, the problem

Re: [Python-Dev] Filename as byte string in python 2.6 or 3.0?

2008-09-29 Thread Martin v. Löwis
Originally I thought that this was a valid idea, but then it became clear that this could be a problem. Consider a filename which includes a UTF-8 encoding of a PUA code point. I still think it's a valid idea. For non-UTF-8 file system encodings, use PUA characters, and generate them through

Re: [Python-Dev] Filename as byte string in python 2.6 or 3.0?

2008-09-29 Thread Martin v. Löwis
Jack Jansen wrote: I'm a bit late to join in this discussion, but if unicode filenames are going to be the normal mode, how about this whole normalized/canonical business? I don't think there is a change in the current implementation. Users interested in this issue should contribute code that

Re: [Python-Dev] I would like an Python account

2008-09-29 Thread Brett Cannon
On Sat, Sep 27, 2008 at 8:32 AM, Victor Stinner [EMAIL PROTECTED] wrote: Hi, Would it possible to get more permissions on Python bugtracker, especially to add keywords, close a duplicate bug, etc.? Let's start off with giving you Developer permissions on the tracker to start and then you can

Re: [Python-Dev] Filename as byte string in python 2.6 or 3.0?

2008-09-29 Thread Greg Ewing
Ulrich Eckhardt wrote: AFAIK, OS X guarantees UTF-8 for filesystem encodings. So the OS also provides Unicode filenames and how it deals with broken or legacy media is left up to the OS. Does this mean that the OS always returns valid utf-8 strings from filesystem calls, even if the media is

Re: [Python-Dev] [Python-3000] New proposition for Python3 bytes filename issue

2008-09-29 Thread Guido van Rossum
On Mon, Sep 29, 2008 at 4:29 PM, Victor Stinner [EMAIL PROTECTED] wrote: Le Monday 29 September 2008 19:06:01 Guido van Rossum, vous avez écrit : - listdir(unicode) - unicode and raise an error on invalid filename I know I keep flipflopping on this one, but the more I think about it the

Re: [Python-Dev] [Python-3000] New proposition for Python3 bytes filename issue

2008-09-29 Thread Martin v. Löwis
import os import os.path import sys if os.path.supports_unicode_filenames: cwd = getcwd() else: cwd = getcwdb() encoding = sys.getfilesystemencoding() for filename in os.listdir(cwd): if os.path.supports_unicode_filenames: text = str(filename,

Re: [Python-Dev] [Python-3000] New proposition for Python3 bytes filename issue

2008-09-29 Thread Adam Olsen
On Mon, Sep 29, 2008 at 5:29 PM, Victor Stinner [EMAIL PROTECTED] wrote: Le Monday 29 September 2008 19:06:01 Guido van Rossum, vous avez écrit : - listdir(unicode) - unicode and raise an error on invalid filename I know I keep flipflopping on this one, but the more I think about it the

Re: [Python-Dev] Filename as byte string in python 2.6 or 3.0?

2008-09-29 Thread Victor Stinner
Le Tuesday 30 September 2008 01:31:45 Adam Olsen, vous avez écrit : The alternative is not be valid unicode, but since we can't use such objects with external libs, can't even print them, we might as well call them something else. We already have a name for that: bytes. :-)

Re: [Python-Dev] Real segmentation fault handler

2008-09-29 Thread Ralf W. Grosse-Kunstleve
FWIW: I didn't have much luck translating segfaults into exceptions. It (seemed) to work on some platforms, but not others; this was in the context of C++. In my experience, it is more useful to generate Python and C stack traces and bail out. I also do this for floating-point exceptions. The

Re: [Python-Dev] [Python-3000] New proposition for Python3 bytes filename issue

2008-09-29 Thread Stephen J. Turnbull
Guido van Rossum writes: On Mon, Sep 29, 2008 at 4:29 PM, Victor Stinner [EMAIL PROTECTED] wrote: It would be hard for a newbie programmer to understand why he's unable to find his very important file (important r?port.doc) using os.listdir(). *Every* failure in this scenario will

Re: [Python-Dev] Patch for an initial support of bytes filename in Python3

2008-09-29 Thread Brett Cannon
On Mon, Sep 29, 2008 at 5:47 PM, Victor Stinner [EMAIL PROTECTED] wrote: Hi, See attached patch: python3_bytes_filename.patch Patches should go on the tracker, not the mailing list. Otherwise it will just get lost. -Brett ___ Python-Dev mailing