ipython / ipython/ipynb

__package__ = None

Đang mở
#39 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Jupyter Notebook
Star
258
Fork
71
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi,

I found that under certain circumstances `__package__` is not defined and hence FSFinder has no package_prefix set. This leads to an error when trying to import a notebook.

Can it be that this is because `__package__` is expected to be the same as __spec__.parent beginning with Python 3.6?
https://docs.python.org/3/reference/import.html#__package__

Anyway, relying on `__package__` seems to be a risk.

Best,
Jens Henrik

---------------------
```
...python3.6/site-packages/ipynb-0.5.1-py3.6.egg/ipynb/fs/finder.py in find_spec(self=, fullname='ipynb.fs.full.job_submit', path=['...site-packages/ipynb-0.5.1-py3.6.egg/ipynb/fs/full'], target=None)
41 Claims modules that are under ipynb.fs
42 """
---> 43 if fullname.startswith(self.package_prefix):
fullname.startswith =
self.package_prefix = None
44 for path in self._get_paths(fullname):
45 if os.path.exists(path):

TypeError: startswith first arg must be str or a tuple of str, not NoneType
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.