eagleflo / mpyq

Python library for reading MPQ archives.
BSD 2-Clause "Simplified" License
99 stars 23 forks source link

Test for an archive with empty files #30

Open eagleflo opened 10 years ago

eagleflo commented 10 years ago

This was broken under Python 3 for a long time.

GraylinKim commented 10 years ago

Do you need me to provide one of these? The archives I originally found the issue with are private but I can dig around and find one for this.

eagleflo commented 10 years ago

Sure, I'd appreciate if you could find a reasonably small archive with at least one empty file.

For legal reasons it has to be user-generated, though, and preferably with official tools such as game clients or map editors.

eagleflo commented 10 years ago

We could of course also create an artificial test-case archive if we can be sure that it matches what is found in the wild.

MGatner commented 6 years ago

Wow this has been open a long time. I ran into this issue try to extract_to_disk (from CLI, -x) from a Heroes or the Storm .StormReplay file. Actually all of these archives I've tested so far have a zero-byte file in them; I am glad to provide one or many as examples. My fix has been to add a test for empty data before calling fwrite; I'll see if I can implement an example in this repo. I'm not sure where else the empty file(s) are an issue though.

MGatner commented 6 years ago

Ah actually it looks like this is fixed in the current version here! https://github.com/Blizzard/heroprotocol appears to have an old version of mpyq included which is causing the issue. @eagleflo were there other issues with empty files other than writing to disk? I haven't run into them so far...

eagleflo commented 6 years ago

No, I think #28 fixed that.

MGatner commented 6 years ago

Awesome. I’m pulling in your latest and dropping the one heroprotocol has included. Probably safe to close #30 if that’s the case.

Matt Gatner mgatner@icloud.com

On Apr 28, 2018, at 4:18 PM, Aku Kotkavuo notifications@github.com wrote:

No, I think #28 https://github.com/eagleflo/mpyq/pull/28 fixed that.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/eagleflo/mpyq/issues/30#issuecomment-385202823, or mute the thread https://github.com/notifications/unsubscribe-auth/AQwj7zwznx4hABd3KaiXBShxtbEkJgFqks5ttM6JgaJpZM4BqG15.