I have code the goes to a page and downloads information on its update. Every once in a while it errors out with

url2z = url2z.read()
  File "/usr/lib/python3.1/http/client.py", line 502, in read
    s = self._safe_read(self.length)
  File "/usr/lib/python3.1/http/client.py", line 594, in _safe_read
    raise IncompleteRead(b''.join(s), amt)
http.client.IncompleteRead: IncompleteRead(15928 bytes read, 37182 more expected)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.1/threading.py", line 516, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.1/threading.py", line 722, in run
    self.function(*self.args, **self.kwargs)
  File "rush.py", line 29, in Update
    url2z = url2z.read()
  File "/usr/lib/python3.1/http/client.py", line 502, in read
    s = self._safe_read(self.length)
  File "/usr/lib/python3.1/http/client.py", line 594, in _safe_read
    raise IncompleteRead(b''.join(s), amt)
http.client.IncompleteRead: IncompleteRead(0 bytes read, 53110 more expected)

Are there fixes for this or catches? I tried a try, except but the error still commences

except IncompleteRead or maybe leave out the length from read if possible. Normaly you would not like to read incomplete page.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.