Skip to content

Missing type error for Python 3? #24

@danragnar

Description

@danragnar

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions