Author vstinner
Recipients amaury.forgeotdarc, vstinner
Date 2008-10-07.13:50:10
SpamBayes Score 5.72246e-09
Marked as misclassified No
Message-id <200810071550.28747.victor.stinner@haypocalc.com>
In-reply-to <1223384761.41.0.362907022937.issue3975@psf.upfronthosting.co.za>
Content
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?
History
Date User Action Args
2008-10-07 13:50:11vstinnersetrecipients: + vstinner, amaury.forgeotdarc
2008-10-07 13:50:10vstinnerlinkissue3975 messages
2008-10-07 13:50:10vstinnercreate