[docs] [issue33830] example output error

Aifu LIU report at bugs.python.org
Mon Jun 11 06:45:03 EDT 2018


New submission from Aifu LIU <laf163 at gmail.com>:

The output of this line:
    print r2.status, r2.reason
should same as:
    print r1.status, r1.reason

from https://docs.python.org/2.7/library/httplib.html

>>> import httplib
>>> conn = httplib.HTTPSConnection("www.python.org")
>>> conn.request("GET", "/")
>>> r1 = conn.getresponse()
>>> print r1.status, r1.reason
200 OK
>>> data1 = r1.read()
>>> conn.request("GET", "/")
>>> r2 = conn.getresponse()
>>> print r2.status, r2.reason
404 Not Found
>>> data2 = r2.read()
>>> conn.close()

----------
assignee: docs at python
components: Documentation
messages: 319290
nosy: Aifu LIU, docs at python
priority: normal
severity: normal
status: open
title: example output error
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33830>
_______________________________________


More information about the docs mailing list