Bug 1295687 - hg push crashes with hg-git extensions if repository folder name contains non ASCII characters
hg push crashes with hg-git extensions if repository folder name contains non...
Product: Fedora
Classification: Fedora
Component: hg-git (Show other bugs)
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: pstodulk
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2016-01-05 04:08 EST by Damien Gombault
Modified: 2016-12-20 12:37 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-12-20 12:37:16 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Damien Gombault 2016-01-05 04:08:22 EST
Description of problem:

I tried to push from a mercurial repository to a git repository with the hg-git extension.
I enabled the hg-git extension then run hg push in my repository.

hg crashed with the backtrace :

pushing to git+ssh://git/~/shared/exports-ypareo.git
** Unknown exception encountered with possibly-broken third-party extension hggit
** which supports versions 3.4 of Mercurial.
** Please disable hggit and try your action again.
** If that fixes the bug please report it to https://bitbucket.org/durin42/hg-git/issues
** Python 2.7.10 (default, Sep  8 2015, 17:20:17) [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)]
** Mercurial Distributed SCM (version 3.5.1)
** Extensions loaded: hggit
Traceback (most recent call last):
  File "/usr/bin/hg", line 43, in <module>
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 30, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 92, in dispatch
    ret = _runcatch(req)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 163, in _runcatch
    return _dispatch(req)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 895, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 656, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 1013, in _runcommand
    return checkargs()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 982, in checkargs
    return cmdfunc()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 892, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib64/python2.7/site-packages/mercurial/util.py", line 792, in check
    return func(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/mercurial/commands.py", line 5286, in push
    bookmarks=opts.get('bookmark', ()))
  File "/usr/lib64/python2.7/site-packages/mercurial/extensions.py", line 171, in closure
    return func(*(args + a), **kw)
  File "/usr/lib/python2.7/site-packages/hggit/util.py", line 48, in inner
    return f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/hggit/__init__.py", line 308, in exchangepush
    pushop.cgresult = repo.githandler.push(remote.path, revs, force)
  File "/usr/lib/python2.7/site-packages/hggit/git_handler.py", line 327, in push
  File "/usr/lib/python2.7/site-packages/hggit/git_handler.py", line 294, in export_commits
  File "/usr/lib/python2.7/site-packages/hggit/git_handler.py", line 1187, in update_references
    self.git.refs[git_ref] = git_sha
  File "/usr/lib64/python2.7/site-packages/dulwich/refs.py", line 261, in __setitem__
    self.set_if_equals(name, None, ref)
  File "/usr/lib64/python2.7/site-packages/dulwich/refs.py", line 568, in set_if_equals
    realname, _ = self._follow(name)
  File "/usr/lib64/python2.7/site-packages/dulwich/refs.py", line 207, in _follow
    contents = self.read_ref(refname)
  File "/usr/lib64/python2.7/site-packages/dulwich/refs.py", line 183, in read_ref
    contents = self.read_loose_ref(refname)
  File "/usr/lib64/python2.7/site-packages/dulwich/refs.py", line 499, in read_loose_ref
    filename = self.refpath(name)
  File "/usr/lib64/python2.7/site-packages/dulwich/refs.py", line 433, in refpath
    return os.path.join(self.path, name)
  File "/usr/lib64/python2.7/posixpath.py", line 73, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 23: ordinal not in range(128)

My mercurial repository directory name is : /home/damien/ownCloud/Développement/Exports YPareo (contains an accent e : é)
If I remove the accented character, hg push command works correctly.

Version-Release number of selected component (if applicable):

I use hg-git-0.8.2-1.fc23.noarch on Fedora 23.

A similar bug was reported upstream (for Windows) : https://bitbucket.org/durin42/hg-git/issues/172/unicodeencodeerror-with-multibyte-folder
A patch was mailed : https://groups.google.com/forum/#!topic/hg-git/ivIu1QIfA2Y
This patch has been commited for version 0.8.4 https://bitbucket.org/durin42/hg-git/commits/afea0e32db20aae5de5bc5b9fce94fb0c7824889?at=0.8.4

An upgrade to version 0.8.4 should fix this bug.

Thank you.
Comment 1 Fedora Admin XMLRPC Client 2016-02-26 12:33:38 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 2 Fedora Admin XMLRPC Client 2016-03-26 11:26:08 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 3 Fedora End Of Life 2016-11-24 09:42:50 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 4 Fedora End Of Life 2016-12-20 12:37:16 EST
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.