Mailing List Archive

What to use instead of nntplib?
I got a nice warning today from the inews utility I use daily:

DeprecationWarning: 'nntplib' is deprecated and slated for removal in Python 3.13

What should I use in place of nntplib?

--
Grant
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
> I got a nice warning today from the inews utility I use daily:
>
> DeprecationWarning: 'nntplib' is deprecated and slated for removal in Python 3.13
>
> What should I use in place of nntplib?

I'd recommend creating a PyPI project with the existing 3.12 code,
then using that from 3.13 onward.

Skip
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
On 2023-05-15, Skip Montanaro <skip.montanaro@gmail.com> wrote:
>> I got a nice warning today from the inews utility I use daily:
>>
>> DeprecationWarning: 'nntplib' is deprecated and slated for
>> removal in Python 3.13
>>
>> What should I use in place of nntplib?
>
> I'd recommend creating a PyPI project with the existing 3.12 code,
> then using that from 3.13 onward.

That may be the easiest option. :/

I did some googling for utilities to post articles to NNTP servers and
found "postnews". Of course it's written in Python and depends on
nntplib...

--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
On 15/05/2023 22:11, Grant Edwards wrote:
> I got a nice warning today from the inews utility I use daily:
>
> DeprecationWarning: 'nntplib' is deprecated and slated for removal in Python 3.13
>
> What should I use in place of nntplib?

I'm curious as to why nntplib is deprecated? Surely there are still a
lot of nntp servers around, both inside and outside corporate firewalls?
Is there a problem with the module or is it just perceived as no longer
required?

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
On 16May2023 09:26, Alan Gauld <learn2program@gmail.com> wrote:
>On 15/05/2023 22:11, Grant Edwards wrote:
>> I got a nice warning today from the inews utility I use daily:
>>
>> DeprecationWarning: 'nntplib' is deprecated and slated for removal in Python 3.13
>>
>> What should I use in place of nntplib?
>
>I'm curious as to why nntplib is deprecated? Surely there are still a
>lot of nntp servers around, both inside and outside corporate firewalls?
>Is there a problem with the module or is it just perceived as no longer
>required?

See PEP 594: https://peps.python.org/pep-0594/
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
Tuesday, May 16, 2023 at 9:26, Alan Gauld wrote:
Re: What to use instead of nntplib? (at least in part)

>On 15/05/2023 22:11, Grant Edwards wrote:
>> I got a nice warning today from the inews utility I use daily:
>>
>> DeprecationWarning: 'nntplib' is deprecated and slated for removal in Python 3.13
>>
>> What should I use in place of nntplib?

>I'm curious as to why nntplib is deprecated? Surely there are still a
>lot of nntp servers around

there must be this list is mirrored on one, and AFAICS some pythoners use that
way to post (over the list)
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
On 16/05/2023 10:06, Cameron Simpson wrote:

>> I'm curious as to why nntplib is deprecated? Surely there are still a
>> lot of nntp servers around, both inside and outside corporate firewalls?
>> Is there a problem with the module or is it just perceived as no longer
>> required?
>
> See PEP 594: https://peps.python.org/pep-0594/

Thanks Cameron.
A scary list; I must have a dozen projects from the late 90s still
live that are using many of these! I'm glad I'm retired and won't
be the one who has to fix 'em :-)

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
Grizzy Adams <RealGrizzlyAdams@vivaldi.net> wrote:
> Tuesday, May 16, 2023 at 9:26, Alan Gauld wrote:
> Re: What to use instead of nntplib? (at least in part)
>
> >On 15/05/2023 22:11, Grant Edwards wrote:
> >> I got a nice warning today from the inews utility I use daily:
> >>
> >> DeprecationWarning: 'nntplib' is deprecated and slated for removal in Python 3.13
> >>
> >> What should I use in place of nntplib?
>
> >I'm curious as to why nntplib is deprecated? Surely there are still a
> >lot of nntp servers around
>
> there must be this list is mirrored on one, and AFAICS some pythoners use that
> way to post (over the list)

Yes, me for one, a good newsreader is really a wonderful way to manage
technical 'lists' like this one. Usenet news is still very much alive
though a minority interest now I suspect.

--
Chris Green
ยท
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
On 5/15/23 20:12, Grant Edwards wrote:
> On 2023-05-15, Skip Montanaro <skip.montanaro@gmail.com> wrote:
>>> I got a nice warning today from the inews utility I use daily:
>>>
>>> DeprecationWarning: 'nntplib' is deprecated and slated for
>>> removal in Python 3.13
>>>
>>> What should I use in place of nntplib?
>>
>> I'd recommend creating a PyPI project with the existing 3.12 code,
>> then using that from 3.13 onward.
>
> That may be the easiest option. :/
>
> I did some googling for utilities to post articles to NNTP servers and
> found "postnews". Of course it's written in Python and depends on
> nntplib...
>

Should mention that there was a thread on this at discuss.python.org.
Which seems to have petered out without a real resolution.

https://discuss.python.org/t/allow-nntplib-on-pypi/25786


--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
On 2023-05-16, Alan Gauld <learn2program@gmail.com> wrote:
> On 16/05/2023 10:06, Cameron Simpson wrote:
>
>>> I'm curious as to why nntplib is deprecated? Surely there are still a
>>> lot of nntp servers around, both inside and outside corporate firewalls?

Anything not used to develop AI is going to be depricated. An AI told
me, so it must be true.

>>> Is there a problem with the module or is it just perceived as no longer
>>> required?

Two issues were cited:

1. It's too stable, bug-free, and feature-complete. IOW "no
activity". Apparently, people equate "activity" with "usage".

2. A problem with automated testing, since there's no server side
support. Though testing a module's client implementation by having
it talk to a module's server implementation seems like a
singularly bad idea.


>> See PEP 594: https://peps.python.org/pep-0594/
>
> Thanks Cameron.
> A scary list; I must have a dozen projects from the late 90s still
> live that are using many of these! I'm glad I'm retired and won't
> be the one who has to fix 'em :-)

It has been pointed out to me that Perl still has a supported NNTP
library. That stung. However, it's a CPAN module, which is more
equivalent to PyPI than to the standard library, so I guess that it
isn't as bad a loss of face as I feared.

--
Grant


--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
On 2023-05-16, Chris Green <cl@isbd.net> wrote:
> Grizzy Adams <RealGrizzlyAdams@vivaldi.net> wrote:
>> Tuesday, May 16, 2023 at 9:26, Alan Gauld wrote:
>> Re: What to use instead of nntplib? (at least in part)
>>
>> >On 15/05/2023 22:11, Grant Edwards wrote:
>> >> I got a nice warning today from the inews utility I use daily:
>> >>
>> >> DeprecationWarning: 'nntplib' is deprecated and slated for removal in Python 3.13
>> >>
>> >> What should I use in place of nntplib?
>>
>> >I'm curious as to why nntplib is deprecated? Surely there are still a
>> >lot of nntp servers around
>>
>> there must be this list is mirrored on one, and AFAICS some pythoners use that
>> way to post (over the list)
>
> Yes, me for one, a good newsreader is really a wonderful way to manage
> technical 'lists' like this one.

IMO, there's nothing better. Newsreaders were designed from the
beginning to deal with the sort of traffic and usage patterns seen in
mailing lists. Using an MUA (even combined with something like
procmail) and folders/labels is just a pale imitation of a good
newsreader.

> Usenet news is still very much alive though a minority interest now
> I suspect.

This list's decision to stop accepting postings via news.gmane.io is
what prompted me to write my own "inews" application in Python that
uses SMTP for some groups and NNTP for others when I "post" via slrn.

I probably use NNTP more to access mailing lists via gmane than I use
it for accessing the "real" Usenet groups.

NNTP is not just for Usenet...






--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
> > Yes, me for one, a good newsreader is really a wonderful way to manage
> > technical 'lists' like this one.
>
> IMO, there's nothing better. Newsreaders were designed from the
> beginning to deal with the sort of traffic and usage patterns seen in
> mailing lists. Using an MUA (even combined with something like
> procmail) and folders/labels is just a pale imitation of a good
> newsreader.
>
> > Usenet news is still very much alive though a minority interest now
> > I suspect.
>
> This list's decision to stop accepting postings via news.gmane.io is
> what prompted me to write my own "inews" application in Python that
> uses SMTP for some groups and NNTP for others when I "post" via slrn.
>
> I probably use NNTP more to access mailing lists via gmane than I use
> it for accessing the "real" Usenet groups.
>
> NNTP is not just for Usenet...


I asked this question in February and got the same response. But on
news.software.readers 16 May, Ted Heise posted a useful perl script.
I'm starting to think I'll move to Perl for Usenet posting; I have yet
to find a Python solution easy enough for this non-technical user.
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
> >> See PEP 594: https://peps.python.org/pep-0594/
> >
> > Thanks Cameron.
> > A scary list; I must have a dozen projects from the late 90s still
> > live that are using many of these! I'm glad I'm retired and won't
> > be the one who has to fix 'em :-)
>
> It has been pointed out to me that Perl still has a supported NNTP
> library. That stung. However, it's a CPAN module, which is more
> equivalent to PyPI than to the standard library, so I guess that it
> isn't as bad a loss of face as I feared.


I'm latching onto this thread just so I can bitch:

I always thought "Batteries included" was a great concept, a great
philosophy, a great slogan. It encouraged me to look into python
because they made the tools available for you to do just about anything
they want.

Who ever came up with "Removing dead batteries" as a slogan, when some
of those batteries still work perfectly well, needs to rethink it. Go
ahead and remove code that no longer works, OK. But removing
unpopular modules? That undercuts the entire philosophy of the
platform, in my opinion.
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
On 2023-05-21, Retrograde <fungus@amongus.com> wrote:

> Who ever came up with "Removing dead batteries" as a slogan, when
> some of those batteries still work perfectly well, needs to rethink
> it. Go ahead and remove code that no longer works, OK. But removing
> unpopular modules? That undercuts the entire philosophy of the
> platform, in my opinion.

And one of the metrics of "popularity" seems to be "activity"
(e.g. changes committed). For things that have been around for 20+
years and have all the features they need and all of the bugs fixed
(and are now very stable) that lack of "activity" is interpreted as
"unpopular" regardless of how many people are using the module.

--
Grant




--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
Grant Edwards <grant.b.edwards@gmail.com> writes:
> On 2023-05-21, Retrograde <fungus@amongus.com> wrote:
>> Who ever came up with "Removing dead batteries" as a slogan, when
>> some of those batteries still work perfectly well, needs to rethink
>> it. Go ahead and remove code that no longer works, OK. But removing
>> unpopular modules? That undercuts the entire philosophy of the
>> platform, in my opinion.
>
> And one of the metrics of "popularity" seems to be "activity"
> (e.g. changes committed). For things that have been around for 20+
> years and have all the features they need and all of the bugs fixed
> (and are now very stable) that lack of "activity" is interpreted as
> "unpopular" regardless of how many people are using the module.

My understanding is that nntplib isn't being erased from reality,
it's merely being removed from the set of modules that are provided
by default.

I presume that once it's removed from the core, it will still be
possible to install it via pip or some other mechanism.

You can disable the deprecation warning:

import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
import nntplib

If my understanding is correct, why is this such a big problem?

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
>
> My understanding is that nntplib isn't being erased from reality,
> it's merely being removed from the set of modules that are provided
> by default.
>
> I presume that once it's removed from the core, it will still be
> possible to install it via pip or some other mechanism.
>

It won't magically be available via pip unless someone steps up to maintain
it as a PyPI package

Skip

>
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
On 2023-05-22, Skip Montanaro <skip.montanaro@gmail.com> wrote:
>> My understanding is that nntplib isn't being erased from reality,
>> it's merely being removed from the set of modules that are provided
>> by default.
>>
>> I presume that once it's removed from the core, it will still be
>> possible to install it via pip or some other mechanism.
>
> It won't magically be available via pip unless someone steps up to maintain
> it as a PyPI package

That would appear to have already happened over a month ago.
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
On 2023-05-22, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

> My understanding is that nntplib isn't being erased from reality,
> it's merely being removed from the set of modules that are provided
> by default.
>
> I presume that once it's removed from the core, it will still be
> possible to install it via pip or some other mechanism.

If somebody rescues the code and puts it in Pypi (assuming the
copyright owner allows that). IIRC, somebody is trying to do that, but
there some contention because Pypi won't allow the use of the name
"nntplib" for the package because it conflicts with a library builtin.
>
> import warnings
> warnings.filterwarnings("ignore", category=DeprecationWarning)
> import nntplib

Yep, thanks. That at least prevents the warning from messing up my
slrn screen. :)

> If my understanding is correct, why is this such a big problem?

It's not a "big" problem, but something that "just worked" with any
Python installation now requires that the user install an extra
package. If they don't already have pip, then they have to install
that first. And then they have to do it again, because the first time
they installed pip for the wrong version of python. [.I don't really
get how that happens, but there seem to be a constant stream of
postings from people with that problem.]

--
Grant



--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
On 5/22/23 12:10, Grant Edwards wrote:
> On 2023-05-21, Retrograde <fungus@amongus.com> wrote:
>
>> Who ever came up with "Removing dead batteries" as a slogan, when
>> some of those batteries still work perfectly well, needs to rethink
>> it. Go ahead and remove code that no longer works, OK. But removing
>> unpopular modules? That undercuts the entire philosophy of the
>> platform, in my opinion.
>
> And one of the metrics of "popularity" seems to be "activity"
> (e.g. changes committed). For things that have been around for 20+
> years and have all the features they need and all of the bugs fixed
> (and are now very stable) that lack of "activity" is interpreted as
> "unpopular" regardless of how many people are using the module.
>
> --
> Grant
>


To add an additional bitching, I don't really ever see anyone discussing
the dynamics and downsides of github (and things like it). Or how things
like mozilla killing off usenet and mailing lists changes the entire
dynamic of who manages and gets a say in how technology gets to move
forward.

As someone who sees software independence and using free software as
moral imperatives, signing up for github and agreeing to yet another
terms of service is a no go for me, so moving to these platforms locks
me out from contributing. (and a lot of python packages have code that
also works with proprietary operating systems, so non-gnu/gnu hosting
isn't a solution either)

And as someone who uses usenet to post to this list (I object to the
google captcha on the mailing list sign up, and captchas in general), I
imagine eventually a discussion will take place in a place like github
that will do away with this avenue as well.

As far as modern commit dynamics,
Even if I did partake in the modern github style of code distribution,
how many packages have issues where the "maintainers" inherited the
package and really haven't dug deep enough in to the code to see how it
really works. They have issues that sit around for YEARS, and when
someone says "this sucks, this is broken and could be better", and the
githubian response is typically a dismissive "Nothing is stopping you
from making a PR".
Then when you get down to dedicating a month to polishing a PR to extend
or redesign something with the features you need, it just sits there,
for YEARS, because again, the authority that went in to the package in
the first place is often gone, and there is no one with that knowledge
to give the PR the review it deserves.
You end up with your fork, but it is lost, indistinguished from all the
other forks of nothing.

There are now probably dozens of nntplib preservation implementations
floating around, but how do you even consider which one to use? Without
some energy behind it, to be certain in what you are doing, each person
will practically have to download Python3.11 and extract it themselves,
and then either add it in to the latest version themselves, or
comparitively study it vs a collection of new implementations to see
which one feels most like a correct updated standard.
You also have to consider, is this a one off update? At 3.13 will I have
to do it all over again? (at that point, doing it yourself really does
become the only solution).

At the end of the day, what is there boils down to the influence of who
is offering the resources.. And I would say most of that today comes
from the microsofts and googles of the world that have no interest in
preserving the independent ethos of the early web..

I personally am partial to autonomous website distribution, and
mailmanv2 dev collaborations, so you can independently share modified
versions of packages or tutorials you've written for your own purposes,
and if they help others, great.. But I personally haven't found a place
that accepts small cash payments and feels neutral enough to fit my
needs and limited resources.

--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
On Wed, 31 May 2023 at 06:59, aapost <aapost@idontexist.club> wrote:
>
> To add an additional bitching, I don't really ever see anyone discussing
> the dynamics and downsides of github (and things like it). Or how things
> like mozilla killing off usenet and mailing lists changes the entire
> dynamic of who manages and gets a say in how technology gets to move
> forward.
>

I used to run my own mail server.

Now I don't.

Practicality beats purity.

To be quite frank, the moralistic approach of complaining about the
way other people are too happy to give control to big companies is
NEVER going to achieve anything. You're welcome to be a little island,
that one Gaulish village that still holds out against the invaders,
but all you'll actually be doing is sidelining yourself.

I'm not saying that this is a GOOD situation, but facts are facts, and
I use Chrome and GitHub and a wide variety of other tools that aren't
free.

ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
On 5/22/23 17:59, Grant Edwards wrote:
> On 2023-05-22, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
>
>> My understanding is that nntplib isn't being erased from reality,
>> it's merely being removed from the set of modules that are provided
>> by default.
>>
>> I presume that once it's removed from the core, it will still be
>> possible to install it via pip or some other mechanism.
>
> If somebody rescues the code and puts it in Pypi (assuming the
> copyright owner allows that). IIRC, somebody is trying to do that, but
> there some contention because Pypi won't allow the use of the name
> "nntplib" for the package because it conflicts with a library builtin.


well, it turns out that while there was a long debate about the merits,
the actual request to free up the previously blocked name on PyPI was
granted rather quickly, and it's there:

https://pypi.org/project/nntplib/



--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
>
> I used to run my own mail server.
>
> Now I don't.
>
> Practicality beats purity.
>
> To be quite frank, the moralistic approach of complaining about the
> way other people are too happy to give control to big companies is
> NEVER going to achieve anything. You're welcome to be a little island,
> that one Gaulish village that still holds out against the invaders,
> but all you'll actually be doing is sidelining yourself.
>
> I'm not saying that this is a GOOD situation, but facts are facts, and
> I use Chrome and GitHub and a wide variety of other tools that aren't
> free.
>
> ChrisA


Don't get me wrong, I know I have lost the battle in this age, lol. The
opening statement probably came off way less pragmatic than I intended
before writing it. The attempt to steer the ol' "bitching just to bitch"
toward more if a statement as to the fundamentals of why there is a
bitch and frustration with how things are didn't quite make it there.

But regardless my positions are correct, lol, you know the situation is
"NOT" GOOD, and you justify your compromises, as we tend to do to
whatever extent we decide that we can live with, and time tells how
those things play out.

For there to have been an elicited reaction to my statements sort of
goes against the statement "NEVER going to achieve anything".

I am fine in my cave, a lot of things seen as "facts are facts" tend to
change over time, and I don't see anyone else going anywhere that I need
to go.

--
https://mail.python.org/mailman/listinfo/python-list
Re: What to use instead of nntplib? [ In reply to ]
On 31/05/23 8:44 am, aapost wrote:
> Even if I did partake in the modern github style of code distribution,
> how many packages have issues where the "maintainers" inherited the
> package and really haven't dug deep enough in to the code to see how it
> really works. They have issues that sit around for YEARS, and when
> someone says "this sucks, this is broken and could be better", and the
> githubian response is typically a dismissive "Nothing is stopping you
> from making a PR".

Also, "nothing is stopping you from making a fork." Which is what
you would have to do in the face of inactive maintainers regardless
of where or how the project was hosted. This is not a github problem
or a big-corporation problem, it's a people problem.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list