Message74450
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? |
|
Date |
User |
Action |
Args |
2008-10-07 13:50:11 | vstinner | set | recipients:
+ vstinner, amaury.forgeotdarc |
2008-10-07 13:50:10 | vstinner | link | issue3975 messages |
2008-10-07 13:50:10 | vstinner | create | |
|