commit fails to invoke external editor in non-ascii directory
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
Dan Watkins |
Bug Description
Hello,
I am just posting my bug report to the mailinglist here. I will forward up with the requested informations in a moment.
Hello!
Now that it happens again I do so as advised and send this error message.
It happens on commit after I changed a file and added some more.
-------
martin@shambala:> bzr commit
bzr: ERROR: exceptions.
0xfc in position 30: ordinal not in range(128)
Traceback (most recent call last):
File "/usr/lib/
run_bzr_
return run_bzr(argv)
File "/usr/lib/
run_bzr
ret = run(*run_argv)
File "/usr/lib/
run_argv_aliases
return self.run(
File "/usr/lib/
in run
message = edit_commit_
File "/usr/lib/
edit_commit_message
tmp_fileno, msgfilename = tempfile.
dir=u'.')
File "tempfile.py", line 302, in mkstemp
return _mkstemp_inner(dir, prefix, suffix, flags)
File "tempfile.py", line 238, in _mkstemp_inner
return (fd, _os.path.
File "posixpath.py", line 403, in abspath
path = join(os.getcwd(), path)
File "posixpath.py", line 65, in join
path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc in position 30:
ordinal not in range(128)
bzr 0.13.0 on python 2.4.4.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'commit']
** please send this report to <email address hidden>
martin@
bzr: ERROR: exceptions.
0xfc in position 30: ordinal not in range(128)
Traceback (most recent call last):
File "/usr/lib/
run_bzr_
return run_bzr(argv)
File "/usr/lib/
run_bzr
ret = run(*run_argv)
File "/usr/lib/
run_argv_aliases
return self.run(
File "/usr/lib/
in run
message = edit_commit_
File "/usr/lib/
edit_commit_message
tmp_fileno, msgfilename = tempfile.
dir=u'.')
File "tempfile.py", line 302, in mkstemp
return _mkstemp_inner(dir, prefix, suffix, flags)
File "tempfile.py", line 238, in _mkstemp_inner
return (fd, _os.path.
File "posixpath.py", line 403, in abspath
path = join(os.getcwd(), path)
File "posixpath.py", line 65, in join
path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc in position 30:
ordinal not in range(128)
bzr 0.13.0 on python 2.4.4.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'commit']
** please send this report to <email address hidden>
-------
Happens on Debian (mostly etch):
-------
martin@shambala:~> dpkg -l | egrep "(bzr|python)" | cut -c1-70
ii bzr 0.13-0.1
ii bzr-svn 0.2-1
ii ipython 0.7.2-5
ii libboost-
ii python 2.4.4-2
ii python-apt 0.6.19
ii python-cairo 1.2.0-1
ii python-celementtree 1.0.5-8
ii python-central 0.5.12
ii python-crypto 2.0.1+dfsg1-1.2
ii python-dbus 0.71-3
ii python-elementtree 1.2.6-10
ii python-glade2 2.8.6-8
ii python-gmenu 2.16.1-2
ii python-gnome2 2.12.4-6
ii python-
ii python-
ii python-gtk2 2.8.6-8
ii python-imaging 1.1.5-11
ii python-imaging-tk 1.1.5-11
ii python-libxml2 2.6.27.dfsg-1
ii python-minimal 2.4.4-2
ii python-numeric 24.2-7
ii python-paramiko 1.5.2-0.1
ii python-pycurl 7.15.5-1
ii python-pygame 1.7.1release-4.1
ii python-pylibacl 0.2.1-3.1
ii python-pyorbit 2.0.1-5
ii python-pysqlite2 2.3.2-1
ii python-pyxattr 0.2.1-1.1
ii python-qt3 3.16-1.2
ii python-sip4 4.4.5-4
ii python-subversion 1.4.2dfsg1-2
ii python-support 0.5.6
ii python-tk 2.4.4-1
ii python-uno 2.0.4.dfsg.2-4
ii python-urwid 0.9.7.1-1
ii python-xml 0.8.4-6
ii python2.4 2.4.4-2
ii python2.4-minimal 2.4.4-2
-------
Also with bzr 0.14:
-------
bzr: ERROR: exceptions.
0xfc in position 30: ordinal not in range(128)
Traceback (most recent call last):
File "/usr/lib/
run_bzr_
return run_bzr(argv)
File "/usr/lib/
run_bzr
ret = run(*run_argv)
File "/usr/lib/
run_argv_aliases
return self.run(
File "/usr/lib/
in run
reporter=
File "/usr/lib/
in write_locked
return unbound(self, *args, **kwargs)
File "/usr/lib/
in commit
revprops=
File "/usr/lib/
commit
message = message_
File "/usr/lib/
in get_message
my_message = edit_commit_
File "/usr/lib/
edit_commit_message
tmp_fileno, msgfilename = tempfile.
dir=u'.')
File "tempfile.py", line 302, in mkstemp
return _mkstemp_inner(dir, prefix, suffix, flags)
File "tempfile.py", line 238, in _mkstemp_inner
return (fd, _os.path.
File "posixpath.py", line 403, in abspath
path = join(os.getcwd(), path)
File "posixpath.py", line 65, in join
path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc in position 30:
ordinal not in range(128)
bzr 0.14.0 on python 2.4.4.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'commit']
** please send this report to <email address hidden>
-------
With this repostory:
-------
martin@
Location:
branch root: file://
Format:
control: Meta directory format 1
working tree: Working tree format 3
branch: Branch format 5
repository: Knit repository format 1
In the working tree:
6 unchanged
1 modified
2 added
0 removed
0 renamed
5 unknown
0 ignored
1 versioned subdirectory
Branch history:
5 revisions
19 days old
first revision: Sun 2007-01-14 18:42:47 +0100
latest revision: Thu 2007-01-18 22:56:48 +0100
Revision store:
5 revisions
89 KiB
-------
And this locale setting:
-------
martin@shambala:~> locale
LANG=de_DE@euro
LC_CTYPE=
LC_NUMERIC=
LC_TIME=
LC_COLLATE=
LC_MONETARY=
LC_MESSAGES=
LC_PAPER=
LC_NAME=
LC_ADDRESS=
LC_TELEPHONE=
LC_MEASUREMENT=
LC_IDENTIFICATI
LC_ALL=
-------
All the files I want to update / add are same locale.
I have no time for further investigation right now or to write a bug
report... so this will have to do it for now.
I worked around the bug by issuing:
bzr mv Wünsche Wuensche
(i.e. removing the umlaut from the directory name)
Regards,
--
Martin 'Helios' Steigerwald - http://
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7
Related branches
Changed in bzr: | |
assignee: | nobody → bialix |
status: | Confirmed → In Progress |
Changed in bzr: | |
assignee: | bialix → nobody |
status: | In Progress → Confirmed |
Answer from John Arbash Meinel:
> Martin Steigerwald wrote: python2. 4/site- packages/ bzrlib/ msgeditor. py", line mkstemp( prefix= 'bzr_log. ', abspath( file))
> > Please also CC to my personal address as I am not subcribed to list.
> >
> >
> > Hello!
> >
> > Now that it happens again I do so as advised and send this error
> > message.
> >
> > It happens on commit after I changed a file and added some more.
>
> hmm...
>
> Well, as a workaround you can use 'bzr commit -m "message"' to avoid
> this bug, but certainly we need to fix this.
>
> > File "/usr/lib/
> > 98, in edit_commit_message
> > tmp_fileno, msgfilename = tempfile.
> > dir=u'.')
>
> ...
>
> v- It seems like os.path.abspath() is having a problem with getcwd()
> since it is thinking in terms of 8-bit string path, while we are
> thinking in terms of unicode path.
>
> > File "tempfile.py", line 238, in _mkstemp_inner
> > return (fd, _os.path.
> > File "posixpath.py", line 403, in abspath
> > path = join(os.getcwd(), path)
> > File "posixpath.py", line 65, in join
> > path += '/' + b
> > UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc in position
> > 30: ordinal not in range(128)
> >
> > All the files I want to update / add are same locale.
> >
> > I have no time for further investigation right now or to write a bug
> > report... so this will have to do it for now.
> >
> > I worked around the bug by issuing:
> >
> > bzr mv Wünsche Wuensche
> >
> > (i.e. removing the umlaut from the directory name)
> >
> > Regards,
>
> The other way of avoiding this bug is to cd to the root of your project
> and run commit from there, rather than running commit in a
> subdirectory.
>
> The specific bug is in python's 'tempfile.mkstemp' function. Which
> doesn't seem to handle non-ascii paths very well.
>
> I wonder what python is making of your locale, could you put the
> attached file into ~/.bazaar/plugins/
>
> And then run a bzr command ('bzr rocks' is fine)
> It should print out what encoding bzr thinks you are running in.
Hello John,
bzr seems to detect the right encoding:
martin@ shambala: Zeit/Bazaar- Tests/Bazaar> bzr rocks
bzr-svn is not up to date with installed bzr version 0.14.0.
There should be a newer version available, e.g. 0.14.
Bzr using encoding: 'ISO-8859-15'
it sure does!
> Otherwise, my suggested patch is the simple one, which may mean things msgeditor. py' mkstemp( prefix= 'bzr_log. ', mkstemp( prefix= 'bzr_log. ', tmp_fileno) getcwd( )
> don't work properly in certain paths on Windows
>
> === modified file 'bzrlib/
> --- bzrlib/msgeditor.py 2006-11-11 19:25:25 +0000
> +++ bzrlib/msgeditor.py 2007-02-07 16:53:59 +0000
> @@ -95,7 +95,7 @@
>
> msgfilename = None
> try:
> - tmp_fileno, msgfilename = tempfile.
> dir=u'.')
> + tmp_fileno, msgfilename = tempfile.
> dir='.')
> msgfile = os.close(
> if infotext is not None and infotext != "":
> hasinfo = True
>
> Or the attached one which is more involved, but cleans up a bunch of
> other stuff. The big difference is just that it uses:
> dir=osutils.
>
> Which returns the full unicode path to the current directory, which
> should just be a pass-through for os.abspath(), r...