Python Forum
python largesize(6GB) file upload fails
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python largesize(6GB) file upload fails
#1
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 .
Reply
#2
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 .
Reply
#3
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Upload big file on the server HTTP protocol Timych 1 2,376 May-15-2020, 07:12 AM
Last Post: snippsat
  fix error upload image in python abdlwafitahiri 1 2,320 Jan-05-2020, 08:49 AM
Last Post: Larz60+
  upload big file in Django with process bar and i get error : MemoryError ma_norouzifar 3 4,338 Aug-06-2019, 06:57 AM
Last Post: fishhook
  file upload from windows10 machine using send_key in selenium fails nithya_g 3 4,590 Jan-12-2018, 09:32 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020