[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-08-02 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Unfortunately, this PR has broken test_inspect when executed with -R, see: https://bugs.python.org/issue44808 -- nosy: +pablogsal ___ Python tracker

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-30 Thread Jason R. Coombs
Change by Jason R. Coombs : -- nosy: +jaraco nosy_count: 6.0 -> 7.0 pull_requests: +26014 pull_request: https://github.com/python/cpython/pull/27436 ___ Python tracker ___

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-30 Thread Filipe Laíns
Change by Filipe Laíns : -- nosy: +FFY00 nosy_count: 5.0 -> 6.0 pull_requests: +26013 pull_request: https://github.com/python/cpython/pull/27484 ___ Python tracker ___

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-30 Thread Łukasz Langa
Łukasz Langa added the comment: Thanks, Andrei! ✨  ✨ -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-30 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset f468ede4a2b7ab5c72ae85ab04cb56904300cd23 by Miss Islington (bot) in branch '3.10': bpo-44648: Fix error type in inspect.getsource() in interactive session (GH-27171) (GH-27495)

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-30 Thread Othmane EL BOURI
Othmane EL BOURI added the comment: ince this is an exception type change, I'd feel more comfortable leaving 3.9 out of the backports here. That way it will be easier for application authors to differentiate between when the change was introduced or not. -- nosy: +othmaneelbouri1

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-30 Thread Łukasz Langa
Change by Łukasz Langa : -- versions: -Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-30 Thread Łukasz Langa
Łukasz Langa added the comment: Since this is an exception type change, I'd feel more comfortable leaving 3.9 out of the backports here. That way it will be easier for application authors to differentiate between when the change was introduced or not. --

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-30 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26011 pull_request: https://github.com/python/cpython/pull/27495 ___ Python tracker

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-30 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 48a62559dfaf775e4f1cc56b19379c799e8e2587 by andrei kulakov in branch 'main': bpo-44648: Fix error type in inspect.getsource() in interactive session (GH-27171) https://github.com/python/cpython/commit/48a62559dfaf775e4f1cc56b19379c799e8e2587

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-16 Thread Andrei Kulakov
Andrei Kulakov added the comment: This is kind of interesting: - The unit test was wrong, it was catching the wrong OSError. (I was catching regex first but after some tweaking and changes I lost it and forgot to readd) - The reason it was passing is exactly what you pointed out -- the

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-16 Thread Andrei Kulakov
Andrei Kulakov added the comment: I'm not sure though how is the unit test succeeding since the test module should have __file__ set. Looking into it.. -- ___ Python tracker

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-16 Thread Andrei Kulakov
Andrei Kulakov added the comment: Łukasz: Thanks for looking at this! - I agree OSError is not ideal, but I chose it because it's consistent with how inspect reports similar errors. For example, see all instances of OSError, except for first, in this function:

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-16 Thread Łukasz Langa
Łukasz Langa added the comment: Why do you think OSError fits here? Since objects provided on the command line by definition cannot have source code files, the problem isn't that the file is missing or inaccessible. Rather, the value provided to getsource() is wrong. So, in my view, this

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-16 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-15 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch pull_requests: +25708 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27171 ___ Python tracker ___

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-15 Thread Andrei Kulakov
New submission from Andrei Kulakov : [ins] In [63]: class A:pass [ins] In [64]: import inspect [ins] In [65]: inspect.getsource(A) [snip] /usr/local/Cellar/python@3.9/3.9.1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/inspect.py in getfile(object) 664 if

[issue44648] Inspect.getsource raises wrong error on classes in interactive session

2021-07-15 Thread Andrei Kulakov
Change by Andrei Kulakov : -- versions: +Python 3.10, Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list