-
Notifications
You must be signed in to change notification settings - Fork 10
Uploading files could raise an error #193
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
Comments
are you sure that this code should work? try replacing with open(seven_z_upload_file, 'rb') as f:
file_path = file_path_in_str
nextcloud_file_object = nc.files.upload_stream(file_path, f) |
or it is again an url encoding problem, and I will fix it tomorrow... |
I rechecked it.
|
I finished fixing bugs with url encodings, please test the last dev version from repo.
If all is ok, new release will be published in 18 hours. |
I tested this code, working as expected: I'd like to understand also if my code is ok :)
|
The code looks good, but looking at the code brought up two questions.
Like:
P.S: "if res.status_code == 401:" -> 401 is Status Unauthorized |
P.S, I know :) |
Adding extra fields to class |
Describe the bug
I'm trying to upload files using the with open method and upload_stream.
When I'm using filepath as str, everything is working as expected, and the file is uploaded.
When using the "with open" as per the docs, I'm getting encoding errors.
ERROR - 'charmap' codec can't decode byte 0x9d in position 30: character maps to
file_path I used:
"C:\nextconnect\00592295\parsed\12_26_2023_12_06PM_Logs (2)_parsed.7z"
Steps/Code to Reproduce
Not working: (both 'rb' and w/o 'rb', plus, I also tried using encoding='utf-8')
Working:
Expected Results
Upload files when using the with open, as well as w/o it.
@bigcat88 , as per your example in https://stackoverflow.com/a/77242950/6575170 , it is possible.
Actual Results
Getting error codes like 'charmap' codec can't decode byte 0x9d
Setup configuration
nc_py = 0.71
The text was updated successfully, but these errors were encountered: