Re: NNTP client considerations; how to avoid 480 error?
era <[email protected]> Wed, 18 Dec 2024 12:14:08 +0200
| Newsgroups | gmane.discuss |
|---|---|
| Message-ID | <[email protected]> |
(Sorry for talking to myself here ...) era <[email protected]> writes: > Turns out a few of the groups I want to poll simply seem to always > return this error, regardless of how exactly I try to access them. > > Weirdly, accessing them from Gnus or slrnpull was never a problem. I > wonder what secret sauce I need to give my Python script access to them? Belatedly (sic) I think I have an explanation. https://github.com/python/cpython/issues/73157 is a pesky bug in the Python (now retired) nntplib module which causes it to go out of whack when it thinks there was an error with too long lines in the response from the server. There was a patch with a fix but it was never accepted before the library was pruned from the Python standard library. The quick and dirty fix is to set nntplib._MAXLINE = 65536. Now that the library is no longer part of the standard library, you could pip insstall nntplib and hack it; or you can just set the value in your own script after import nntplib. -- If this were my real .signature, it would suck less. Well, perhaps not.