This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yolanda.robla
Recipients rbcollins, yolanda.robla
Date 2016-04-30.08:17:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1462004234.72.0.579452614018.issue26807@psf.upfronthosting.co.za>
In-reply-to
Content
How about...

@@ -2339,9 +2339,12 @@ def mock_open(mock=None, read_data=''):
         if handle.readline.return_value is not None:
             while True:
                 yield handle.readline.return_value
-        for line in _state[0]:
-            yield line
 
+        try:
+            while True:
+                yield next(_state[0])
+        except StopIteration:
+            yield ''
History
Date User Action Args
2016-04-30 08:17:14yolanda.roblasetrecipients: + yolanda.robla, rbcollins
2016-04-30 08:17:14yolanda.roblasetmessageid: <1462004234.72.0.579452614018.issue26807@psf.upfronthosting.co.za>
2016-04-30 08:17:14yolanda.roblalinkissue26807 messages
2016-04-30 08:17:14yolanda.roblacreate