On 30Sep2015 23:56, Laura Creighton wrote:
In a message of Thu, 01 Oct 2015 07:30:59 +1000, Cameron Simpson writes:
Most likely the Ctrl-C interrupts whatever system call is hanging, causing it
to return (failed, probably with errno EINTR). And the python program resumes
because the OS system c
In a message of Thu, 01 Oct 2015 07:30:59 +1000, Cameron Simpson writes:
>Most likely the Ctrl-C interrupts whatever system call is hanging, causing it
>to return (failed, probably with errno EINTR). And the python program resumes
>because the OS system call has returned.
>
>Cheers,
>Cameron Simp
On 29Sep2015 23:04, shiva upreti wrote:
On Friday, September 25, 2015 at 12:55:01 PM UTC+5:30, Cameron Simpson wrote:
Ok. You original code says:
try:
r=requests.post(url, data=query_args)
except:
print "Connection error"
and presumably we think your code is hanging inside the req
On Friday, September 25, 2015 at 12:55:01 PM UTC+5:30, Cameron Simpson wrote:
> On 24Sep2015 22:46, shiva upreti wrote:
> >On Friday, September 25, 2015 at 10:55:45 AM UTC+5:30, Cameron Simpson wrote:
> >> On 24Sep2015 20:57, shiva upreti wrote:
> >> >Thank you Cameron.
> >> >I think the problem
Hi Cameron.
i had the same problems and you have to tell to python what to do with the
connect problem.
try this:
...
except *urllib.error.HTTPError* as e:
if e.getcode()==504:
disp = "SIN RESPUESTA DEL SERVIDOR" #(No answer from the
server)
nombre=''
On 26Sep2015 09:46, Gonzalo V wrote:
Hi Cameron.
i had the same problems and you have to tell to python what to do with the
connect problem.
Definitely. That's why we're encouraging him to handle specific exceptions.
try this:
...
except *urllib.error.HTTPError* as e:
if e.getcode
On 24Sep2015 22:46, shiva upreti wrote:
On Friday, September 25, 2015 at 10:55:45 AM UTC+5:30, Cameron Simpson wrote:
On 24Sep2015 20:57, shiva upreti wrote:
>Thank you Cameron.
>I think the problem with my code is that it just hangs without raising any
>exceptions. And as mentioned by Laura
On Friday, September 25, 2015 at 10:55:45 AM UTC+5:30, Cameron Simpson wrote:
> On 24Sep2015 20:57, shiva upreti wrote:
> >Thank you Cameron.
> >I think the problem with my code is that it just hangs without raising any
> >exceptions. And as mentioned by Laura above that when I press CTRL+C, it
On Thursday, September 24, 2015 at 4:09:04 PM UTC+5:30, Laura Creighton wrote:
> In a message of Wed, 23 Sep 2015 19:49:17 -0700, shiva upreti writes:
> >Hi
> >If my script hangs because of the reasons you mentioned above, why doesnt it
> >catch ConnectionError?
> >My script stops for a while and
On Thursday, September 24, 2015 at 4:09:04 PM UTC+5:30, Laura Creighton wrote:
> In a message of Wed, 23 Sep 2015 19:49:17 -0700, shiva upreti writes:
> >Hi
> >If my script hangs because of the reasons you mentioned above, why doesnt it
> >catch ConnectionError?
> >My script stops for a while and
On 24Sep2015 20:57, shiva upreti wrote:
Thank you Cameron.
I think the problem with my code is that it just hangs without raising any
exceptions. And as mentioned by Laura above that when I press CTRL+C, it just
catches that exception and prints ConnectionError which is definitely a lie in
th
Thank you Cameron.
I think the problem with my code is that it just hangs without raising any
exceptions. And as mentioned by Laura above that when I press CTRL+C, it just
catches that exception and prints ConnectionError which is definitely a lie in
this case as you mentioned.
As my code doesnt
Thank you. I didnt know about keyboard interrupt exception.
It means my code hangs without raising any exceptions, what should i do in this
case?
--
https://mail.python.org/mailman/listinfo/python-list
On 24Sep2015 12:38, Laura Creighton wrote:
In a message of Wed, 23 Sep 2015 19:49:17 -0700, shiva upreti writes:
If my script hangs because of the reasons you mentioned above, why doesnt it
catch ConnectionError?
My script stops for a while and when I press CTRL+C, it shows ConnectionError
wi
In a message of Wed, 23 Sep 2015 19:49:17 -0700, shiva upreti writes:
>Hi
>If my script hangs because of the reasons you mentioned above, why doesnt it
>catch ConnectionError?
>My script stops for a while and when I press CTRL+C, it shows ConnectionError
>without terminating the process, and the
On Sunday, September 20, 2015 at 8:11:18 PM UTC+5:30, Laura Creighton wrote:
> The discussion about why or why not to use a bare except has gotten us
> away from the problem reported, which is "why is my script hanging?"
>
> In a message of Sat, 19 Sep 2015 17:18:12 +0100, Mark Lawrence writes:
>
The discussion about why or why not to use a bare except has gotten us
away from the problem reported, which is "why is my script hanging?"
In a message of Sat, 19 Sep 2015 17:18:12 +0100, Mark Lawrence writes:
>> I am learning python. I wrote a script using requests module.
>> The scripts runs fi
On 2015-09-20, Chris Angelico wrote:
> On Sun, Sep 20, 2015 at 10:45 PM, Jon Ribbens
> wrote:
>> On 2015-09-19, Mark Lawrence wrote:
>>> On 19/09/2015 07:13, shiva upreti wrote:
try:
r=requests.post(url, data=query_args)
except:
On 2015-09-20, Mark Lawrence wrote:
> On 20/09/2015 13:45, Jon Ribbens wrote:
>> On 2015-09-19, Mark Lawrence wrote:
>>> On 19/09/2015 07:13, shiva upreti wrote:
try:
r=requests.post(url, data=query_args)
except:
prin
On Sun, Sep 20, 2015 at 10:45 PM, Jon Ribbens
wrote:
> On 2015-09-19, Mark Lawrence wrote:
>> On 19/09/2015 07:13, shiva upreti wrote:
>>> try:
>>> r=requests.post(url, data=query_args)
>>> except:
>>> print "Connection error"
>>
On 20/09/2015 13:45, Jon Ribbens wrote:
On 2015-09-19, Mark Lawrence wrote:
On 19/09/2015 07:13, shiva upreti wrote:
try:
r=requests.post(url, data=query_args)
except:
print "Connection error"
Never use a bare ex
On 2015-09-19, Mark Lawrence wrote:
> On 19/09/2015 07:13, shiva upreti wrote:
>> try:
>> r=requests.post(url, data=query_args)
>> except:
>> print "Connection error"
>
> Never use a bare except in Python, always handle the bare m
On 19/09/2015 07:13, shiva upreti wrote:
I am learning python. I wrote a script using requests module.
The scripts runs fine for sometime, but after a while it hangs. When I press
CTRL+C it shows ConnectionError even though I have included exception handling.
I am not sure as to why it cant hand
I am learning python. I wrote a script using requests module.
The scripts runs fine for sometime, but after a while it hangs. When I press
CTRL+C it shows ConnectionError even though I have included exception handling.
I am not sure as to why it cant handle ConnectionError when the script runs for
24 matches
Mail list logo