GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — 3.13 Regression: `inspect.getsource()` returns incorrect source code · Issue #122981 · python/cpython Closed Labels 3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportBug description:In Python 3.13rc1, $ docker run --rm python:3.13-rc python -c "import inspect, ssl; print(inspect.getsource(ssl.AlertDescription))" super().shutdown(how) This line is likely https://github.com/python/cpython/blob/v3.13.0rc1/Lib/ssl.py#L1334. In contrast, on 3.12 and below, this raises an OSError (not ideal but also not wrong): $ docker run --rm python:3.12-rc python -c "import inspect, ssl; print(inspect.getsource(ssl.AlertDescription))" Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib/python3.12/inspect.py", line 1285, in getsource lines, lnum = getsourcelines(object) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/inspect.py", line 1267, in getsourcelines lines, lnum = findsource(object) ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/inspect.py", line 1112, in findsource raise OSError('could not find class definition') OSError: could not find class definition I'm not sure why this is happening, but it also affects pytest.PytestAssertRewriteWarning and pluggy.PluggyTeardownRaisedWarning, which both extend custom classes that override CPython versions tested on:3.8, 3.9, 3.10, 3.11, 3.12, 3.13 Operating systems tested on:Linux Linked PRsActivity
MetadataMetadataAssigneesLabels3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error Projects
MilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |