[issue1272] Decode __file__ and co_filename to unicode using fs default

Christian Heimes report at bugs.python.org
Sun Oct 14 02:57:17 CEST 2007


Christian Heimes added the comment:

Guido van Rossum wrote:
> - Why copy the default encoding before mangling it?  With a little extra
> care you will only have to copy it once. 

Now I remember why I added the strncpy() call plus encoding[31] = '\0'.
I wanted to make sure that the code doesn't break even if the encoding
name is longer than 31 + 1 chars long. I'm aware that it's very unlikely
but I didn't want to take chances. You are allowed to call me paranoid. *g*

Christian

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1272>
__________________________________


More information about the Python-bugs-list mailing list