[issue1218234] inspect.getsource doesn't update when a module is reloaded
Roundup Robot added the comment: New changeset 8e2505d535c8 by Yury Selivanov in branch 'default': inspect: Fix getsource() to load updated source of reloaded module https://hg.python.org/cpython/rev/8e2505d535c8 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Changes by Yury Selivanov yseliva...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Yury Selivanov added the comment: Fixed in 3.5. Not sure if we need to backport this to 3.4 and 2.7. Closing this issue. Thanks to Björn Lindqvist and Berker Peksag! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Jason R. Coombs added the comment: FWIW, I'd appreciate a backport to 3.4, given that 3.5 is scheduled for release in Sep 2015. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Changes by Berker Peksag berker.pek...@gmail.com: -- stage: patch review - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Roundup Robot added the comment: New changeset e52d8e888df1 by Yury Selivanov in branch '3.4': inspect: Fix getsource() to load updated source of reloaded module https://hg.python.org/cpython/rev/e52d8e888df1 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Yury Selivanov added the comment: @Jason: done ;) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Yury Selivanov added the comment: Thanks, I'll take a look at the patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
R. David Murray added the comment: Note that there has never been a strict correspondence between linecache/getsource, the module in memory, and the code on disk. If the file is changed before a traceback is generated, for example, you will get the new source. That doesn't mean fixing the reload case is wrong, it's just something to keep in mind. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Jason R. Coombs added the comment: This issue appears implicated in https://bitbucket.org/pypa/setuptools/issue/201 -- nosy: +jason.coombs ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Changes by Jean-Paul Calderone jean-p...@hybridcluster.com: -- nosy: -exarkun ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +yselivanov versions: +Python 3.5 -Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Changes by Mark Lawrence breamore...@yahoo.co.uk: -- nosy: -BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Changes by Berker Peksag berker.pek...@gmail.com: -- versions: +Python 3.3, Python 3.4 -Python 3.1 Added file: http://bugs.python.org/file28272/issue1218234.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Jean-Paul Calderone exar...@twistedmatrix.com added the comment: Calling linecache.checkcache for every inspect.getsource call sounds like a fairly bad idea to me. linecache.checkcache does a stat() of every single cached file. -- nosy: +exarkun ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Jean-Paul Calderone exar...@twistedmatrix.com added the comment: linecache.checkcache does a stat() of every single cached file. Ah, sorry. I didn't read carefully enough. I see that the patch passes in the filename and checkcache restricts the work it does in that case. Something else to consider, though, is that this change means you'll also get the new source if you *don't* reload the module, too. So, what exactly is inspect.getsource() supposed to be doing? Giving you the current on-disk contents of the relevant source file? Or giving you the actual source corresponding to the object passed to it? If the latter, then this actually needs to be more tightly integrated with module reloading somehow. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Daniel Diniz aja...@gmail.com added the comment: Fix was committed to py3k but with no tests AFAIK. Here's a (failing) test for trunk that runs OK after Guilherme's patch. We might want to keep this behavior restricted for when the module was reloaded. -- keywords: +patch nosy: +ajaksu2 stage: - patch review type: - behavior versions: +Python 2.6, Python 3.0 -Python 2.5 Added file: http://bugs.python.org/file13775/test_inspect-trunk.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Changes by Daniel Diniz aja...@gmail.com: Added file: http://bugs.python.org/file13776/test_inspect-py3k.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Daniel Diniz aja...@gmail.com added the comment: Er, no, it wasn't committed to py3k, it was just me getting my patches mixed. Attaching the py3k test with relative import fixed. -- Added file: http://bugs.python.org/file13778/test_inspect-py3k2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Changes by Daniel Diniz aja...@gmail.com: Removed file: http://bugs.python.org/file13776/test_inspect-py3k.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1218234 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1218234] inspect.getsource doesn't update when a module is reloaded
Guilherme Polo added the comment: I'm attaching a patch. Is there some hidden problem that it may cause ? By the way, this issue is a duplicate of http://bugs.python.org/issue993580 -- nosy: +gpolo Added file: http://bugs.python.org/file9382/inspect.py.diff _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1218234 _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com