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

Serialization via puz produces invalid file #3

Open
rcoh opened this issue Feb 26, 2019 · 2 comments
Open

Serialization via puz produces invalid file #3

rcoh opened this issue Feb 26, 2019 · 2 comments
Assignees
Labels

Comments

@rcoh
Copy link

rcoh commented Feb 26, 2019

The puzpy module relies on .fill being set to a string the same length as solution (width*height). This library doesn't set it which leads to corrupted files. Workaround:

puz = crossword.to_puz(crossword_obj)
puz.fill = ' ' * (crossword_obj.height * crossword_obj.width)
# workaround for a separate Python 3+ compatibility issue in puzpy
puz.preamble = b''
return puz.tobytes()
@svisser svisser self-assigned this Feb 28, 2019
@svisser svisser added the bug label Feb 28, 2019
@svisser
Copy link
Owner

svisser commented Feb 28, 2019

Thanks for reporting this, it's indeed possible (likely) that this was missed when implementing this library. I'd have to look into it and create a fix for it.

Pull requests are welcome as well!

@rcoh
Copy link
Author

rcoh commented Mar 5, 2019

In the same vein, clues can't be '' or Acrosslite will hard-crash. (many other readers are fine with it though)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants