Skip to content

NameError: global name 'unicodise' is not defined #306

jeevanullas opened this Issue Mar 27, 2014 · 14 comments

Getting following error while using the latest code in github against Eucalyptus 4.0.0 , looks like this commit breaks the functionality?


% s3cmd -c s3cfg ls

An unexpected error has occurred.
Please try reproducing the error using
the latest s3cmd code from the git master
branch found at:
If the error persists, please report the
following lines (removing any private
info as necessary) to:


Traceback (most recent call last):
File "/usr/bin/s3cmd", line 2426, in
File "/usr/bin/s3cmd", line 2365, in report_exception
s = u' '.join([unicodise(a) for a in sys.argv])
NameError: global name 'unicodise' is not defined

Please let me know if you have any questions.


s3tools member

I've just had the same issue, it looks like there's some case where S3.Utils.unicodise is not being imported - in my case it was because I didn't have python-dateutil installed. Also my fault, I packaged up the latest version into a .deb and didn't properly handle the dependency.

topwebs commented Jul 1, 2014

I have the same error when installing latest version on Centos 5 and then trying to run s3cmd as follows:

Traceback (most recent call last):
File "/usr/bin/s3cmd", line 2527, in ?
File "/usr/bin/s3cmd", line 2465, in report_exception
s = u' '.join([unicodise(a) for a in sys.argv])
NameError: global name 'unicodise' is not defined

Any ideas how to fix?

s3tools member
topwebs commented Jul 2, 2014

Yes, python-dateutil is installed. I installed your rpm but got the same error. The version of Python in Centos 5.10 is 2.4.3.


I have the same problem with 1.5.0-rc1 on Amzn Linux I have python-dateutil installed and even upgraded to the latest version.

Any other ideas how to resolve this? Can we re-open this issue?


I had the same issue, it seemed to be happening when the S3 lib was not imported, therefore in the error catching code unicodise (imported from S3.utils) had never been defined. I was able to make the error more descriptive and accurate by removing the call to unicodise and EX_GENERAL (fixed in #355)

s3tools member
mwae commented Aug 15, 2014

I had a working copy of the latest 1.5rc s3cmd but I kept getting a python-magic warning so
I just installed python-magic and I get the same error as everyone above.

Nevermind, for some reason the version in the download works. (so not the python install version) but the version that comes in the top level directory after you unzip. So I've just copied that to my binary directory and it works fine.


@mdomsch I have this error on a system that had 1.0.1 installed. When I run the install script it for 1.5.0-rc1 I get the error. This occurs even with --version or --help options.

Here are details:

s3cmd-1.5.0-rc1 installed from sourceforge download with sudo python install

python 2.6.6 (Amazon does not yet support 2.7 on EC2)

$ yum info python
Installed Packages
Name       : python
Arch       : noarch
Version    : 2.6
Release    : 1.19.amzn1

$ yum info pythoh-dateutil
Available Packages
Name       : python-dateutil
Arch       : noarch
Version    : 1.4.1
Release    : 4.1.5.amzn1

$ yum info python-libs
Loaded plugins: fastestmirror, security
Error: No matching Packages to list

$ yum info expat
Loaded plugins: fastestmirror, security
Installed Packages
Name       : expat
Arch       : x86_64
Version    : 1.95.8
Release    : 8.3.8.amzn1

Also, installing python-dateutil didn't change this error.

kassner commented Sep 22, 2014

In Amazon Linux AMI 2014.03, using the RPM that @mdomsch pointed out (but for EL6), I could manage it to work by removing the 1.0.0 version from yum before installing that one.

yum remove s3cmd
yum localinstall

works when running with python2.6 as: python2.6 /usr/local/bin/s3cmd -h

bdennett commented Oct 1, 2014

After getting a similar error on SmartOS (Joyent) with Python 2.7, I uninstalled v1.5.0-rc1 and tried v1.5.0-beta1. With v1.5.0-beta1, I ended up getting a message similar to the following (after the traceback):

ImportError: No module named pyexpat

Once I installed the Python expat package (in my case py27-expat-2.7.6; sudo pkgin in py27-expat-2.7.6), v1.5.0-beta1 worked as expected. I was then able to uninstall v1.5.0-beta1 and re-install v1.5.0-rc1, which is now working properly.


Just a further comment here. I got this error when I upgraded Ubuntu server from 10.04 to 12.04 (yes, perhaps a bit late).

apt-get upgrade didn't help even with s3cmd repositories. Eventually fixed it by downloading the 1.6.1 version (from SourceForge) and reinstalling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.