tvo / rapid

Commandline client for Spring rapid downloading system
Other
7 stars 6 forks source link

UnicodeDecodeError: 'ascii' while upgrading #36

Closed burp closed 12 years ago

burp commented 12 years ago

Hi,

I get the following traceback when trying to upgrade (since I wanted to upgrade to zk 0.9.9 today). I'm not sure if it's a bitarray or rapid problem:

% rapid upgrade Using data directory: /home/paladin/.spring Installing: Zero-K v0.9.9 Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/cx_Freeze/initscripts/Console.py", line 27, in exec code in m.dict File "bin/rapid", line 7, in @ File "/home/paladin/aur/rapid-spring-git/src/rapid-build/rapid/ui/text/main.py", line 159, in main upgrade() File "/home/paladin/aur/rapid-spring-git/src/rapid-build/rapid/main.py", line 144, in upgrade install_single(rapid.packages[tag]) File "/home/paladin/aur/rapid-spring-git/src/rapid-build/rapid/main.py", line 68, in install_single p.install(ProgressBar()) File "/home/paladin/aur/rapid-spring-git/src/rapid-build/rapid/rapid.py", line 539, in install self.download_files(self.missing_files, progress) File "/home/paladin/aur/rapid-spring-git/src/rapid-build/rapid/rapid.py", line 489, in download_files postdata = gzip_string(bits.tostring()) File "/usr/lib/python2.7/site-packages/bitarray/init.py", line 91, in tostring return self.tobytes().decode() UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128)

tvo commented 12 years ago

Hi burp,

Thanks for reporting your issue.

Is this issue reproducable, or did it happen only once?

I ask, because I just installed zk 0.9.9 myself through rapid, and it worked fine. I tested this on Linux though, so it could be a Windows-specific problem in rapid and/or bitarray.

-Tobi

burp commented 12 years ago

Hi,

the issue is reproducible, and I'm on linux myself. I wanted to update to zk 0.9.9 too. I did not update rapid, so I guess this error has occured because of some remote file change. I wonder how my environment is different from yours, as just I seem to have this error. The python version is 2.7.2 and bitarray 0.4.0.

tvo commented 12 years ago

The python version is 2.7.2 and bitarray 0.4.0.

Here I have python 2.7.2 and bitarray 0.3.5. The different bitarray version appears to be key, as I just reproduced the issue in an isolated environment (virtualenv) using bitarray 0.4.0.

I'll investigate later..

Tobi

tvo commented 12 years ago

Asking bitarray developer: https://github.com/ilanschnell/bitarray/issues/1

tvo commented 12 years ago

It is an intended change in bitarray.

Note to self: I need to use .tobytes() for bitarray >= 0.4.0 and .tostring() for bitarray < 0.4.0. (Or just use .tobytes() if it exists, and .tostring() otherwise)

tvo commented 12 years ago

Released v0.6.0 that includes a fix for this issue.