Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #75380
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'warnings': 0.04; 'jesse': 0.05; 'subject:Python': 0.06; 'assuming': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'record.': 0.09; 'sake': 0.09; 'subject:into': 0.09; 'unittest': 0.09; 'python': 0.11; 'jan': 0.12; 'fail,': 0.16; 'piotr': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:Convert': 0.16; 'subject:exception': 0.16; 'url:annotate': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'print': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'daniel': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; 'am,': 0.29; 'asked': 0.31; 'context,': 0.31; 'url:python': 0.33; 'possible.': 0.35; 'there': 0.35; 'really': 0.36; 'module.': 0.36; 'url:org': 0.36; 'turn': 0.37; 'being': 0.38; 'to:addr:python-list': 0.38; 'rather': 0.38; 'received:71': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'received:org': 0.40; 'called': 0.40; 'simply': 0.61; 'here': 0.66; 'believe': 0.68; '\xe2\x80\x93': 0.77; 'case?': 0.84; 'received:fios.verizon.net': 0.84; 'url:cpython': 0.84 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Terry Reedy <tjreedy@udel.edu> |
| Subject | Re: Convert Python 3 ResourceWarnings into exception |
| Date | Wed, 30 Jul 2014 15:50:42 -0400 |
| References | <loom.20140730T151414-276@post.gmane.org> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | quoted-printable |
| X-Gmane-NNTP-Posting-Host | pool-71-175-90-87.phlapa.fios.verizon.net |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
| In-Reply-To | <loom.20140730T151414-276@post.gmane.org> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.12441.1406749861.18130.python-list@python.org> (permalink) |
| Lines | 30 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1406749861 news.xs4all.nl 2846 [2001:888:2000:d::a6]:52996 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:75380 |
Show key headers only | View raw
On 7/30/2014 9:24 AM, Piotr Dobrogost wrote: > Hi! > > Recently A. Jesse Jiryu Davis asked at Stackoverflow > (http://stackoverflow.com/q/24717027/95735) if there is "a way to force a > Python 3 unittest to fail, rather than simply print a warning to stderr, if > it causes any ResourceWarning?" Daniel Harding, in the accepted answer, > states it's not possible. > > Is it really the case? > > For sake of context, here I believe is the place, where > PyErr_WriteUnraisable is being called in this case – > http://hg.python.org/cpython/annotate/c0e311e010fc/Modules/socketmodule.c#l3857 python -W error ... "Raise an exception instead of printing a warning message." You can also turn this on with the warnings module. Assuming that this works for ResourceWarning, which is should, please correct the SO record. -- Terry Jan Reedy
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Convert Python 3 ResourceWarnings into exception Terry Reedy <tjreedy@udel.edu> - 2014-07-30 15:50 -0400
csiph-web