[issue15922] make howto/urllib2.rst doctests pass

New submission from Chris Jerdonek: This issue is to make the doctests in howto/urllib2.rst pass using vanilla doctest. Patch attached. ---------- assignee: docs@python components: Documentation files: issue-doctest-howto-urllib-1.patch keywords: easy, patch messages: 170305 nosy: cjerdonek, docs@python, orsenthil priority: normal severity: normal status: open title: make howto/urllib2.rst doctests pass versions: Python 2.7, Python 3.2, Python 3.3 Added file: http://bugs.python.org/file27174/issue-doctest-howto-urllib-1.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15922> _______________________________________

Changes by Chris Jerdonek <chris.jerdonek@gmail.com>: ---------- stage: -> patch review _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15922> _______________________________________

Changes by Ezio Melotti <ezio.melotti@gmail.com>: ---------- nosy: +ezio.melotti type: -> enhancement _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15922> _______________________________________

Ezio Melotti added the comment: + >>> try: + ... urllib.request.urlopen(req) + ... except urllib.error.URLError as e: + ... print("Error opening url.") + ... # E.g. "[Errno 8] nodename nor servname provided, or not known" + ... print("Reason:", e.reason) #doctest: +ELLIPSIS + Error opening url. + Reason: ... I think the previous version was clearer, so maybe this should be a skip. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15922> _______________________________________

Roundup Robot added the comment: New changeset a6f37d503878 by Senthil Kumaran in branch '3.2': Fix Issue 15922: make howto/urllib2.rst doctests pass. http://hg.python.org/cpython/rev/a6f37d503878 New changeset a24d3e2124b6 by Senthil Kumaran in branch '3.3': Fix Issue 15922: make howto/urllib2.rst doctests pass. http://hg.python.org/cpython/rev/a24d3e2124b6 New changeset 8f699eac0908 by Senthil Kumaran in branch 'default': Fix Issue 15922: make howto/urllib2.rst doctests pass. http://hg.python.org/cpython/rev/8f699eac0908 ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15922> _______________________________________

Chris Jerdonek added the comment: Thanks, Senthil! ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15922> _______________________________________

Roundup Robot added the comment: New changeset b2f282991973 by Senthil Kumaran in branch '2.7': Fix Issue 15922: make howto/urllib2.rst doctests pass. http://hg.python.org/cpython/rev/b2f282991973 ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15922> _______________________________________

Changes by Senthil Kumaran <senthil@uthcode.com>: ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15922> _______________________________________

Changes by Chris Jerdonek <chris.jerdonek@gmail.com>: ---------- stage: -> patch review _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15922> _______________________________________

Changes by Ezio Melotti <ezio.melotti@gmail.com>: ---------- nosy: +ezio.melotti type: -> enhancement _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15922> _______________________________________

Ezio Melotti added the comment: + >>> try: + ... urllib.request.urlopen(req) + ... except urllib.error.URLError as e: + ... print("Error opening url.") + ... # E.g. "[Errno 8] nodename nor servname provided, or not known" + ... print("Reason:", e.reason) #doctest: +ELLIPSIS + Error opening url. + Reason: ... I think the previous version was clearer, so maybe this should be a skip. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15922> _______________________________________

Roundup Robot added the comment: New changeset a6f37d503878 by Senthil Kumaran in branch '3.2': Fix Issue 15922: make howto/urllib2.rst doctests pass. http://hg.python.org/cpython/rev/a6f37d503878 New changeset a24d3e2124b6 by Senthil Kumaran in branch '3.3': Fix Issue 15922: make howto/urllib2.rst doctests pass. http://hg.python.org/cpython/rev/a24d3e2124b6 New changeset 8f699eac0908 by Senthil Kumaran in branch 'default': Fix Issue 15922: make howto/urllib2.rst doctests pass. http://hg.python.org/cpython/rev/8f699eac0908 ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15922> _______________________________________

Chris Jerdonek added the comment: Thanks, Senthil! ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15922> _______________________________________

Roundup Robot added the comment: New changeset b2f282991973 by Senthil Kumaran in branch '2.7': Fix Issue 15922: make howto/urllib2.rst doctests pass. http://hg.python.org/cpython/rev/b2f282991973 ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15922> _______________________________________

Changes by Senthil Kumaran <senthil@uthcode.com>: ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15922> _______________________________________
participants (4)
-
Chris Jerdonek
-
Ezio Melotti
-
Roundup Robot
-
Senthil Kumaran