Bug 826540 - [abrt] mercurial-2.2.1-1.fc17: util.py:1189:bytecount:NameError: global name 'units' is not defined
[abrt] mercurial-2.2.1-1.fc17: util.py:1189:bytecount:NameError: global name ...
Product: Fedora
Classification: Fedora
Component: mercurial (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Neal Becker
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-05-30 09:04 EDT by Sjoerd Mullender
Modified: 2013-08-01 01:37 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-08-01 01:36:56 EDT
Type: ---
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 Sjoerd Mullender 2012-05-30 09:04:26 EDT
libreport version: 2.0.10
abrt_version:   2.0.10
cmdline:        /usr/bin/python /usr/bin/hg relink
executable:     /usr/bin/hg
kernel:         3.3.7-1.fc17.x86_64
time:           2012-05-30T14:53:42 CEST
uid:            1000
username:       sjoerd

:util.py:1189:bytecount:NameError: global name 'units' is not defined
:Traceback (most recent call last):
:  File "/usr/bin/hg", line 38, in <module>
:    mercurial.dispatch.run()
:  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 27, in run
:    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
:  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 64, in dispatch
:    return _runcatch(req)
:  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 87, in _runcatch
:    return _dispatch(req)
:  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 685, in _dispatch
:    cmdpats, cmdoptions)
:  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 467, in runcommand
:    ret = _runcommand(ui, options, cmd, d)
:  File "/usr/lib64/python2.7/site-packages/mercurial/extensions.py", line 184, in wrap
:    return wrapper(origfn, *args, **kwargs)
:  File "/usr/lib64/python2.7/site-packages/hgext/pager.py", line 107, in pagecmd
:    return orig(ui, options, cmd, cmdfunc)
:  File "/usr/lib64/python2.7/site-packages/mercurial/extensions.py", line 184, in wrap
:    return wrapper(origfn, *args, **kwargs)
:  File "/usr/lib64/python2.7/site-packages/hgext/color.py", line 362, in colorcmd
:    return orig(ui_, opts, cmd, cmdfunc)
:  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 775, in _runcommand
:    return checkargs()
:  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 746, in checkargs
:    return cmdfunc()
:  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 682, in <lambda>
:    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
:  File "/usr/lib64/python2.7/site-packages/mercurial/util.py", line 463, in check
:    return func(*args, **kwargs)
:  File "/usr/lib64/python2.7/site-packages/mercurial/extensions.py", line 139, in wrap
:    util.checksignature(origfn), *args, **kwargs)
:  File "/usr/lib64/python2.7/site-packages/mercurial/util.py", line 463, in check
:    return func(*args, **kwargs)
:  File "/usr/lib64/python2.7/site-packages/hgext/mq.py", line 3350, in mqcommand
:    return orig(ui, repo, *args, **kwargs)
:  File "/usr/lib64/python2.7/site-packages/mercurial/util.py", line 463, in check
:    return func(*args, **kwargs)
:  File "/usr/lib64/python2.7/site-packages/hgext/relink.py", line 57, in relink
:    do_relink(src.store.path, repo.store.path, targets, ui)
:  File "/usr/lib64/python2.7/site-packages/hgext/relink.py", line 176, in do_relink
:    (relinked, util.bytecount(savedbytes)))
:  File "/usr/lib64/python2.7/site-packages/mercurial/util.py", line 1189, in bytecount
:    return units[-1][2] % nbytes
:NameError: global name 'units' is not defined
:Local variables in innermost frame:
:nbytes: 0
:multiplier: 1
:divisor: 1
:format: '%.0f bytes'

:With the relink extension enabled and a relink path specified in the hgrc file, the command `hg relink' crashes.
:The crash is the result of an incomplete conversion of the code in mercurial/util.py when the "units" dictionary was moved outside the function bytecount.  The fix is to change "units" into "_byteunits".
Comment 1 Mads Kiilerich 2012-06-04 19:10:19 EDT
Fixed in 2.2.2.
Comment 2 Fedora End Of Life 2013-07-03 21:18:08 EDT
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. 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 WONTFIX if it remains open with a Fedora 
'version' of '17'.

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 prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 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 to Fedora 17's end of life.

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 3 Fedora End Of Life 2013-08-01 01:37:00 EDT
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 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.

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.