UnicodeDecodeError: 'ascii' while upgrading #36

Closed
burp opened this Issue Jan 21, 2012 · 6 comments

2 participants

@burp

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
Owner

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

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
Owner
@tvo
Owner

Asking bitarray developer: ilanschnell/bitarray#1

@tvo
Owner

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 tvo added a commit that closed this issue Jan 25, 2012
@tvo bitarray >= 0.4.0 compatibility
closes #36
276980a
@tvo tvo closed this in 276980a Jan 25, 2012
@tvo
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment