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

checkscript() wrongly encodes non-ascii text #89

Open
e1fueg0 opened this issue Nov 9, 2019 · 4 comments
Open

checkscript() wrongly encodes non-ascii text #89

e1fueg0 opened this issue Nov 9, 2019 · 4 comments
Labels

Comments

@e1fueg0
Copy link

e1fueg0 commented Nov 9, 2019

When content takes more bytes than chars, the following command wrongly encodes text:

        content = tools.to_bytes(
            u"{%d+}%s%s" % (len(content), str(CRLF), content))

This code works correctly:

        content = tools.to_bytes(content)
        len1 = tools.to_bytes(u"{%d+}" % len(content))
        content = len1 + CRLF + content
@e1fueg0
Copy link
Author

e1fueg0 commented Nov 9, 2019

And also pls propagate out server message in case of error.

@e1fueg0
Copy link
Author

e1fueg0 commented Nov 10, 2019

Also pls expose the data from putscript().
And the code can be taken from putscript() to fix checkscript().

        content = tools.to_bytes(content)
        content = tools.to_bytes("{%d+}" % len(content)) + CRLF + content

@tonioo
Copy link
Owner

tonioo commented Jun 9, 2020

@e1fueg0 Sorry to react so lately but could you please make a PR with your modifications?

@tonioo tonioo added the bug label Jun 9, 2020
@sambrightman
Copy link

Fixed by #99? (although perhaps __prepare_content should have stayed in tools.py or be a @staticmethod.

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

3 participants