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

Attribute Error #45

Open
chuchaki opened this issue Sep 10, 2021 · 0 comments
Open

Attribute Error #45

chuchaki opened this issue Sep 10, 2021 · 0 comments

Comments

@chuchaki
Copy link

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

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