RE: urllib.urlretrieve never returns???

2012-03-22 Thread Prasad, Ramit
> > I just looked at your source file on ActiveState and noticed that > > you do not import traceback. That is why you are getting the > > AttributeError. Now you should be getting a much better error > > once you import it:) > Nope. That would result in a NameError. After adding "import traceback"

Re: urllib.urlretrieve never returns???

2012-03-21 Thread Laszlo Nagy
On 2012-03-20 22:26, Prasad, Ramit wrote: I just looked at your source file on ActiveState and noticed that you do not import traceback. That is why you are getting the AttributeError. Now you should be getting a much better error once you import it:) Nope. That would result in a NameError. After

RE: urllib.urlretrieve never returns???

2012-03-20 Thread Prasad, Ramit
it :) Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713 - 216 - 5423 -- > -Original Message- > From: python-list-bounces+ramit.prasad=jpmorgan....@python.org > [mailto:python-list-bounces+ramit.p

RE: urllib.urlretrieve never returns??? [SOLVED] - workaround

2012-03-20 Thread Prasad, Ramit
> Everything works perfectly, in all modes: console, no console, started > directly and started in separate thread. > > So the problem with urllib must be. Maybe wxPython installs some except > hooks, or who knows? If somebody feels up to it, I can start narrowing > down the problem to the smalles

RE: urllib.urlretrieve never returns??? [SOLVED] - workaround

2012-03-20 Thread Prasad, Ramit
> > Everything works perfectly, in all modes: console, no console, started > > directly and started in separate thread. > > > > So the problem with urllib must be. Maybe wxPython installs some except > > hooks, or who knows? If somebody feels up to it, I can start narrowing > > down the problem to

RE: urllib.urlretrieve never returns???

2012-03-20 Thread Prasad, Ramit
> Today I got a different error message printed on console (program > started with python.exe) > > > > Unhandled exception in thread started by FrameLocEdit.GetThumbnail of Object of type 'wxPanel *' at 0x4f85300> > >>Unhandled exception in thread started by FrameLocEdit.GetThumbnail of Obj

Re: urllib.urlretrieve never returns??? [SOLVED] - workaround

2012-03-20 Thread Laszlo Nagy
I'll be experimenting with pyCurl now. By replacing the GetThumbnail method with this brainless example, taken from the pyCurl demo: def GetThumbnail(self,imgurl): class Test: def __init__(self): self.contents = '' def body_callback(self,

Re: urllib.urlretrieve never returns???

2012-03-20 Thread John Nagle
On 3/17/2012 9:34 AM, Chris Angelico wrote: 2012/3/18 Laszlo Nagy: In the later case, "log.txt" only contains "#1" and nothing else. If I look at pythonw.exe from task manager, then its shows +1 thread every time I click the button, and "#1" is appended to the file. Does it fail to retrieve

Re: urllib.urlretrieve never returns???

2012-03-20 Thread Laszlo Nagy
2012.03.20. 8:08 keltezéssel, Laszlo Nagy írta: Here you can find the example program and the original post. http://code.activestate.com/lists/python-list/617894/ I gather you are running urlretrieve in a separate thread, inside a GUI? Yes. I have learned that whenever I have inexplicable b

Re: urllib.urlretrieve never returns???

2012-03-20 Thread Laszlo Nagy
Here you can find the example program and the original post. http://code.activestate.com/lists/python-list/617894/ I gather you are running urlretrieve in a separate thread, inside a GUI? Yes. I have learned that whenever I have inexplicable behaviour in a function, I should check my assumpt

Re: urllib.urlretrieve never returns???

2012-03-19 Thread Steven D'Aprano
On Mon, 19 Mar 2012 20:32:03 +0100, Laszlo Nagy wrote: > The pythonw.exe may not have the rights to access network resources. >>> Have you set a default timeout for sockets? >>> >>> import socket >>> socket.setdefaulttimeout(10) # 10 seconds > I have added pythonw.exe to allowed exceptions. Disabl

Re: urllib.urlretrieve never returns???

2012-03-19 Thread Jon Clements
On Monday, 19 March 2012 19:32:03 UTC, Laszlo Nagy wrote: > The pythonw.exe may not have the rights to access network resources. > >> Have you set a default timeout for sockets? > >> > >> import socket > >> socket.setdefaulttimeout(10) # 10 seconds > I have added pythonw.exe to allowed exceptions.

Re: urllib.urlretrieve never returns???

2012-03-19 Thread Laszlo Nagy
The pythonw.exe may not have the rights to access network resources. Have you set a default timeout for sockets? import socket socket.setdefaulttimeout(10) # 10 seconds I have added pythonw.exe to allowed exceptions. Disabled firewall completely. Set socket timeout to 10 seconds. Still nothing.

Re: urllib.urlretrieve never returns???

2012-03-19 Thread Laszlo Nagy
On 2012-03-17 19:18, Christian Heimes wrote: Am 17.03.2012 15:13, schrieb Laszlo Nagy: See attached example code. I have a program that calls exactly the same code, and here is the strange thing about it: * Program is started as "start.py", e.g. with an open console. In this case, the p

Re: urllib.urlretrieve never returns???

2012-03-17 Thread Christian Heimes
Am 17.03.2012 15:13, schrieb Laszlo Nagy: > See attached example code. I have a program that calls exactly the same > code, and here is the strange thing about it: > > * Program is started as "start.py", e.g. with an open console. In this > case, the program works! > * Program is started a

Re: urllib.urlretrieve never returns???

2012-03-17 Thread Chris Angelico
On Sun, Mar 18, 2012 at 4:31 AM, Laszlo Nagy wrote: > You are right, I should have added "import traceback". However, I tried > this: > >        except: >            self.Log("Exception") > > and still nothing was logged. Another proof is that the number of threads is > increased every time I pres

Re: urllib.urlretrieve never returns???

2012-03-17 Thread Laszlo Nagy
2012.03.17. 17:34 keltezéssel, Chris Angelico wrote 2012/3/18 Laszlo Nagy: In the later case, "log.txt" only contains "#1" and nothing else. If I look at pythonw.exe from task manager, then its shows +1 thread every time I click the button, and "#1" is appended to the file. try:

Re: urllib.urlretrieve never returns???

2012-03-17 Thread Chris Angelico
2012/3/18 Laszlo Nagy : > In the later case, "log.txt" only contains "#1" and nothing else. If I look > at pythonw.exe from task manager, then its shows +1 thread every time I > click the button, and "#1" is appended to the file. try: fpath = urllib.urlretrieve(imgurl)[0]

urllib.urlretrieve never returns???

2012-03-17 Thread Laszlo Nagy
See attached example code. I have a program that calls exactly the same code, and here is the strange thing about it: * Program is started as "start.py", e.g. with an open console. In this case, the program works! * Program is started as "start.pyw", e.g. with no open console under Windo