bzr-svn does not work well when USERNAME is a multi-byte letter.

Bug #333121 reported by kelley567jp
4
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
Fix Released
Undecided
Jelmer Vernooij

Bug Description

bzr-svn does not work well when USERNAME is a multi-byte letter.

bzr --version
Bazaar (bzr) 1.12 (I change lib/msvcp60.dll for the other version and use it.)

.bzr.log
0.078 bzr arguments: [u'branch', u'http://www.openjpeg.org/svn/trunk', u'openjpeg']
0.078 looking for plugins in C:/Documents and Settings/MULTIBYTE_NAME/Application Data/bazaar/2.0/plugins
0.078 looking for plugins in C:/Program Files/Bazaar/plugins
0.188 encoding stdout as sys.stdout encoding 'cp932'
1.203 bzr-svn: using Subversion 1.5.4 ()
2.828 opening SVN RA connection to 'http://www.openjpeg.org/svn/trunk'
4.125 Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 896, in run_bzr_catch_errors
  File "bzrlib\commands.pyo", line 842, in run_bzr
  File "bzrlib\commands.pyo", line 542, in run_argv_aliases
  File "bzrlib\builtins.pyo", line 1016, in run
  File "bzrlib\bzrdir.pyo", line 905, in open_tree_or_branch
  File "bzrlib\bzrdir.pyo", line 890, in _get_tree_branch
  File "C:/Program Files/Bazaar/plugins\svn\remote.py", line 180, in open_branch
  File "C:/Program Files/Bazaar/plugins\svn\remote.py", line 90, in find_repository
  File "C:/Program Files/Bazaar/plugins\svn\repository.py", line 268, in __init__
  File "encodings\mbcs.pyo", line 21, in decode
UnicodeEncodeError: 'ascii' codec can't encode characters in position 26-27: ordinal not in range(128)

4.125 return code 4

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 333121] [NEW] bzr-svn does not work well when USERNAME is a multi-byte letter.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This is specific to windows, so there's no way for me to properly debug
this.

Please run this in a python terminal:

"C:/Documents and Settings/MULTIBYTE_NAME/Application
Data/bazaar/2.0/plugins".decode("mbcs")

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iJwEAQECAAYFAkmiGPQACgkQDLQl4QYPZuV6sQP+IzU87TaR0v8cGeXdssZjQm5H
162HWuFX8YxoG1eRXPMWkF6fcTevxlsJkT+zx7zsPi2IRNOMPWkq2Ah5tQADdlm6
nlU5qDKPcJCnE0Kbi7VTz+GoE7I6R0o24/ablGLSSlFMf530476xTAmrrT57r2T4
1cj3+T/AnmouWP6aU7s=
=emdc
-----END PGP SIGNATURE-----

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've also added some more asserts to trunk; please try again with that,
it should print some different errors to help debug this problem.

Cheers,

Jelmer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iJwEAQECAAYFAkmiGcwACgkQDLQl4QYPZuWkOAP9Ht2ENXPCfzLeaRnJ0xDkKTAi
YPfu6HkxNZI3aJhKxJcfspDR5a076TPReuI0PbJ7RUR5YIfdV2q8f4Go7rpMXCdM
608nSqZllFoGj9V1Zel4Kz6i0fi5SZzlpXZ+3l+ZUkjsu6drKjp85dvaJIMn7Q0Z
ABKljXY+Onu6Fex02iI=
=vHCV
-----END PGP SIGNATURE-----

Revision history for this message
kelley567jp (kelley567) wrote :

I try it.

>Please run this in a python terminal:
>"C:/Documents and Settings/MULTIBYTE_NAME/Application
Data/bazaar/2.0/plugins".decode("mbcs")

on python 2.5.4:
"C:/Documents and Settings/ソラシド/Application Data/bazaar/2.0/plugins".decode("mbcs")
u'C:/Documents and Settings/\u30bd\u30e9\u30b7\u30c9/Application Data/bazaar/2.0/plugins'

Revision history for this message
kelley567jp (kelley567) wrote :

I try it.
>I've also added some more asserts to trunk; please try again with that,
>it should print some different errors to help debug this problem.

bzr-svn revno 2665

.bzr.log
0.110 bzr arguments: [u'branch', u'http://www.openjpeg.org/svn/trunk', u'openjpeg2']
0.110 looking for plugins in C:/Documents and Settings/MULTIBYTE_NAME/Application Data/bazaar/2.0/plugins
0.110 looking for plugins in C:/Program Files/Bazaar/plugins
0.266 encoding stdout as sys.stdout encoding 'cp932'
1.313 bzr-svn: using Subversion 1.5.4 ()
2.954 opening SVN RA connection to 'http://www.openjpeg.org/svn/trunk'
4.266 Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 896, in run_bzr_catch_errors
  File "bzrlib\commands.pyo", line 842, in run_bzr
  File "bzrlib\commands.pyo", line 542, in run_argv_aliases
  File "bzrlib\builtins.pyo", line 1016, in run
  File "bzrlib\bzrdir.pyo", line 905, in open_tree_or_branch
  File "bzrlib\bzrdir.pyo", line 890, in _get_tree_branch
  File "C:/Program Files/Bazaar/plugins\svn\remote.py", line 189, in open_branch
  File "C:/Program Files/Bazaar/plugins\svn\remote.py", line 99, in find_repository
  File "C:/Program Files/Bazaar/plugins\svn\repository.py", line 318, in __init__
  File "encodings\mbcs.pyo", line 21, in decode
UnicodeEncodeError: 'ascii' codec can't encode characters in position 26-27: ordinal not in range(128)

4.329 return code 4

Revision history for this message
kelley567jp (kelley567) wrote :

I attach a patch.
I confirmed that I worked in Windows environment.

Environment
Windows XP Home Editions SP3

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 333121] Re: bzr-svn does not work well when USERNAME is a multi-byte letter.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

kelley567jp wrote:
> I attach a patch.
> I confirmed that I worked in Windows environment.
>
> Environment
> Windows XP Home Editions SP3
>
> ** Attachment added: "USERNAME is a multi-byte letter, but bzr-svn works well."
>
I don't see how that patch could work:

+ cache_file = unicode(os.path.join(cache_dir, 'cache-v%d' %
CACHE_DB_VERSION))
             assert isinstance(cache_file, str)

Here you always create a unicode object and then assert that it's a str
object; this would fail I think.

Also, please patch cache/__init__.py, inside the if at line 46 only, as
that's the only bit that's Windows-specific.

Cheers,

Jelmer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iJwEAQECAAYFAkmifdAACgkQDLQl4QYPZuWnrQP/W8MLegFSjP9TvXxzlv7TgNJW
DRFQ9UeicGIaalBQJ/xMSl2xZ/CNnpTWhw+pIS/u1UT4GW5AmCs95Pvv3XUjMBDC
SD4qDx9v9ueAo4yRtgda2OqKhs2Agtfn88BE9cgNMv7sdGN5k47Ay433GspL5QMs
HDog9eUSW7o/0rhnif0=
=sk/4
-----END PGP SIGNATURE-----

Revision history for this message
kelley567jp (kelley567) wrote :

I cannot cope only in a revision of cache/__init__.py.
cache_dir comes to become str in the case of "nt" sys.platform.
But to be environment of this place is "win32",and the type of cache_dir is unicode.
When I make cache_dir str, a revision is necessary in 326 lines of repository.py.
There seems to be influence in get_transport of bzrlib.

I attach the patch of the draft amendment.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Thanks, I've committed a fix based on your patch.

   status fixreleased

Changed in bzr-svn:
status: New → Fix Released
Revision history for this message
kelley567jp (kelley567) wrote :

UnicodeDecodeError occurred in logging by a former revision.
I attach a revision patch.

kelley567jp (kelley567)
Changed in bzr-svn:
status: Fix Released → In Progress
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

  status fixreleased
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Changed in bzr-svn:
status: In Progress → Fix Released
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
assignee: nobody → Jelmer Vernooij (jelmer)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.