Issue7301
Created on 2009-11-10 15:05 by barry, last changed 2010-04-14 21:04 by pjenvey.
|
msg95117 - (view) |
Author: Barry A. Warsaw (barry) |
Date: 2009-11-10 15:05 |
|
It would be very useful to have an environment variable $PYTHONWARNINGS,
tied to the -W option for silencing various warnings (most importantly,
DeprecationWarnings).
Use case: a test suite running many subprocesses, testing that those
subproc output is clean. DeprecationWarnings cannot easily be
suppressed by passing -W flags all around or using liberally sprinkled
filterwarnings(). Setting $PYTHONWARNINGS once and for all to silence
all processes would be very useful.
|
|
msg95200 - (view) |
Author: Brian Curtin (brian.curtin) * |
Date: 2009-11-13 21:15 |
|
I attached a patch against trunk r76237 which seems to cover this, sans
official tests. I looked around and didn't find a good place for
specifically testing environment variables. I could add test code in
test_warnings if that's the best place.
The patch allows multiple warnings to be passed to the environment
variable as a comma separated string, and works in conjunction with -W.
Let me know what you think.
|
|
msg95202 - (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2009-11-13 21:28 |
|
test_warnings is probably the best place since test_cmd_line ignores
environment variables
|
|
msg95210 - (view) |
Author: Brian Curtin (brian.curtin) * |
Date: 2009-11-13 22:10 |
|
Added a patch which includes tests in test_warnings. There are tests for
a single warning, two comma separated warnings, and one env var warning
and one command line warning at the same time.
|
|
msg97797 - (view) |
Author: Brian Curtin (brian.curtin) * |
Date: 2010-01-15 00:40 |
|
fixed a tab/space issue
|
|
msg98972 - (view) |
Author: Brian Curtin (brian.curtin) * |
Date: 2010-02-06 23:33 |
|
Updated patch, tests weren't working.
|
|
msg102504 - (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2010-04-06 23:03 |
|
Looks good to me. Updated patch with a couple whitespace changes
|
|
msg102505 - (view) |
Author: Barry A. Warsaw (barry) |
Date: 2010-04-06 23:14 |
|
Patch looks good to me too. Do any of you have commit privileges? If so, please commit this. If not assign the issue to me and I'll do it.
|
|
msg102515 - (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2010-04-07 04:06 |
|
applied in r79878 - r79881, thanks!
|
|
msg102520 - (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2010-04-07 06:31 |
|
I committed a somewhat different version of this patch to py3k to handle the warn options now calling for wchars, but this needs more work. Some of the buildbots are unhappy
Seems like the py3k version either needs to fully decode the env values to a unicode obj via the file system encoding (which I doubt is initialized at this point)/surrogateescape, or use something along the lines of char2wchar in python.c
|
|
msg102582 - (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2010-04-08 01:12 |
|
Here's a patch for py3k using the same char2wchar as the argv decoder for posix, and better windows handling. Plus an additional nonascii value test. Patch is against r79980 for clarity
|
|
msg102761 - (view) |
Author: Antoine Pitrou (pitrou) |
Date: 2010-04-10 02:24 |
|
The tests don't look good to me. You should use p.communicate() rather than p.stdout.read(). Also, check the error return code and raise an error if it's non-zero.
|
|
msg102887 - (view) |
Author: Stefan Krah (skrah) |
Date: 2010-04-11 21:00 |
|
The changes in main.c in r79881 don't look right:
strtok() is used on the string returned by getenv(), which must not
be modified.
Also (and this admittedly cosmetic), perhaps use a static buffer like
wchar_t warning[128] or use a single allocation before the for loop.
What is the maximum length for a single warning?
|
|
msg102888 - (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2010-04-11 21:10 |
|
The pending patch for py3k fixes the modification of the env value (trunk already has a fix for that).
That patch is also doing the conversion to wchar_t via the char2wchar function now, with that reusing a single buffer seems out of the question
|
|
msg103146 - (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2010-04-14 21:04 |
|
py3k should be taken care of as of r80066+r80075
|
|
| Date |
User |
Action |
Args |
| 2010-04-14 21:04:43 | pjenvey | set | status: open -> closed resolution: accepted -> fixed messages:
+ msg103146
|
| 2010-04-11 21:10:48 | pjenvey | set | messages:
+ msg102888 |
| 2010-04-11 21:00:24 | skrah | set | nosy:
+ skrah messages:
+ msg102887
|
| 2010-04-10 02:24:59 | pitrou | set | nosy:
+ pitrou messages:
+ msg102761
|
| 2010-04-08 01:12:10 | pjenvey | set | files:
+ issue7301-py3k.diff
messages:
+ msg102582 |
| 2010-04-07 06:31:02 | pjenvey | set | status: closed -> open assignee: pjenvey resolution: fixed -> accepted messages:
+ msg102520
|
| 2010-04-07 04:06:24 | pjenvey | set | status: open -> closed resolution: accepted -> fixed messages:
+ msg102515
|
| 2010-04-06 23:14:50 | barry | set | resolution: accepted messages:
+ msg102505 |
| 2010-04-06 23:03:17 | pjenvey | set | files:
+ issue7301-2.diff
messages:
+ msg102504 |
| 2010-02-06 23:33:39 | brian.curtin | set | files:
+ issue7301.diff
messages:
+ msg98972 |
| 2010-02-06 23:32:38 | brian.curtin | set | files:
- issue7301.diff |
| 2010-02-06 22:50:08 | eric.araujo | set | nosy:
+ eric.araujo
|
| 2010-01-15 00:40:51 | brian.curtin | set | files:
+ issue7301.diff
messages:
+ msg97797 |
| 2010-01-15 00:39:42 | brian.curtin | set | files:
- issue7301.patch |
| 2010-01-15 00:39:38 | brian.curtin | set | files:
- issue7301_v2.patch |
| 2010-01-13 02:08:33 | brian.curtin | set | priority: normal keywords:
+ needs review stage: patch review |
| 2009-11-13 22:10:20 | brian.curtin | set | files:
+ issue7301_v2.patch
messages:
+ msg95210 |
| 2009-11-13 21:28:40 | pjenvey | set | messages:
+ msg95202 |
| 2009-11-13 21:15:46 | brian.curtin | set | files:
+ issue7301.patch
nosy:
+ brian.curtin messages:
+ msg95200
keywords:
+ patch |
| 2009-11-10 23:58:46 | pjenvey | set | nosy:
+ pjenvey
|
| 2009-11-10 15:05:29 | barry | create | |
|