Lattyware / unrpa

A program to extract files from the RPA archive format.
http://www.lattyware.co.uk/projects/unrpa/
GNU General Public License v3.0
590 stars 74 forks source link

Got "'str' object has no attribute 'decode'" error #7

Closed hit1205 closed 6 years ago

hit1205 commented 6 years ago

unrpa 1.5 (latest release) Python 3.6.3 (latest release)

I always got this error when I run the command:

AttributeError: 'str' object has no attribute 'decode'

So I think it may caused by this line:

item_path = item.decode("utf-8")

I'm unfamiliar with Python so I do a search and found that there's no need to decode str object in Python 3 and it's already unicode object.

After I change this line:

item_path = item.decode("utf-8")

To this:

item_path = item

It worked without error messages anymore.

Lattyware commented 6 years ago

This didn't show up with my test archives - in fact, assuming it is a string as you do here breaks my manual tests, I'm assuming that this is a difference between archives where some pickled dictionaries use strings for the paths. As such I've added in a single point at which we ensure we have a string. This should mean it works in both cases.

Please let me know if this doesn't work for you - ideally if you could give me a test archive that fails to work so I can see what is going wrong.

hit1205 commented 6 years ago

It works after the update, thanks =D