pyinstaller / pyinstaller/pyinstaller

Rework and comment the test-cases for pkgutil.extend_path()

Open
#1,462 0 comments 0 reactions 1 assignee View on GitHub

@htgoebel is already working on this.

Since Sep 5, 2015.

@low / cleanup area:test-suite
Dominant language
Python
Stars
13.1k
Forks
2k
Avg merge
1d 3h
Merged PRs (30d)
11

Description

This is a follow up to #1283 (see https://github.com/pyinstaller/pyinstaller/issues/1283#issuecomment-131061632).

The python3-branch supports pkgutil.extend_path(). But the test-cases (import/test_nspkg3*.py).work only "basically", because pkgutil.extend_path() behaves different from the other namespace-techniques if zipped eggs are involved. And this is the case in the current test-case. So we need to rework and comment the test-cases.

One thing we need to keep in mind for the test-cases (from pydoc pkgutil.extend_path):

Items of sys.path that are not (unicode or 8-bit) strings referring to existing directories are ignored

This has another implication: Any a zipped egg (even if using pkgutil.extend_path()) will be kicked out of the namespace's __path__, as soon as there is another packages for this namespace in sys.path which is using pkgutil.extend_path()

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.