| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Not sure if a whatsnew entry should be added for 3.14. Is this a significant enough change? |
Sorry, something went wrong.
There was a problem hiding this comment.
Just some small nits. Maybe a test with a frozen module with some content or do we have no way to do it easily?
Sorry, something went wrong.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
The difficult part is to get the module global of it. It's not trivial to get the frame of a frozen module in linecache tests. However, after this, I'll polish pdb and I'll add more tests there to cover the real case. It's much easier (and practical) to do it in pdb. |
Sorry, something went wrong.
|
Hey @iritkatriel , do you mind taking a quick look at this? |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM, though I wouldn't backport this.
Sorry, something went wrong.
|
I don't plan to backport this. I think it's a new feature. Should we put something in the whatsnew entry? |
Sorry, something went wrong.
|
Might as well, in case someone is surprised by something. |
Sorry, something went wrong.
|
Not sure if my claim is entirely correct. There might be cases when __file__ is not available for frozen modules? |
Sorry, something went wrong.
|
I don't know. |
Sorry, something went wrong.
|
Okay I updated the documentation, which should clear things up a bit. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
When we try to get source lines for frozen modules with linecache.getlines(), it will be rejected because frozen modules have file names starting with <. However, we can deal with that case, if we have module_globals - we can read __file__ in module_globals to get the real file and read it.
pdb suffers from it when debugging frozen modules - list deals with it but stack entry and ll does not. I could fix it in pdb, but I think linecache could benefit from this change so it helps all users. This is also a pretty straighforward change, just convert the filename passed in to the actual file name and the rest is the same.