INADA Naoki wrote:
>> Martin [gz] wrote:
>>> Ack, was that big a follow up needed? I only intended to suggest something
>> like:
>>> - full_path = osutils.pathjoin(self._root, prefix, relpath)
>>> + full_path = osutils.pathjoin(self._root, prefix, relpath.encode(
>>> + sys.getfilesystemencoding() or 'ascii', 'replace').replace(
>>> + "?", "_"))
>> ^- This should probably be 'osutils._fs_enc' where we already handle fs
>> encoding of None.
>
> subprocess.Popen uses os.execv(), and os.execv() use Py_FileSystemDefaultEncoding (=sys.getfilesystemencoding()) to encode arguments. When filesystemencoding is NULL, fallbacks to defaultencoding.
>
> osutils._fs_enc fallbacks to 'utf-8'. So using osutils._fs_enc may cause UnicodeEncodeError on Popen.
> # I think osutils._fs_enc fallbacks to utf-8 is good because I hope bzr uses
> # utf-8 when I set LANG=C.
If you set LANG=C then we see fs_enc as ascii, not None.
The change was primarily for BSD, where fs_enc was None, and we wanted
UTF-8 as the most reasonable option.
However, if execv is going to fail if we pass something other than
ascii, then fair enough.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
INADA Naoki wrote: pathjoin( self._root, prefix, relpath) pathjoin( self._root, prefix, relpath.encode( emencoding( ) or 'ascii', 'replace').replace( faultEncoding (=sys.getfilesy stemencoding( )) to encode arguments. When filesystemencoding is NULL, fallbacks to defaultencoding.
>> Martin [gz] wrote:
>>> Ack, was that big a follow up needed? I only intended to suggest something
>> like:
>>> - full_path = osutils.
>>> + full_path = osutils.
>>> + sys.getfilesyst
>>> + "?", "_"))
>> ^- This should probably be 'osutils._fs_enc' where we already handle fs
>> encoding of None.
>
> subprocess.Popen uses os.execv(), and os.execv() use Py_FileSystemDe
>
> osutils._fs_enc fallbacks to 'utf-8'. So using osutils._fs_enc may cause UnicodeEncodeError on Popen.
> # I think osutils._fs_enc fallbacks to utf-8 is good because I hope bzr uses
> # utf-8 when I set LANG=C.
If you set LANG=C then we see fs_enc as ascii, not None.
The change was primarily for BSD, where fs_enc was None, and we wanted
UTF-8 as the most reasonable option.
However, if execv is going to fail if we pass something other than
ascii, then fair enough.
John
=:->
-----BEGIN PGP SIGNATURE----- enigmail. mozdev. org/
H/RkACgkQJdeBCY SNAAPZdACgo0Dy7 48l7zTEzTElE5Gj 8tL5 qwFcz1H92xlmlDN t2VoskBII
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAku
ZnMAoJO+
=W/Bm
-----END PGP SIGNATURE-----