Skip to content

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

Closed
jeevanullas opened this Issue Mar 27, 2014 · 14 comments
@jeevanullas

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

ea5451d

% 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:
https://github.com/s3tools/s3cmd
If the error persists, please report the
following lines (removing any private
info as necessary) to:
s3tools-bugs@lists.sourceforge.net

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Traceback (most recent call last):
File "/usr/bin/s3cmd", line 2426, in
report_exception(e)
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.

Cheers!
Deependra

@mdomsch
s3tools member
@alertedsnake

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
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 ?
report_exception(e)
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?

@mdomsch
s3tools member
@topwebs
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.

@jeremywadsack

I have the same problem with 1.5.0-rc1 on Amzn Linux 2.6.34.7-56.40. 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?

@kmcnellis

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)

@mdomsch
s3tools member
@mwae
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 setup.py 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.

@jeremywadsack

@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 setup.py 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
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 http://kojipkgs.fedoraproject.org//packages/s3cmd/1.5.0/0.7.rc1.el6/noarch/s3cmd-1.5.0-0.7.rc1.el6.noarch.rpm
@adamant-az

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

@bdennett
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.

@cwthorpe

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.