Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c748506

Browse files
committed
#5636: fix next -> __next__ in csv reader docs.
1 parent 9ae3640 commit c748506

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

Doc/library/csv.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,13 @@ Reader Objects
351351
Reader objects (:class:`DictReader` instances and objects returned by the
352352
:func:`reader` function) have the following public methods:
353353

354-
355-
.. method:: csvreader.next()
354+
.. method:: csvreader.__next__()
356355

357356
Return the next row of the reader's iterable object as a list, parsed according
358-
to the current dialect.
357+
to the current dialect. Usually you should call this as ``next(reader)``.
359358

360-
Reader objects have the following public attributes:
361359

360+
Reader objects have the following public attributes:
362361

363362
.. attribute:: csvreader.dialect
364363

@@ -371,10 +370,8 @@ Reader objects have the following public attributes:
371370
number of records returned, as records can span multiple lines.
372371

373372

374-
375373
DictReader objects have the following public attribute:
376374

377-
378375
.. attribute:: csvreader.fieldnames
379376

380377
If not passed as a parameter when creating the object, this attribute is

Lib/test/test_xmlrpc.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,11 @@ def test_cgi_xmlrpc_response(self):
598598
sys.stdin = open("xmldata.txt", "r")
599599
sys.stdout = open(support.TESTFN, "w")
600600

601-
self.cgi.handle_request()
601+
os.environ['CONTENT_LENGTH'] = str(len(data))
602+
try:
603+
self.cgi.handle_request()
604+
finally:
605+
del os.environ['CONTENT_LENGTH']
602606

603607
sys.stdin.close()
604608
sys.stdout.close()

Lib/xmlrpc/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ def handle_request(self, request_text = None):
590590
# POST data is normally available through stdin
591591
try:
592592
length = int(os.environ.get('CONTENT_LENGTH', None))
593-
except ValueError:
593+
except (ValueError, TypeError):
594594
length = -1
595595
if request_text is None:
596596
request_text = sys.stdin.read(length)

0 commit comments

Comments
 (0)