[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-08-03 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 62033490ca0f by Nick Coghlan in branch 'default':
Close #15486: Simplify the mechanism used to remove importlib frames from 
tracebacks when they just introduce irrelevant noise
http://hg.python.org/cpython/rev/62033490ca0f

--
nosy: +python-dev
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-30 Thread Nick Coghlan

Nick Coghlan added the comment:

OK, after a bit of experimentation, it appears both 3.2 and 3.3 eventually get 
annoyed if you mess about too much with __pycache__.

1. They're both fine if __pycache__ is entirely unwritable (they just silently 
skip caching the bytecode)

2. 3.2 throws EOFError if you replace the cache entry with an empty file, 3.3 
silently rewrites it with a valid cached version

3. 3.2 throws EOFError if you replace the cache entry with a directory, 3.3 
throws a more accurate IsADirectory error

That means my chosen test case is a valid one, and I can just update the 
offending call in importlib._bootrap to use the new frame stripping hook as I 
originally planned.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-30 Thread Nick Coghlan

Nick Coghlan added the comment:

Looking at the actual code - I don't think it actually makes sense to strip the 
frames in this case. Unlike the previous examples, it only comes up if someone 
is doing something deliberately pathological, at which point a little noise in 
the traceback is the least of your worries.

Updated patch just drops that test case entirely and only has the changes that 
simplify the frame removal code. Since Georg isn't on IRC right now, assigning 
him to decide if he wants this version in beta 2 rather than the current 
multiple exit points approach.

--
assignee:  - georg.brandl
Added file: 
http://bugs.python.org/file26597/issue15486_simplify_importlib_frame_removal_no_new_test.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-30 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


Removed file: 
http://bugs.python.org/file26573/issue15486_simplify_importlib_frame_removal.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-30 Thread Georg Brandl

Georg Brandl added the comment:

Looks good and simplifies things.  Green light :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-30 Thread Eric Snow

Eric Snow added the comment:

patch LGTM.  Nice and clean.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-30 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-29 Thread Nick Coghlan

Nick Coghlan added the comment:

In trying to find a new case that wasn't already covered by the test suite, I 
found an error which I'm not even sure should be an error. Doesn't 3.2 suppress 
failures that occur when attempting to implicitly cache the .pyc?

Anyway, given the rest of the patch, trimming this traceback will be easy if we 
decide that's the right thing to do.

--
components: +Interpreter Core, Library (Lib)
keywords: +patch
nosy: +amaury.forgeotdarc, brett.cannon, eric.snow, georg.brandl
priority: normal - release blocker
stage:  - patch review
title: Standardise the mechanisms for stripping importlib frames - 
Standardised mechanism for stripping importlib frames from tracebacks
type:  - behavior
versions: +Python 3.3
Added file: 
http://bugs.python.org/file26573/issue15486_simplify_importlib_frame_removal.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-29 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-29 Thread Chris Jerdonek

Chris Jerdonek added the comment:

The test cases uploaded to issue 7559 (TestLoader.loadTestsFromName swallows 
import errors) a while back contain a number of distinct cases (four, I think) 
in which an import error can be raised.  IIRC, these include a couple recursive 
scenarios (cyclical import from within __init__.py, etc).

Those test cases were designed specifically to cover different scenarios in 
which unittest's loader was swallowing import errors.  Might be worth taking a 
look.

--
nosy: +cjerdonek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This is an elegant solution, +1 from me.

--
nosy: +pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-29 Thread Meador Inge

Changes by Meador Inge mead...@gmail.com:


--
nosy: +meador.inge

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

That said, given the nature of the patch (a cleanup without any functional 
impact), I don't think it should be a release blocker.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15486] Standardised mechanism for stripping importlib frames from tracebacks

2012-07-29 Thread Nick Coghlan

Nick Coghlan added the comment:

The release blocker status comes from the test case I added in order to 
demonstrate the ability to strip a new frame sequence without needing to modify 
the C code.

Currently that test (failing to write the PYC file) fails with an IsADirectory 
traceback that includes a lot of importlib frames.

There are two possible solutions:
- redirect the affected call through _call_with_frames_removed but otherwise 
leave the failure intact
- change it so this particular case isn't a fatal error

I need to check if failing to write the .pyc was a fatal error in 3.2 before I 
decide how to fix it (unless someone else remembers off the top of their head)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15486
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com