Title: `inspect.{getsourcelines, findsource}` return 0 as the starting line number for modules · Issue #103319 · python/cpython · GitHub
Open Graph Title: `inspect.{getsourcelines, findsource}` return 0 as the starting line number for modules · Issue #103319 · python/cpython
X Title: `inspect.{getsourcelines, findsource}` return 0 as the starting line number for modules · Issue #103319 · python/cpython
Description: Bug report Run the following program import inspect import inspect _, lineno1 = inspect.getsourcelines(inspect.currentframe()) _, lineno2 = inspect.findsource(inspect.currentframe()) print(lineno1, lineno2) Expected Result The line numbe...
Open Graph Description: Bug report Run the following program import inspect import inspect _, lineno1 = inspect.getsourcelines(inspect.currentframe()) _, lineno2 = inspect.findsource(inspect.currentframe()) print(lineno1,...
X Description: Bug report Run the following program import inspect import inspect _, lineno1 = inspect.getsourcelines(inspect.currentframe()) _, lineno2 = inspect.findsource(inspect.currentframe()) print(lineno1,...
Opengraph URL: https://github.com/python/cpython/issues/103319
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`inspect.{getsourcelines, findsource}` return 0 as the starting line number for modules","articleBody":"# Bug report\r\n\r\nRun the following program\r\n```Python\r\nimport inspect\r\nimport inspect\r\n_, lineno1 = inspect.getsourcelines(inspect.currentframe())\r\n_, lineno2 = inspect.findsource(inspect.currentframe())\r\nprint(lineno1, lineno2)\r\n```\r\n\r\n**Expected Result**\r\nThe line numbers are expected to be 1-based, so the expected output is `1 1`.\r\n\r\n**Actual Result**\r\nThe actual output is `0 0`.\r\n\r\n\r\nRelated discussion: https://github.com/python/cpython/pull/103226\r\n\r\n# Your environment\r\n\r\n- CPython versions tested on: `main` branch\r\n- Operating system and architecture: macOS\r\n\r\n\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-103226\r\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/artemmukhin","@type":"Person","name":"artemmukhin"},"datePublished":"2023-04-06T19:02:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/103319/cpython/issues/103319"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:86ff713f-cfed-bb7f-2344-15d028aeb9fd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A50C:22F52E:2CA1353:3C00007:696AEF9D |
| html-safe-nonce | 377ad26aa5a6691615a8b144124daee557247d89925a27a089b4beff0b047296 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTBDOjIyRjUyRToyQ0ExMzUzOjNDMDAwMDc6Njk2QUVGOUQiLCJ2aXNpdG9yX2lkIjoiNTYyNTcwMzM1NjEyMjcyMjIwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e4ed1e1c55152534bc447a7e9a6559b32921171767d848a830d2996ec5dc8228 |
| hovercard-subject-tag | issue:1657906766 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/103319/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4b1e2353e47dbaf0f270bea60e02909de32a3788179f0bbb02bf6ea03c9ccea1/python/cpython/issues/103319 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4b1e2353e47dbaf0f270bea60e02909de32a3788179f0bbb02bf6ea03c9ccea1/python/cpython/issues/103319 |
| og:image:alt | Bug report Run the following program import inspect import inspect _, lineno1 = inspect.getsourcelines(inspect.currentframe()) _, lineno2 = inspect.findsource(inspect.currentframe()) print(lineno1,... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | artemmukhin |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width