AttributeError: 'module' object has no attribute 'normalize_encoding'

Bug #126615 reported by Florent
8
Affects Status Importance Assigned to Milestone
commit-tool (Ubuntu)
Fix Released
Medium
Luca Falavigna
Feisty
Fix Released
Medium
Luca Falavigna
Gutsy
Fix Released
Medium
Luca Falavigna

Bug Description

Binary package hint: commit-tool

on Feisty.
commit-tool v 0.4-3build1
with python 2.5.1

the command
command:
$ /usr/bin/hgct
Traceback (most recent call last):
  File "/usr/bin/hgct", line 43, in <module>
    import main
  File "/usr/bin/hgct", line 27, in MyImport
    ret = imp.load_module(name, f, '', modules[name].descr)
  File "main.py", line 21, in <module>
  File "/usr/bin/hgct", line 31, in MyImport
    return origImport(name, globals, locals, fromlist)
  File "/usr/lib/python2.5/optparse.py", line 412, in <module>
    _builtin_cvt = { "int" : (_parse_int, _("integer")),
  File "/usr/lib/python2.5/gettext.py", line 581, in gettext
    return dgettext(_current_domain, message)
  File "/usr/lib/python2.5/gettext.py", line 545, in dgettext
    codeset=_localecodesets.get(domain))
  File "/usr/lib/python2.5/gettext.py", line 480, in translation
    mofiles = find(domain, localedir, languages, all=1)
  File "/usr/lib/python2.5/gettext.py", line 437, in find
    for nelang in _expand_lang(lang):
  File "/usr/lib/python2.5/gettext.py", line 132, in _expand_lang
    locale = normalize(locale)
  File "/usr/lib/python2.5/locale.py", line 327, in normalize
    norm_encoding = encodings.normalize_encoding(encoding)
AttributeError: 'module' object has no attribute 'normalize_encoding'

The solution is simple. See the diff below:

--- /usr/bin/gct 2007-01-15 23:23:04.000000000 +0100
+++ /usr/bin/gct 2007-07-17 00:10:48.000000000 +0200
@@ -1,3 +1,4 @@
 #!/usr/bin/env python2.5

 import tempfile, sys, imp, __builtin__
+from gettext import gettext

Please merge the fix in the package for feisty and next releases.

Revision history for this message
Florent (florent.x) wrote :
Revision history for this message
Luca Falavigna (dktrkranz) wrote :

Thank you for your bug report and for your patch

Changed in commit-tool:
status: New → Confirmed
Changed in commit-tool:
assignee: nobody → kitterman
importance: Undecided → Medium
status: Confirmed → In Progress
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Scott Kitterman (kitterman) wrote :

Uploaded. Thank you for your contribution. Once it's built and in Gutsy, then you can start on the Feisty SRU.

Changed in commit-tool:
assignee: kitterman → dktrkranz
status: In Progress → Fix Committed
Revision history for this message
Luca Falavigna (dktrkranz) wrote :

commit-tool (0.4-3ubuntu1) gutsy; urgency=low

  * Import gettext to prevent AttributeError exception (LP: #126615)
  * Update Maintainer field in debian/control

 -- Luca Falavigna <email address hidden> Fri, 20 Jul 2007 21:41:18 +0200

Changed in commit-tool:
status: Fix Committed → Fix Released
Revision history for this message
Luca Falavigna (dktrkranz) wrote :

Debdiff for feisty-proposed.

Revision history for this message
Scott Kitterman (kitterman) wrote :

A few comments for you....

Version 0.4-3ubuntu0.1 for version (it's not a rebuild and the 0 to keep it below the Gutsy version number) would be better (not an essential change, but since you're going to be updating it anyway).

For an SRU, it's important to keep the change as small and simple as possible. Rather than add a patch, in this case, it would be better to modify the upstream source directly.

Those are my suggestions. Someone else may feel differently.

Revision history for this message
Luca Falavigna (dktrkranz) wrote :

Thank you for your suggestions.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Debdiff looks good. If it builds, I'll upload it.

Changed in commit-tool:
assignee: nobody → kitterman
status: Triaged → In Progress
Revision history for this message
Scott Kitterman (kitterman) wrote :

Waiting for approval::
 OK: commit-tool_0.4.orig.tar.gz
 OK: commit-tool_0.4-3ubuntu0.1.diff.gz
 OK: commit-tool_0.4-3ubuntu0.1.dsc
     -> Component: universe Section: devel
This upload awaits approval by a distro manager

Message was signed by Donald Scott Kitterman <email address hidden> (Key ID: 0xDDCD686A).
The signature is valid and the key is ultimately trusted.
  Format: 1.7
Date: Wed, 25 Jul 2007 13:32:26 +0200
Source: commit-tool
Binary: commit-tool
Architecture: source
Version: 0.4-3ubuntu0.1
Distribution: feisty-proposed
Urgency: low
Maintainer: Ubuntu MOTU Developers <email address hidden>
Changed-By: Luca Falavigna <email address hidden>
Description:
 commit-tool - GUI commit tool for various Source Control Management systems
Launchpad-Bugs-Fixed: 126615
Changes:
 commit-tool (0.4-3ubuntu0.1) feisty-proposed; urgency=low
 .
   * SRU for (LP: #126615), list of fixes:
     - Import gettext to prevent AttributeError exception
   * Update Maintainer field in debian/control
Files:
 6f8e3ce4415e0514f6e9a16168f88f40 747 devel optional commit-tool_0.4-3ubuntu0.1.dsc
 a3542fddf5f4ffb1d7b37439c88c815f 31271 devel optional commit-tool_0.4.orig.tar.gz
 ae3c8a49d255b4b95baa33dc1050a721 4279 devel optional commit-tool_0.4-3ubuntu0.1.diff.gz
Original-Maintainer: Vincent Danjean <email address hidden>

Revision history for this message
Martin Pitt (pitti) wrote :

I disagree with Scott here. Patches which already have a patch system *should* use patches for *all* modifications to the upstream source. Otherwise this leads to confusion very easily. Usually, a maintainer looks at the packaging, sees debian/patches/, and handles patches there. Updating to a new upstream version is then usually handled by copying over the debian/ directory only, which would drop the inline patch.

Luca, can you please reupload with the correct version number (0.4-3ubuntu0.1 is good), but with your original patch? Thank you!

Revision history for this message
Luca Falavigna (dktrkranz) wrote :

New debdiff following Martin' suggestions.

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 126615] Re: AttributeError: 'module' object has no attribute 'normalize_encoding'

Thanks. Lesson learned here. I'll go with that in the future.

Revision history for this message
Luca Falavigna (dktrkranz) wrote :

Any news on this?

Revision history for this message
Scott Kitterman (kitterman) wrote :

Revised version uploaded to feisty-proposed. Now it waits for archive admin attention to publish it.

Revision history for this message
Sebastien Bacher (seb128) wrote :

uploaded accepted to feisty-proposed now

Changed in commit-tool:
assignee: kitterman → dktrkranz
Revision history for this message
Fede (fedefede0101) wrote :

fixed by feisty-proposed package!!

~$ hgct
hg status: abort: There is no Mercurial repository here (.hg not found)!
Make sure that the current working directory contains a '.hg' directory.

bye...

Revision history for this message
Gianvito Cavasoli (janvitus) wrote :

Work also for me.

Revision history for this message
Luca Falavigna (dktrkranz) wrote :

Seven days testing period elapsed and two persons confirmed the fix is good.
Tagging with verification-motu-done as per https://wiki.ubuntu.com/MOTU/SRU.

Changed in commit-tool:
status: In Progress → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

Copied to feisty-updates.

Changed in commit-tool:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.