{"id":19248434,"url":"https://github.com/rocky/python-loctraceback","last_synced_at":"2026-03-09T17:16:50.116Z","repository":{"id":62576593,"uuid":"121656377","full_name":"rocky/python-loctraceback","owner":"rocky","description":"Python 3.6 API traceback module adding in fragment decomplation info for more precise location information","archived":false,"fork":false,"pushed_at":"2021-11-07T09:12:43.000Z","size":68,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-12T06:25:26.143Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rocky.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["rocky"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-02-15T17:04:59.000Z","updated_at":"2024-06-13T03:23:40.000Z","dependencies_parsed_at":"2022-11-03T19:08:00.284Z","dependency_job_id":null,"html_url":"https://github.com/rocky/python-loctraceback","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/rocky/python-loctraceback","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocky%2Fpython-loctraceback","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocky%2Fpython-loctraceback/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocky%2Fpython-loctraceback/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocky%2Fpython-loctraceback/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rocky","download_url":"https://codeload.github.com/rocky/python-loctraceback/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocky%2Fpython-loctraceback/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259762520,"owners_count":22907390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T18:07:52.517Z","updated_at":"2026-03-09T17:16:50.108Z","avatar_url":"https://github.com/rocky.png","language":"Python","funding_links":["https://github.com/sponsors/rocky"],"categories":[],"sub_categories":[],"readme":"|CI status| |PyPI Installs| |Supported Python Versions|\n\nloctraceback\n============\n\nWant to see more precisely where you are or were at in a traceback or\ncallstack your Python code has several places in a line it could have\nerrored? Even if the code was something created at runtime with say\n``eval`` or ``exec`` or if there was no source code that can be found?\n\nThen this package is for you.\n\nSome examples of the kinds of code this module can disambiguate:\n\n.. code-block:: python\n\n   i / j / k                              # which divide?\n   prev[prev[0]]                          # which prev ?\n   [e[0] for i in d[j] if got[i] == e[i]] # lots going on here\n   exec(some_code % 10, namespace)        # code at runtime\n\nSome example output given by running code in ``example``:\n\n\nDivision example:\n\n.. code-block:: python\n\n    Traceback (most recent call last):\n      File \"tb-div.py\", line 9, in \u003cmodule\u003e at offset 52\n        a / b / c\n        a / b / c\n          -\n    ZeroDivisionError: float division by zero\n\n\nList comprehension example:\n\n.. code-block:: python\n\n\n    File \"tb-comp.py\", line 9, in \u003clistcomp\u003e at offset 18\n        [e[0] for i in d[j] if got[i] == e[i]]\n    return [ e[0] for i in .0 if got[i] == e[i] ]\n                                 ------\n    IndexError: list index out of range\n\n`exec` example:\n\n.. code-block:: python\n\n    Traceback (most recent call last):\n     File \"tb-exec.py\", line 11, in \u003cmodule\u003e at offset 39\n        exec(s)\n        exec(s)\n        -------\n      File \"\u003cstring\u003e\", line 4, in \u003cmodule\u003e at offset 18\n      z = x / y\n            -\n      ZeroDivisionError: division by zero\n\nIsolating function in call stack example:\n\n.. code-block:: python\n\n      File \"call-fib.py\", line 8, in fib at offset 58\n        return fib(n-1) + fib(n-2)\n        return fib(n - 1) + fib(n - 2)\n                            ----------\n          File \"call-fib.py\", line 10, in \u003cmodule\u003e at offset 54\n               print(\"fib({})={}\".format(2, fib(2)))\n                                            ------\n\nThis modules extends the Python 3.6 API traceback module by adding in\nfragment decomplation info for more precise location information.\n\nAlthough the API is from Python 3.6, the code runs on 3.3 or greater.\nBack-porting to ther Python versions is left as an exercise to the\nreader.\n\nSee `these slides \u003chttp://rocky.github.io/pycon2018.co\u003e`_ for\ninformation on the technology behind this.\n\n\n.. |PyPI Installs| image:: https://pepy.tech/badge/loctraceback\n.. |Supported Python Versions| image:: https://img.shields.io/pypi/pyversions/loctraceback.svg\n.. |CI status| image:: https://github.com/rocky/python-loctraceback/workflows/loctraceback%20(ubuntu)/badge.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocky%2Fpython-loctraceback","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frocky%2Fpython-loctraceback","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocky%2Fpython-loctraceback/lists"}