msg277522 - (view) |
Author: Roy Williams (Roy Williams) * |
Date: 2016-09-27 16:24 |
I'm finding the `-3` flag to be super useful, but it's quite a huge pain to thread it through all of the places that spawn python subprocesses, sometimes requiring forking of third party code. This would be much simpler if, like PYTHONWARNINGS, Py_Py3kWarningFlag could be specified as an environment variable. |
|
|
msg277562 - (view) |
Author: Brett Cannon (brett.cannon) *  |
Date: 2016-09-27 22:40 |
The idea seems reasonable to me. I would think this would fall under the -3 exemption if others agree this is reasonable to implement. |
|
|
msg277564 - (view) |
Author: Berker Peksag (berker.peksag) *  |
Date: 2016-09-27 23:26 |
+1 from me. This would help people to port their projects to Python 3. |
|
|
msg277579 - (view) |
Author: Roy Williams (Roy Williams) * |
Date: 2016-09-28 04:26 |
@Brett @Berker In a similar vein, it'd be great to expose the `-b` flag in Python 3 in a similar manner to test for invalid byte comparisons. |
|
|
msg277605 - (view) |
Author: Marc-Andre Lemburg (lemburg) *  |
Date: 2016-09-28 10:24 |
+1, but I'd name the env var PYTHON3WARNINGS. Who knows, when Python 4 comes around the corner, we may need a PYTHON4WARNINGS... |
|
|
msg277759 - (view) |
Author: Roy Williams (Roy Williams) * |
Date: 2016-09-30 16:09 |
Thanks for your support! Here's a patch to enable the `PYTHON3WARNINGS` environment variable. |
|
|
msg277790 - (view) |
Author: Berker Peksag (berker.peksag) *  |
Date: 2016-10-01 02:34 |
Thanks for the patch. I left some comments on Rietveld. |
|
|
msg278000 - (view) |
Author: Roy Williams (Roy Williams) * |
Date: 2016-10-03 20:57 |
Thanks for the feedback Berker. I addressed your feedback, but unfortunately I get a 500 from Rietveld when I try to attach a new patchset. I've uploaded the new patchset here. |
|
|
msg278010 - (view) |
Author: Berker Peksag (berker.peksag) *  |
Date: 2016-10-04 05:47 |
Thanks for the new patch. > I've uploaded the new patchset here. We don't directly upload patches to Rietveld so you did the right thing :) See https://docs.python.org/devguide/patch.html for details. Can you also add a note about this new variable to Doc/howto/pyporting.rst? |
|
|
msg278095 - (view) |
Author: Roy Williams (Roy Williams) * |
Date: 2016-10-05 00:08 |
Thanks for the feedback Berker! This is my first CPython patch :D. Added in a note in pyporting. I actually did a much more detailed write up here https://gist.github.com/rowillia/c0feed97c1863b2d8e5a3ed73712df65, but it seems a bit verbose for this document. |
|
|
msg281732 - (view) |
Author: Berker Peksag (berker.peksag) *  |
Date: 2016-11-25 17:13 |
Roy's patch looks good to me in general. Benjamin, as the RM of 2.7, do you have any objections? |
|
|
msg281737 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-11-25 20:09 |
PYTHON3WARNINGS looks as Python 3 variant of PYTHONWARNINGS. |
|
|
msg281757 - (view) |
Author: Benjamin Peterson (benjamin.peterson) *  |
Date: 2016-11-26 07:25 |
Yes, I suppose this falls under the general exemption in 2.x for -3 warning changes. On Fri, Nov 25, 2016, at 09:13, Berker Peksag wrote: > > Berker Peksag added the comment: > > Roy's patch looks good to me in general. Benjamin, as the RM of 2.7, do > you have any objections? > > ---------- > nosy: +benjamin.peterson > > _______________________________________ > Python tracker <report@bugs.python.org> > <http://bugs.python.org/issue28288> > _______________________________________ |
|
|
msg281890 - (view) |
Author: Berker Peksag (berker.peksag) *  |
Date: 2016-11-28 17:00 |
> PYTHON3WARNINGS looks as Python 3 variant of PYTHONWARNINGS. Sadly, I can't think of a better name. Do you have a suggestion? > Yes, I suppose this falls under the general exemption in 2.x for -3 warning changes. Thanks, Benjamin! |
|
|
msg281898 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-11-28 17:21 |
What about PYTHON_OPT and allowing to pass any options via an environment variable? There is a number of precedences (gzip, less, etc). export PYTHON_OPT="-t -b -3" Or PYTHON3COMP[ATIBILITY]? |
|
|
msg281900 - (view) |
Author: Roy Williams (Roy Williams) * |
Date: 2016-11-28 17:35 |
> What about PYTHON_OPT and allowing to pass any options via an environment > > variable? There is a number of precedences (gzip, less, etc). > > export PYTHON_OPT="-t -b -3" I'd be open to this, but it seems like a much wider change than something that I'd have time to build in time for Python 2.7.12. I agree that this is a better long term direction (similarly, I'd like to enable the `-bb` flag in Python 3). I'd have to put a bunch of thought into how this would merge with command line flags. > Or PYTHON3COMP[ATIBILITY]? I'm open to whichever. lemburg had suggested `PYTHON3WARNINGS` so that's what I went with. If that's a blocker for this patch happy to change it. |
|
|
msg281903 - (view) |
Author: Brett Cannon (brett.cannon) *  |
Date: 2016-11-28 18:09 |
I agree with Roy: while PYTHON_OPT might be nice long-term, I think that scopes it beyond a py3k change in Python 2.7 and into new feature territory. As for a better name, PY3KWARNINGS is also possible and minimizes typo issues if that's what people are worried about. |
|
|
msg281904 - (view) |
Author: Brett Cannon (brett.cannon) *  |
Date: 2016-11-28 18:17 |
Benjamin just announced 2.7.13rc1 is going to be Dec 3, so this patch needs to land before then if it's going to make it in the next release. |
|
|
msg281905 - (view) |
Author: Berker Peksag (berker.peksag) *  |
Date: 2016-11-28 18:31 |
I can commit the patch this week if there are no objections to the name of the variable. I like Brett's PY3KWARNINGS suggestion, but I'm fine with either of the suggested names. |
|
|
msg382162 - (view) |
Author: Irit Katriel (iritkatriel) *  |
Date: 2020-11-30 16:54 |
It's too late for the PYTHON3WARNINGS variable in 2.7, but Serhiy's suggestion for PYTHON_OPTS can still be implemented. Updating title and version accordingly. |
|
|