GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||
GeezerVison is showing github.com — Fix shutil.make_archive stub by jpy-git · Pull Request #6868 · python/typeshed Conversation
|
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm a bit uneasy about this series of PRs figuring out exactly where in shutil bytes paths can go through; it feels like we're codifying implementation details that could easily change without warning. It may be worth asking the CPython developers who own shutil whether they think bytes paths should generally be accepted. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Serhiy Storchaka has recently been doing some work on shutil (e.g. https://bugs.python.org/issue46245); he might be interested. Sending an email to python-dev is also an option. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Oh oops, merged one of these PRs before seeing this discussion. I'm still in favour of merging if this was discovered while actually type checking real world code. In general, typeshed is happy to reflect people's reliance on implementation details, since it reduces false positives. Either way, would be good to hear from CPython devs. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
That makes sense in general, but the discussion on #6832 especially gives me pause. In that case, bytes paths only work in some specific circumstances where we happen to avoid the codepaths that require str paths. If the rest of the module is anything like that, allowing bytes paths is going to be a magnet for subtle bugs, and we'd be doing users a service by flagging it in the type checker. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
See also #6869, where |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I filed https://bugs.python.org/issue46727 to discuss this over at BPO. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I am going to close this for now. While we usually prefer to follow the implementation, bytes paths working seems more of an accident and could stop working when the code is refactored or changed. We can revisit this if the bpo discussion turns out differently. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.