[issue25998] doctest crashes when accessing __wrapped__ fails other than AttributeError

2016-01-02 Thread Lasse Schuirmann

New submission from Lasse Schuirmann:

You can see this when importing the Flask `request` object in a file that is 
doctested. The `request` object will throw a RuntimeError when one tries to 
access any attribute. Doctest tries to `inspect.unwrap` all objects in the file 
in order to find out if they're doctestable functions - and apparently only 
catches the `AttributeError` exception. Thus it crashes :)

--
components: Tests
files: shell
messages: 257378
nosy: Lasse Schuirmann
priority: normal
severity: normal
status: open
title: doctest crashes when accessing __wrapped__ fails other than 
AttributeError
type: crash
versions: Python 3.5
Added file: http://bugs.python.org/file41477/shell

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



[issue25998] doctest crashes when accessing __wrapped__ fails other than AttributeError

2016-01-02 Thread Lasse Schuirmann

Lasse Schuirmann added the comment:

(Closed) issue at the flask repository of this: 
https://github.com/mitsuhiko/flask/issues/1680

Also IIRC this worked back with Python 3.4 but do not consider this a fact yet. 
(At least the tests ran on Fedora...)

--

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



[issue25998] doctest crashes when accessing __wrapped__ fails other than AttributeError

2016-01-04 Thread Lasse Schuirmann

Lasse Schuirmann added the comment:

Sorry for giving it the wrong category.

I personally think both projects should solve this. IMO it would be nice if 
doctest is robust against modules that for some reason (be they ill designed or 
not; I guess if you search a lot you find a project that needs to raise a 
custom exception when accessing `__wrapped__`). At the same time I do think the 
Flask request object could handle this better but lack the ability to explain 
that to them with substantial reasoning.

The problem is that both of you don't want to solve this problem at their side, 
@steven.daprano, would you mind speaking with the Flask people directly? I'm 
not affiliated to them.

--

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