[issue25521] optparse module does not emit DeprecationWarning

2020-04-29 Thread John Hagen


John Hagen  added the comment:

With PEP 594 (https://www.python.org/dev/peps/pep-0594/) in the pipeline, is it 
time that optparse correctly emits DeprecationWarnings?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2016-05-07 Thread John Hagen

John Hagen added the comment:

With 3.6.0a1 scheduled just around the corner, is there consensus about how to 
begin this?  I just signed the contributor agreement, so I should be able to 
try to help if we have a plan on how to divide the work.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2015-11-04 Thread John Hagen

John Hagen added the comment:

Is there any consensus on how to move forward with this?  I feel there are at 
least 4 options:

1) Do nothing.
Pro: No work.
Con: It feels misleading to the user since the docs clearly state it's 
deprecated.  Some users (especially new ones) may miss the fact they should 
really be using argparse.

2) Throw PendingDeprecationWarning from optparse, and simply suppress it where 
it's used.
Pro: Not as much work.  Users of optparse are properly notified.
Con: Kicks the can down the road for someone else to have to eventually 
port off of optparse.

3) Throw PendingDeprecationWarning from optparse and port stdlib modules to 
argparse.
Pro: Seems like the "purest" solution at least from what is indicated in 
docs that it will no longer be supported.  Users of optparse are properly 
notified.
Con: Most amount of work.  argparse has some bugs that need to be patched.

4) Some combination of 2) and 3) where some modules are suppressed and others 
are ported.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2015-11-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I vote for gradual porting stdlib modules and scripts to argparse and fixing 
found problems, but doesn't touch optparse right now. We have enough time 
before 3.6 feature freezing.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2015-11-04 Thread R. David Murray

R. David Murray added the comment:

I vote for (4): (2) with a helping of (3).  That is, add the warning, but don't 
try to port all the stdlib modules to argparse beforehand.  Those should be 
addressed one by one, as I mentioned in another issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2015-11-04 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

+1 with @serhiy.storchaka

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2015-11-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

And it looks there was a special decision to not deprecate optparse.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2015-11-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is a difference between optparse and other deprecated module. Other 
modules are deprecated if they are too buggy or bad-designed to be fixed and 
there are stable standard or third-party modules that provides similar 
functionality. But looking on a number of open issues for argparse it seems 
that optparse is more stable and has less bugs than more powerful argparse.

Having experience with converting many modules from optparse to argparse or 
reviewing converting patches, I can say that not always the conversion can be 
done without loss. For example there is a difference in formatting descriptions.

I think that optparse should be supported in the stdlib for very long time. -1 
for non-pending warning. Don’t have an opinion about pending warning.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2015-11-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

No, I have not more information. My supposition is based on indirect evidence 
in msg225052. I suppose there was more recent discussion in 2014.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2015-11-01 Thread R. David Murray

R. David Murray added the comment:

I can't remember the timing...was that PEP accepted before we made 
DeprecationWarnings off by default?  It sounds like it probably was, based on 
the phrasing.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2015-11-01 Thread R. David Murray

R. David Murray added the comment:

Oh, and as far as bugs because it is powerful...optparse has had time to have 
its bugs fixed, so having bugs in the newer features of argparse is not 
surprising, really.  We just need to get the fixes committed.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2015-11-01 Thread John Hagen

John Hagen added the comment:

@martin.panter My new patch fixes Lib/test_optparse.py by suppressing the 
warning like test_imp does as you suggested.

@serhiy.storchaka I don't have a strong preference that it be a 
DeprecationWarning vs. PendingDeprecationWarning since to me, both get the 
point across to the end-user to avoid it.  I do, however, feel that it is 
important raise some kind of warning since it seems clear from the docs that is 
deprecated.

In my new patch I changed the type of warning to a PendingDeprecationWarning, 
as there seems to be at least some notion that optparse is a special case.  I 
don't have a strong opinion about which type of deprecation warning is used.

My new patch works when test_optparse.py is run with -Werror on 3.6.0a0.

--
Added file: 
http://bugs.python.org/file40921/optparse_and_test_deprecationwarning.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2015-11-01 Thread John Hagen

Changes by John Hagen :


Removed file: http://bugs.python.org/file40913/optparse_deprecationwarning.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2015-11-01 Thread R. David Murray

R. David Murray added the comment:

My sense is that most of the open argparse bugs are *because* of the increased 
power (that is, they aren't, with a few exceptions, in the fundamental bits 
that optparse does as well).  And the issues are open because no one is 
maintaining that module, either :(.  There is one non-committer who has done a 
lot of work on the patches, we should probably evaluate offering him commit 
privileges.

That said, I don't have a strong opinion on the deprecation-or-not myself.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2015-11-01 Thread Martin Panter

Martin Panter added the comment:

Serhiy, do you have a link or more information about this decision? Looking 
around at previous discussions, this is what I found: limiting to pending 
deprecation: ; not 
bothering with any code warning: 
. But the PEP was 
never updated as suggested in that last thread.

FWIW I have never used optparse. I do find argparse useful, but having bugs due 
to being “powerful” is not necessarily a good thing.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2015-10-31 Thread Martin Panter

Martin Panter added the comment:

Under  it 
says “Importing optparse will issue a PendingDeprecationWarning” (not 
DeprecationWarning!), however even this does not appear to be the case. Maybe 
somebody forgot to do this, or maybe somebody decided not to do this; I dunno.

--
nosy: +martin.panter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2015-10-31 Thread John Hagen

John Hagen added the comment:

First time trying to contribute to the Python standard library.

I attached a patch that is modeled off the deprecated imp module.  The 
DeprecationWarning message is taken from the Python docs: 
https://docs.python.org/3/library/optparse.html

--
keywords: +patch
Added file: http://bugs.python.org/file40913/optparse_deprecationwarning.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2015-10-31 Thread R. David Murray

R. David Murray added the comment:

Whether someone decided not to do it originally or not, it is probably a good 
idea to do it (as a DeprecationWarning, IMO), if someone wants to propose a 
patch.  The module isn't receiving maintenance any longer.  (Not that it 
couldn't, but no one is motivated to do so.)

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25521] optparse module does not emit DeprecationWarning

2015-10-30 Thread John Hagen

New submission from John Hagen:

According to the Python docs, optparse has been deprecated since Python 3.2, 
but it does not emit a DeprecationWarning when imported Python 3.2+.

https://docs.python.org/3/library/optparse.html

PyCharm can uses these DeprecationWarnings to provide helpful alerts the user: 
https://youtrack.jetbrains.com/issue/PY-16589

--
components: Library (Lib)
messages: 253768
nosy: John Hagen
priority: normal
severity: normal
status: open
title: optparse module does not emit DeprecationWarning
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com