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 berker.peksag
Recipients Ankur.Ankan, Lita.Cho, berker.peksag, jesstess, mattrope
Date 2014-07-13.17:56:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1405274183.07.0.164958999594.issue1186900@psf.upfronthosting.co.za>
In-reply-to
Content
diff -r 8f85262fbe8a Lib/nntplib.py
--- a/Lib/nntplib.py	Sun Jul 06 02:24:24 2014 -0400
+++ b/Lib/nntplib.py	Thu Jul 10 16:10:38 2014 -0700
@@ -122,6 +122,9 @@
     """Error in response data"""
     pass
 
+class NNTPConnectError(NNTPError):
+    """Error during connection establishment."""
+    pass

Could you also document the new exception? (See Doc/library/nntplib.rst and please add a versionadded directive)

The pass statement is redundant, but we could keep it to be consistent with rest of the library.


@@ -435,7 +438,7 @@
             raise NNTPDataError('line too long')
         if self.debugging > 1:
             print('*get*', repr(line))
-        if not line: raise EOFError
+        if not line: raise NNTPConnectError()

    if not line:
        raise NNTPConnectError

looks more readable to me.

Also, you could add a more descriptive error message.
History
Date User Action Args
2014-07-13 17:56:23berker.peksagsetrecipients: + berker.peksag, mattrope, jesstess, Ankur.Ankan, Lita.Cho
2014-07-13 17:56:23berker.peksagsetmessageid: <1405274183.07.0.164958999594.issue1186900@psf.upfronthosting.co.za>
2014-07-13 17:56:23berker.peksaglinkissue1186900 messages
2014-07-13 17:56:22berker.peksagcreate