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
Enhance add_file_from_memory #85
Enhance add_file_from_memory #85
Conversation
bb84377
to
e168a39
Compare
Those issues are both a failure of information and example. As the only examples provided are in the form of tests and the minimalist docstrings, I enhanced both to better specify exactly what the parameters must be in order for the process to succeed. The test, in particular, was designed to show the best practice for various inputs is to encode them as binary if they aren't already. I originally had a test that included a non-binary string, thus the "unnecessary code" you removed. In fact, that was to be yet another example of how to correctly handle non-binary string inputs, but it seems better served by the commentary within the test stating that non-binary inputs will cause unwelcome results. Correct documentation would have prevented both issues, so yes, this fixes that gap. The only thing that would work better is explicitly disallowing any non-binary input, but that might break some applications of it (applications that would break the moment they use Python 3 and default unicode strings - that's how I first learned that, other than unaddressed bug reports, this was undocumented). |
It's not just a documentation issue. We can make the I don't want to close #69 until I see a non-failing test proving that NUL characters are in fact handled correctly. |
735d2b3
to
d552f8a
Compare
e3fbb23
to
e9324f5
Compare
Closes #68, #69