Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compileall: update for py39 #3956

Merged
merged 3 commits into from
May 28, 2020
Merged

Conversation

hauntsaninja
Copy link
Collaborator

No description provided.

@@ -34,11 +40,29 @@ if sys.version_info >= (3, 7):
legacy: bool = ...,
optimize: int = ...,
invalidation_mode: Optional[PycInvalidationMode] = ...,
*,
stripdir: Optional[_Path] = ...,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must actually be a string because it does stripdir.split(os.path.sep)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, contradicts the documentation. I filed https://bugs.python.org/issue40447

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the bug probably won't be fixed very soon, can you just change the stub for now?

*,
stripdir: Optional[_Path] = ...,
prependdir: Optional[_Path] = ...,
limit_sl_dest: Optional[_Path] = ...,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But these two really can be PathLike

@hauntsaninja
Copy link
Collaborator Author

Updated the stub to reflect today's Python 3.9. Looking closer at this I think there are some issues here with _Path too. We can run into issues with bytes, since os.path.sep is a str + we probably need some typevars. Pretty surprising how explicit the documentation is, given how problematic that actual code is.

The stripdir, prependdir and limit_sl_dest arguments correspond to the -s, -p and -e options described above. They may be specified as str, bytes or os.PathLike.

@JelleZijlstra JelleZijlstra merged commit 2a13ba9 into python:master May 28, 2020
@hauntsaninja hauntsaninja deleted the compileall branch May 28, 2020 03:30
vishalkuo pushed a commit to vishalkuo/typeshed that referenced this pull request Jun 26, 2020
* compileall: add stripdir, prependdir and limit_sl_dest

* compileall: compile_dir's default value is now None

* compileall: update for current py39 (as of beta1)

Co-authored-by: hauntsaninja <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants