Issue 1515609: Alternative fix for ImportWarning (fix for 1515169) - Python tracker
Python Home About News Documentation Downloads Community Foundation Developer's Guide Issue Tracker Issues Search Random Issue Summaries Issues with patch Easy issues Stats User Administration User List Committer List Help Tracker Documentation Tracker Development Report Tracker Problem Issue1515609 ➜ This issue tracker has been migrated to GitHub , and is currently read-only . For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on 2006-07-01 18:05 by sergeyli , last changed 2022-04-11 14:56 by admin . This issue is now closed . Messages (3) msg50577 - (view) Author: Sergey (sergeyli) Date: 2006-07-01 18:05 Similarly to http://www.python.org/sf/1515361 , tries to change the way ImportWarning behaves. The difference between tha patches is that this one does not try to produce a full list of all possible directories that have not been imported.
Instead, this patch only provides number of candidate directories found, and prints the first one, which hopefully is the most likely candidate. Full description follows. I tried to implement Jean-Paul Calderone's idea for the following patch, plagiarizing Ralf W. Grosse-Kunstleve's error text. It delays import warning until end of search for modules, but remembers how many potential modules (candidates without __init__.py) it didn't import.
I didn't really try to analyze any conditions, instead I simply assumed that wherever ImportWarning would be issued, we have a suitable candidate, and saved it on the stack. If nothing is found, Python emits ImportWarning right before ImportError, and explains what happened. msg50578 - (view) Author: Sergey (sergeyli) Date: 2006-07-01 18:11 Logged In: YES user_id=141494 This one also doesn't have the memory leak fix mentioned in python.org/sf/1515361. msg50579 - (view) Author: Neal Norwitz (nnorwitz) * Date: 2006-07-06 04:24 Logged In: YES user_id=33168 Thank you for the patch.
The decision was made to simply ignore the warning by default. There's nothing necessarily wrong with this patch, although I didn't review it. I'm closing because we are taking a different approach at this time. We will revisit the decision for 2.6. I hope you continue reading python-dev and help us fix this better for 2.6, whatever that may be. Perhaps this patch will be revived at that time. I have added a link to this patch in PEP 361 .
History Date User Action Args 2022-04-11 14:56:18 admin set github: 43593 2006-07-01 18:05:51 sergeyli create Supported by The Python Software Foundation , Powered by Roundup Copyright © 1990-2022, Python Software Foundation Legal Statements