N4S4 / synology-api

A Python wrapper around Synology API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BUG report: upload larg file >4G . error:OverflowError: string longer than 2147483647 bytes

tonny2003-wang opened this issue · comments

BUG Report:

upload file
fl = filestation.FileStation(.................
fl.upload_file('/file/dest','c:\temp\abc.zip')

if abc.zip large than 4G

Traceback (most recent call last):
File "main.py", line 43, in
File "synology_api\filestation.py", line 500, in upload_file
File "requests\sessions.py", line 590, in post
File "requests\sessions.py", line 542, in request
File "requests\sessions.py", line 655, in send
File "requests\adapters.py", line 449, in send
File "urllib3\connectionpool.py", line 706, in urlopen
File "urllib3\connectionpool.py", line 394, in _make_request
File "urllib3\connection.py", line 234, in request
File "http\client.py", line 1239, in request
File "http\client.py", line 1285, in _send_request
File "http\client.py", line 1234, in endheaders
File "http\client.py", line 1065, in _send_output
File "http\client.py", line 986, in send
File "ssl.py", line 975, in sendall
File "ssl.py", line 944, in send
File "ssl.py", line 642, in write
OverflowError: string longer than 2147483647 bytes
[6980] Failed to execute script 'main' due to unhandled exception!

OverflowError: string longer than 2147483647 bytes

commented

I was trying to modify upload_file function which you can find in upload_file_tests branch

problem with the following function and maybe previous as well is the RAM,
my guess is that there is physically limiting the upload,
I tried to upload a file of 8 GB from my laptop with 16GB memory (9 already in use)

I saw the process memory usage raising, taking process network speed as reference while uploading the file until gives me error {"error":{"code":418},"success":false}

I am trying to upload the file in chunks but still working on how to make it work.

How much memory and how big the file was? could you test the branch too?

thank you for your help