error during bzr add

John Arbash Meinel john at arbash-meinel.com
Fri Jul 20 05:14:36 BST 2007


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

Alaa Salman wrote:
> Hmmm....
> 
> I can't reproduce it anymore it seems. Weird. I rebooted into Windows to
> try
> it again, and it doesn't manifest this problem anymore.(crappy windows, i
> hate it when reboots solve seemingly unknown problems) However, i will
> paste
> the error from bzr.log file in any case. Oh, and it is happening in the add
> phase not in the commit phase.
> 
> bzr arguments: [u'add', u'*']

...

> Files\\Bazaar\\lib\\library.zip\\bzrlib\\plugins'
> encoding stdout as sys.stdout encoding 'cp437'
> Traceback (most recent call last):

...

>  File "bzrlib\transport\__init__.pyc", line 1127, in get_transport
>  File "bzrlib\transport\__init__.pyc", line 1117, in convert_path_to_url
>  File "bzrlib\urlutils.pyc", line 273, in _win32_local_path_to_url
>  File "bzrlib\osutils.pyc", line 269, in _win32_abspath
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xbb in position 24:
> ordinal not in range(128)
> 
> return code 3

Well, that looks like it is specifically failing at a very weird time.


a) I don't believe we have expanded the '*' glob yet. So we are looking
for the containing working tree for a path named '*'.

b) The code in that area is:
def _win32_abspath(path):
    # Real _nt_abspath doesn't have a problem with a unicode cwd
    return _win32_fixdrive(_nt_abspath(unicode(path)).replace('\\', '/'))


So it would seem that the 'unicode(path)' is the portion that is
failing. At least, that makes the most sense, because the others would
be failing inside another function, which would mean the traceback
should be another level deeper.

However, the error is also claiming that it is failing 'at position 24',
and the path u'*' only has 1 character (not 24).


One thing that you might try, is to cd into a non-ascii subdirectory,
and do 'bzr add *'.

I still can't figure out how that path would not be ascii (or a unicode
object). I can see that earlier we do:

try:
  base = base.encode('ascii')
except UnicodeError:
  # effectively, not actually what we call
  base = urlutils.local_path_to_url(base)

(ultimately, just to say, weird stuff is happening here)

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

iD8DBQFGoDasJdeBCYSNAAMRAqP0AJ9xaPoD9yM0sI++0elUzaFUnzgF6QCbBF1j
sdiGPukgGlDaAWehEhucb8o=
=FbAd
-----END PGP SIGNATURE-----



More information about the bazaar mailing list