inducer / inducer/pudb

has trouble tracing importlib._bootstrap in python3.3

Open
#115 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
3.2k
Forks
245
Avg merge
13m
Merged PRs (30d)
5

Description

I'm doing an experiment with sys.path_hooks, and pudb is having trouble tracing through it.

pudb seems to fail to find the source for `/usr/lib/python3.3/importlib/_bootstrap.py`, which results in the variables windowlet being smashed to the left.

To reproduce:

``` sh
$ PYTHONPATH=dummypath python3.3 foo.py
```

`foo.py`:

``` python
from __future__ import print_function

class NoPathHook(object):
def __init__(self, syspath):
if syspath.endswith('/dummypath'):
pass
else:
raise ImportError

@staticmethod
def find_module(module):
if module == 'example_thingy_doesnt_exist':
import pudb.b

def register():
import sys
sys.path_hooks.insert(0, NoPathHook)
sys.path_importer_cache.clear()

def main():
register()
try:
import example_thingy_doesnt_exist
except ImportError as error:
if error.name == 'example_thingy_doesnt_exist':
pass
else:
raise

print('DONE')

if __name__ == '__main__':
exit(main())
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.