urllib.urlretrieve never returns???

Prasad, Ramit ramit.prasad at jpmorgan.com
Tue Mar 20 21:52:00 CET 2012


> Today I got a different error message printed on console (program
> started with python.exe)
> 
> 
> 
> Unhandled exception in thread started by <bound method
> FrameLocEdit.GetThumbnail of <locedit.FrameLocEdit; proxy of <Swig
> Object of type 'wxPanel *' at 0x4f85300>
>  >>Unhandled exception in thread started by <bound method
> FrameLocEdit.GetThumbnail of <locedit.FrameLocEdit; proxy of <Swig
> Object of type 'wxPanel *' at 0x4f85300>
>  >>Unhandled exception in thread started by <bound method
> FrameLocEdit.GetThumbnail of <locedit.FrameLocEdit; proxy of <Swig
> Object of type 'wxPanel *' at 0x4f85300>
>  >>Unhandled exception in thread started by
> Traceback (most recent call last):
> 
> Traceback (most recent call last):
> 
> Traceback (most recent call last):
> <bound method FrameLocEdit.GetThumbnail of <locedit.FrameLocEdit; proxy
> of <Swig Object of type 'wxPanel *' at 0x4f85300>
>  >>  File "C:\Python\Projects\Warehouserclient_v3\locedit.py", line 917,
> in GetThumbnail
>    File "C:\Python\Projects\Warehouserclient_v3\locedit.py", line 917,
> in GetThumbnail
>    File "C:\Python\Projects\Warehouserclient_v3\locedit.py", line 917,
> in GetThumbnail
> 
> sys.excepthook is missing
> Traceback (most recent call last):
> 
> I have never seen a traceback like this before. I didn't install any
> excepthook myself.
> 
> Program is using wxPython, socket, threads, threading, PIL.
> 
> Here is something even more strange. If I click on the button three
> times, then absolutely nothing gets printed on stdout. However, if I
> close the program with file/exit (actually, calling
> wx.PySimpleApp.ExitMainLoop) then suddenly three stack traces are
> printed on stdout, all lines mixed up:
> 

Maybe in self.Log you should add a sys.stdout.flush	 and 
sys.stderr.flush(). I am not very familiar with stdin/out but
maybe it will help.

> Unhandled exception in thread started by <bound method
> FrameLocEdit.GetThumbnail of <locedit.FrameLocEdit; proxy of <Swig
> Object of type 'wxPanel *' at 0x4fb530
> 0>
>  >>Unhandled exception in thread started by Unhandled exception in
> thread started by <bound method FrameLocEdit.GetThumbnail of
> <locedit.FrameLocEdit; proxy of <Swig Object of type 'wxPanel *' at
> 0x4fb5300>
>  >>Unhandled exception in thread started by Unhandled exception in
> thread started by <bound method FrameLocEdit.GetThumbnail of
> <locedit.FrameLocEdit; proxy of <Swig Object of type 'wxPanel *' at
> 0x4fb5300>
>  >>Traceback (most recent call last):<bound method
> FrameLocEdit.GetThumbnail of <locedit.FrameLocEdit; proxy of <Swig
> Object of type 'wxPanel *' at 0x4fb5300>
>  >>Traceback (most recent call last):<bound method
> FrameLocEdit.GetThumbnail of <locedit.FrameLocEdit; proxy of <Swig
> Object of type 'wxPanel *' at 0x4fb5300>
>  >>Traceback (most recent call last):  File
> "C:\Python\Projects\Warehouserclient_v3\locedit.py", line 917, in
> GetThumbnail
> 
> 
> Traceback (most recent call last):
> 
>    File "C:\Python\Projects\Warehouserclient_v3\locedit.py", line 917,
> in GetThumbnail
> Traceback (most recent call last):
>    File "C:\Python\Projects\Warehouserclient_v3\locedit.py", line 917,
> in GetThumbnail
>        File "C:\Python\Projects\Warehouserclient_v3\locedit.py", line
> 917, in GetThumbnail
>        File "C:\Python\Projects\Warehouserclient_v3\locedit.py", line
> 917, in GetThumbnail
>      self.Log(traceback.format_exc())
>      self.Log(traceback.format_exc())
>      self.Log(traceback.format_exc())
> AttributeErrorself.Log(traceback.format_exc())
> AttributeErrorself.Log(traceback.format_exc())
> AttributeError: AttributeError: AttributeError:
> C:\Python\Projects\Warehouserclient_v3>
> 
> 
> And the last attributerror doesn't tell what attribute is missing.
> Probably I'll have to use a different library (pycurl, for example). But
> the error itself is getting more interesting.

This makes me think self does not have a .Log() or the traceback
import is being overridden by something else that does not have
.format_exc(). Or possibly this is in a function that does not have a 
self (maybe a typo in the function def?).

> 
> Also tried to use an invalid file (that should return with HTTP 404 not
> found) but the effect is exactly the same. Nothing is printed on stdout
> until I try to close the program (stop wxPython's mainloop). Then all
> previously threads throw an AttributeError and all of them print a stack
> trace (at the same time, lines mixed up).
> 
> I'll be experimenting with pyCurl now.


Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

--

This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  



More information about the Python-list mailing list