Python Forum

Full Version: python largesize(6GB) file upload fails
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
My device supports only Python2.6.6

As part of automation using python-selenium, I am able to upload small size file and not the large size(6GB - tar) file using the following steps:
  • 1) Open GUI
    2) Navigate to upload page in GUI.
    3) Upload files using Selenium cmd -- <Browse_css_locator>.send_keys(<filename>)

Issues observed while uploading tar:

1) Raises LargeZipFile Error:
LargeZipFile: Zipfile size would require ZIP64 extensions


Workaround explored :
-- Need to enable ‘allowZip64’ as True in zipfile.py

2) When I test with allowZip64 as True, it still fails with the below error Message:
DeprecationWarning: 'L' format requires 0 <= number <= 4294967295
zinfo.file_size)


Workaround explored:
-- This issue was raised as a bug from python community and have patches for 2.7, 3+ and not for 2.6

Please help .
Python version = 2.7

As part of automation using python-selenium, I am able to upload small size file and not the large size(6GB - tar) file using the following steps:

1) Open GUI
2) Navigate to upload page in GUI.
3) Upload files using Selenium cmd -- <Browse_css_locator>.send_keys(<filename>)

After enabling ‘allowZip64’ as True in zipfile.py and applying patch for ("DeprecationWarning: 'L' format requires 0 <= number <= 4294967295
zinfo.file_size" )
issue ,it still fails with "Memory Error" as shown below:

File "/home/nithya/nutest/my_nutest_virtual_env/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 320, in send_keys
value = self._upload(local_file)
File "/home/nithya/nutest/my_nutest_virtual_env/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 505, in _upload
zipped.write(filename, os.path.split(filename)[1])
File "/home/nithya/nutest/my_nutest_virtual_env/lib64/python2.7/zipfile.py", line 1176, in write
self.fp.seek(zinfo.header_offset + 14, 0)
File "/usr/lib64/python2.7/StringIO.py", line 106, in seek
self.buf += ''.join(self.buflist)
MemoryError


Please help .
There might be a workaround, but there's an issue reported with this behavior labeled Status-WorkingAsIntended, and a 2014 post on Google Groups where someone says they don't have a workaround.

If I were you, I'd contact the Selenium authors/project about this, since there may have been a change in the last year (or more). Based on your goal of automation, I can't think of any pleasant workaround. Everything would either involve (1) bypassing the thing you wish to tests or (2) pausing and allowing manual action.