STINNER Victor <[EMAIL PROTECTED]> added the comment: Le Tuesday 07 October 2008 15:06:01 Amaury Forgeot d'Arc, vous avez écrit : > - The two calls to open() are missing the O_BINARY flag, necessary on > Windows to avoid newline translation. This may be important for some > codecs.
Oops, I always forget Windows specific options :-/ > - the GIL should be released around calls to open(); searching the whole > sys.path can be long. Ok, O_BINARY and GIL fixed. I just realized that sys.path is considered as a bytes string (PyBytes_Check) whereas Python3 uses an unicode string! ['', '/home/haypo/prog/python-ptrace', (...)] >>> sys.path.append(b'bytes'); sys.path ['', '/home/haypo/prog/python-ptrace', '(...)', b'bytes'] Oops, so it's possible to mix strings and bytes. But the normal case is a list of unicode strings. Another fix is needed :-/ I don't know how to get into "if (fd < 0)" (code using sys.path). Any clue? > Besides this, the "char* filename" is relevant only on utf8-encoded > filesystems, and will not work on windows with non-ascii filenames. But > this is another issue. I don't know the Windows API enough to answer. Doesn't Python provide "high level" functions to open a file? _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3975> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com