Message56408
Christian wrote:
> Alexandre's mangle loop doesn't do the same job as mine. Chars like _
> and - aren't removed from the encoding name and the if clauses don't
> catch for example UTF-8 or ISO-8859-1 only UTF8 or ISO8859-1.
That isn't true. My mangler does exactly the same thing as your
original one.
However, I forgot to add Py_CHARMASK to the calls of tolower() and
isalnum() which would cause problems on platforms with signed char.
> Also he has overseen a PyString_Check in the code repr function.
Fixed.
> We have to get the codecs up and Py_FileSystemEncoding before we can
> decode the filenames. :( I think that the problem needs much more
> attention and a proper fix.
Maybe adding a global variable, let's say _Py_Codecs_Ready, could be
used to notify PyUnicode_DecodeFSDefault that it can use
PyUnicode_Decode, instead of relying only on the built-in codecs. That
would be much simpler than changing boostrapping process.
Here yet another updated patch. The changes are the following:
- Add Py_CHARMASK to tolower() and isalnum() calls in
PyUnicode_DecodeFSDefault().
- Use PyUnicode_Check(), instead of PyString_Check(), in
code_repr().
- Update comments for co_filename and co_name in PyCodeObject
struct definition.
- Fix a PyString_AS_STRING(co->co_name) instance in compile.c
- Replace %S for %U in PyErr_Format() calls for substituting co_name.
One more thing, frozen.c needs to be updated. The module data contains
a code object with a PyString co_name. However, there is a bug in the
imp module (it doesn't detect the encoding from modelines, which cause
io.TextIOWrapper to crash) that prevents me from generating the data
for frozen.c. |
|
Date |
User |
Action |
Args |
2007-10-14 04:35:08 | alexandre.vassalotti | set | spambayes_score: 0.0132136 -> 0.013213555 recipients:
+ alexandre.vassalotti, gvanrossum, christian.heimes |
2007-10-14 04:35:06 | alexandre.vassalotti | set | spambayes_score: 0.0132136 -> 0.0132136 messageid: <1192336506.88.0.448378594514.issue1272@psf.upfronthosting.co.za> |
2007-10-14 04:35:06 | alexandre.vassalotti | link | issue1272 messages |
2007-10-14 04:35:04 | alexandre.vassalotti | create | |
|