Update os.path module to use file descriptor where possible#1680
Update os.path module to use file descriptor where possible#1680mkurek wants to merge 1 commit intopython:masterfrom
Conversation
|
(The Travis failure is due to a mypy change. I'll submit a typeshed PR to fix it, but you may end up having to rebase this PR.) |
This is causing typeshed's build to fail (e.g. python/typeshed#1680). Followup from #4130.
|
@JelleZijlstra sure, thanks! |
This is causing typeshed's build to fail (e.g. python/typeshed#1680). Followup from #4130.
Fix python#1653 Use `_FdOrPathType` when possible in `os.path` module.
|
Fixed now (just needed to restart the build). |
|
Is it documented that these accept fds? They're not in Looking at the code for |
|
@JelleZijlstra I wasn't aware of So what do you suggest? If you like, I could prepare some pull requests to update cpython, either adding these functions to |
|
My position is that if it isn't documented it's not intentional.
|
|
I agree, so filing a ticket with CPython to clarify whether this behavior is intentional sounds like the right approach. |
|
Ok, I've created ticket to CPython to clarify this: https://bugs.python.org/issue31871 |
This is causing typeshed's build to fail (e.g. python/typeshed#1680). Followup from #4130.
|
Serhiy's response on bugs.python.org suggests that the fact that these functions support fd arguments in some platforms is unintentional. Therefore, I'm inclined to not support fd arguments in typeshed. |
|
Agreed.
|
Fix #1653
Use
_FdOrPathTypewhen possible inos.pathmodule.