File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -351,14 +351,13 @@ Reader Objects
351351Reader 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-
375373DictReader 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
Original file line number Diff line number Diff 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 ()
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments