Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"TypeError: ord() expected a character, but string of length 0 found" in decoders.py v0.6.5 #184

Open
AldoErco opened this issue Mar 14, 2015 · 3 comments

Comments

@AldoErco
Copy link

Hi.
I am trying to decode s2gs files on Mac using sc2printer builtin script and get this error:
"AttributeError: 'ByteDecoder' object has no attribute 'read_unit64'"
It's related to line 371 of decoders.py where I can see:
"data = self._buffer.read_unit64()"
Reading the docs ("https://media.readthedocs.org/pdf/sc2reader/latest/sc2reader.pdf") on page 19 claims ByteDecoder is expected to have a read_uint64() and not a read_unit64() member.
Ok so I unpack the .egg file, change that line and repack it.
This is just a hint to you to fix it on your currently (0.6.5) published files.
But now to the error I can't fix myself.
This time I try to open a replay and get:
"File "/Library/Python/2.7/site-packages/sc2reader-0.6.5-py2.7.egg/sc2reader/decoders.py", line 339, in read_struct
TypeError: ord() expected a character, but string of length 0 found"
The code line is:
"datatype = ord(self._buffer.read(1)) if datatype is None else datatype"
This time I don't know what to do.

Please help.

@AldoErco
Copy link
Author

I follow up as requested by Graylin here (https://groups.google.com/forum/#!topic/sc2reader/FWzsVh5wQZ4)

It's not an occasional error, I am getting this on 45 files on a total of 117.
I can provide them all if you need.
Can I attach files here, or images only?

@GraylinKim
Copy link
Owner

If you rename to an image you can technically attach anything. Post a zip of the affected files somewhere and I'll take a look this week.

@AldoErco
Copy link
Author

Ok the files are here:
https://drive.google.com/open?id=0B-U0UqFTg0LET2dWWFh3REpqN1U&authuser=0

or here:
https://www.dropbox.com/s/f9zu7f4ylnhf6wu/s2gs_files.zip?dl=0

The zipfile contains two self-explanatory directories "Error" and "Success".

Thanks a lot.

Repository owner deleted a comment Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants