[issue32586] urllib2 HOWTO URLError example minor error

2018-01-18 Thread MarmiteFox

MarmiteFox  added the comment:

Thanks for the fix and the tip about cross-checking in Python 3 - will remember 
that for the future.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32586] urllib2 HOWTO URLError example minor error

2018-01-18 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Thanks!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32586] urllib2 HOWTO URLError example minor error

2018-01-18 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset 8ca036d4716fc86ff42474ba35d3cd32f0188a15 by Mariatta (Pablo 
Galindo) in branch '2.7':
bpo-32586: Fix code example in urllib2's doc  (GH-5238)
https://github.com/python/cpython/commit/8ca036d4716fc86ff42474ba35d3cd32f0188a15


--
nosy: +Mariatta

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32586] urllib2 HOWTO URLError example minor error

2018-01-18 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

Thanks for reporting this issue. Indeed, this is an error in the documentation. 
Notice that this is corrected in Python3 's version:

https://docs.python.org/3.6/howto/urllib2.html#handling-exceptions

I have prepared a Pull Request fixing this. Thanks!

--
nosy: +pablogsal
priority: normal -> low

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32586] urllib2 HOWTO URLError example minor error

2018-01-18 Thread Pablo Galindo Salgado

Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +5084
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32586] urllib2 HOWTO URLError example minor error

2018-01-17 Thread Tim Morris

New submission from Tim Morris :

In the HOWTO for urllib2 for Python 2, in the Handling Exceptions section, it 
discusses the URLError exception being raised by urlopen() 
(https://docs.python.org/2/howto/urllib2.html#urlerror). The code snippet 
example for this has (I think) a minor error:
the 3rd line reads:
"except URLError as e:"
which I think should be:
"except urllib2.URLError as e:"

The code as given only works if urllib2 had been imported via:
"from urllib2 import *"
The snippet doesn't list the import statements but all the other examples just 
use "import urllib2" (and obviously "from x import *" is bad practice anyway 
and wouldn't be encouraged or expected).

I am relatively new to Python, so it's possible it *is* correct and I just 
implemented it incorrectly. But if not, it would be helpful to correct it (even 
though it's a very minor error) so that other newbies like me don't come 
unstuck when using the tutorial.

--
assignee: docs@python
components: Documentation
messages: 310201
nosy: MarmiteFox, docs@python
priority: normal
severity: normal
status: open
title: urllib2 HOWTO URLError example minor error
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com