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

OverflowError #9

Open
f-o opened this issue Dec 3, 2024 · 1 comment
Open

OverflowError #9

f-o opened this issue Dec 3, 2024 · 1 comment

Comments

@f-o
Copy link

f-o commented Dec 3, 2024

Hello,

First of all, thank you for this very useful module.

I'm trying to upload a folder with 42 files, totaling 80.4 GB.
gofile -s <PATH TO FOLDER>

Unfortunate I'm running into an overflow error.
OverflowError: string longer than 2147483647 bytes

Stack trace is as follows:

Traceback (most recent call last):
  File "/home/fox/scripts/gofile/venv/bin/gofile", line 8, in <module>
    sys.exit(gofile.main())
  File "/home/fox/scripts/gofile/venv/lib/python3.9/site-packages/gofilepy/gofile.py", line 179, in main
    gofile_upload(
  File "/home/fox/scripts/gofile/venv/lib/python3.9/site-packages/gofilepy/gofile.py", line 89, in gofile_upload
    upload_resp = upload(file, best_server, folder_id).json()
  File "/home/fox/scripts/gofile/venv/lib/python3.9/site-packages/gofilepy/gofile.py", line 34, in upload
    resp = requests.post(
  File "/home/fox/scripts/gofile/venv/lib/python3.9/site-packages/requests/api.py", line 119, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/home/fox/scripts/gofile/venv/lib/python3.9/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/fox/scripts/gofile/venv/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/fox/scripts/gofile/venv/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/home/fox/scripts/gofile/venv/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/home/fox/scripts/gofile/venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 715, in urlopen
    httplib_response = self._make_request(
  File "/home/fox/scripts/gofile/venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 416, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/home/fox/scripts/gofile/venv/lib/python3.9/site-packages/urllib3/connection.py", line 244, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/lib/python3.9/http/client.py", line 1259, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1305, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1254, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1053, in _send_output
    self.send(chunk)
  File "/usr/lib/python3.9/http/client.py", line 975, in send
    self.sock.sendall(data)
  File "/usr/lib/python3.9/ssl.py", line 1237, in sendall
    v = self.send(byte_view[count:])
  File "/usr/lib/python3.9/ssl.py", line 1206, in send
    return self._sslobj.write(data)
OverflowError: string longer than 2147483647 bytes

I understand that it's most likely caused by the total size of the upload, but I'm hoping you can take a look at this, and hopefully be able to figure some solution out.

Once again, thank you for this awesome script!

@Alyetama
Copy link
Owner

Thank you for reporting the issue!
The error you're encountering, OverflowError: string longer than 2147483647 bytes, is likely due to the total size of the upload exceeding http.client's limitations. While reading the file in chunks could potentially resolve this, I don't plan to implement this unless it becomes a frequent issue.

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

2 participants