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

Missing type error for Python 3? #24

Open
danragnar opened this issue Oct 5, 2018 · 0 comments
Open

Missing type error for Python 3? #24

danragnar opened this issue Oct 5, 2018 · 0 comments

Comments

@danragnar
Copy link

In python 3.6.2 when writing a string to a file directly like this:
volume = gfapi.Volume('server', 'volume') volume.mount() with volume.fopen('testfile', 'w') as f: f.write("test write")

The resulting file gets weirdly cut like this:
xxd testfile 00000000: 7400 0000 6500 0000 7300 00 t...e...s..

This works:
with volume.fopen('testfile', 'w') as f: f.write(b'test write') xxd testfile 00000000: 7465 7374 2077 7269 7465 test write

Maybe the write function should throw a type error in Python 3 if the object is not a bytearray/byte?

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

No branches or pull requests

1 participant