Skip to content

Attribute Error #45

@chuchaki

Description

@chuchaki

Hello,
im trying to achieve a rather simple procedure, where I copy a local image onto a nfs server.
The server can be reached and I can create and modify files on it just as the readme indicates. However I'm not able to transfer a local file to the server using this library.

Target concept:
targetFile = nfsHandle.open(path+"/"+filename, 'w')
sourcefile = open(filename.jpg, 'r')
shutil.copyfileobj( photo , targetFile )

If I use the approach above, I get an error message complaining: "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte". If I use 'wb' and 'rb'. it complains that 'byte' does not have the method 'encode'.
I've tried to convert the image file handler into a bytearray, but it keeps getting back to the utf-8 message.

Either there is a bug, where the codec=none is always overwritten with utf-8, images are not supported (encoding/decoding an image with utf-8 seems kind of ... , or I have a deep misunderstanding of this issue.

Can someone have a look at this ?

Thanks & with best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions