Unsolved

This post is more than 5 years old

4 Posts

2166

July 17th, 2012 12:00

Python Library Error

I am trying to upload a file rather string of about 10MB using the Python library and after about 30 seconds I get the following error. Is there a file limit size or do I have to break the file/string in chunks?

----------------------------------------------------------------------

Traceback (most recent call last):

  File "EsuRestApiTest.py", line 59, in test_upload_1KB_payload

    oid = esu.create_object_on_path(data=data, path=path)

  File "/Users/najeemb/work/savvis/junos/EsuRestApi.py", line 161, in create_object_on_path

    response = self.__send_request(request, hashout, headers)

  File "/Users/najeemb/work/savvis/junos/EsuRestApi.py", line 1132, in __send_request

    response = urllib2.urlopen(request)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen

    return _opener.open(url, data, timeout)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 394, in open

    response = self._open(req, data)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 412, in _open

    '_open', req)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain

    result = func(*args)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1207, in https_open

    return self.do_open(httplib.HTTPSConnection, req)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1174, in do_open

    raise URLError(err)

URLError:

222 Posts

July 17th, 2012 12:00

EsuRestApiTest is the unit test. You should be using EsuRestApi instead.

222 Posts

July 17th, 2012 12:00

Sorry, I see that now. There are no such file size limitations where a 10MB file would cause a problem.

4 Posts

July 17th, 2012 12:00

That is what I am using. I am using the EsuRestApi. I modified the EsuRestApiTest file for my own purposes.

4 Posts

July 17th, 2012 13:00

Right. But any idea why it's erroring out?

222 Posts

July 17th, 2012 13:00

Does the unit test run without error if you exclude the custom test case that you created?  Have you tried uploading large files from that same instance where the error occurs using the AtmosFox or AtmosChrome browser extensions?

4 Posts

July 17th, 2012 14:00

Yes, runs perfect without my custom test cases, and no errors occur in AtmosFox or in the Chrome extension with the file.

222 Posts

July 17th, 2012 16:00

Can you try doing this outside of the unit test by just using the main module and class?  You shouldn't have a problem in that case.

I see the problem you're describing, but only when creating large files using the unit test.  I'll investigate why this happens.

222 Posts

July 18th, 2012 08:00

Quick update:  I don't know the exact cause yet, but I believe the problem is limited to the Python unit test framework and OSX.  I can't recreate the problem on Linux or Windows.  I'll update as I find out more.

No Events found!

Top