bzr init crash: invalid decimal Unicode string
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I simply run `bzr init foo` after installing bzr and I always get the following error:
{{{
$ bzr init foo
bzr: ERROR: exceptions.
Traceback (most recent call last):
File "/nail/
return the_callable(*args, **kwargs)
File "/nail/
ret = run(*run_argv)
File "/nail/
return self.run(
File "/nail/
return self._operation
File "/nail/
self.cleanups, self.func, *args, **kwargs)
File "/nail/
result = func(*args, **kwargs)
File "/nail/
force_
File "/nail/
controldir = klass.create(base, format, possible_
File "/nail/
return format.
File "/nail/
return self._initializ
File "/nail/
control_
File "/nail/
token_from_lock = self._lock.
File "/nail/
return self.wait_lock()
File "/nail/
new_info)
File "/nail/
d = self.to_
File "/nail/
time.time() - int(self.
UnicodeEncodeError: 'decimal' codec can't encode character u'\U00340031' in position 0: invalid decimal Unicode string
bzr 2.6.0 on python 2.6.7 (Linux-
Ubuntu-
arguments: ['/nail/
'init', 'foo']
plugins: bash_completion
launchpad[
po_
encoding: 'utf-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
*** Bazaar has encountered an internal error. This probably indicates a
bug in Bazaar. You can help us fix it by filing a bug report at
https:/
including this traceback and a description of the problem.
}}}
If I hack bzrlib.
{{{
$ strace -vvffF -o bzr.strace bzr init
Unable to obtain lock file://
(unknown).
Will continue to try until 13:53:54, unless you press Ctrl-C.
See "bzr help break-lock" for more.
Lock owner changed for lock file://
Will continue to try until 13:53:54, unless you press Ctrl-C.
See "bzr help break-lock" for more.
Lock owner changed for lock file://
Will continue to try until 13:53:54, unless you press Ctrl-C.
See "bzr help break-lock" for more.
Lock owner changed for lock file://
(unknown).
Will continue to try until 13:53:54, unless you press Ctrl-C.
See "bzr help break-lock" for more.
Lock owner changed for lock file://
Will continue to try until 13:53:54, unless you press Ctrl-C.
See "bzr help break-lock" for more.
Lock owner changed for lock file://
Will continue to try until 13:53:54, unless you press Ctrl-C.
See "bzr help break-lock" for more.
^Cbzr: interrupted
}}}
There's a bunch of obvious trash data there. It seems the same snuck into the start_time field.
I've attached the strace in case it's helpful.
Adding some debug statements, I get:
{{{ lock/held/ info') blpne\npid: 3988219\ nstart_ time: 1454623896\nuser: <email address hidden>\n') blpne\n' , 'pid: 3988219\n', 'start_time: 1454623896\n', 'user: <email address hidden>\n']) [('hostname' , u'\U00650064\ U00330076\ U002d0034\ U00650064\ U00630076\ x00\U00340031\ U00340035\ U00320036\ U00380033' ), ('nonce', u'\U0061006a\ U00310075\ U00390078\ U006e0065\ U00700073\ U00660070\ U006d0037\ U0062006f\ U0070006c\ U0065006e\ U73640000\ x00\U01b2cc30\ x00\U00832140\ x00\x04\ x00\U23037588\ u7f68') , ('pid', u'\U00390033\ U00380038\ U003100329\ U23035270\ u7f68\x00' ), ('start_time', u'\U00340031\ U00340035\ U00320036\ U00380033\ U00360039\ x00mine' ), ('user', u'\U00750062\ U006b0063\ U00790040\ U006c0065\ U002e0070\ U006f0063m\ x00\U7473694c\ U6b6e7520\ U6e776f6e\ U6c696620\ U0a2e7365' )]))
('PATH:', 'branch-
('INFO FILE BYTES:', 'hostname: dev34-devc\nnonce: jau1x9ensppf7mo
('LINES:', ['hostname: dev34-devc\n', 'nonce: jau1x9ensppf7mo
('STANZA:', Stanza(
}}}
It goes haywire in bzrlib/ _rio_pyx. pyx:_read_ stanza_ utf8, but I find that code inscrutable.
It's likely something to do with the fact that python on osx is built with "short unicode" (UCS2).