WIP: bpo-36021: WindowsDefault does not execute os.startfile() for a local file by matrixise · Pull Request #11931 · python/cpython
matrixise
changed the title
bpo-36021: WindowsDefault does not execute os.startfile() for a local file
WIP: bpo-36021: WindowsDefault does not execute os.startfile() for a local file
Have you tried to implement three cases instead of two:
- file://
- whitelisted schemes
- other cases
It may make the intention more readable, by removing - set(['file', '']) and if parsed_url.scheme == 'file'.
?
Also I'm not sure about the behavior of os.access(path, os.X_OK) in windows. Do os.startfile executes a .exe file that is not marked X_OK? (Not a Windows user here).
@JulienPalard
file:// is already tested with file:///tmp/test.txt
for the whitelisted schemes, you have an example with https://
about os.access(path, os.X_OK), after a small check on a Windows VM, it's not portable :/ I use an other solution in my last commit (I read the binary file and read the two first bytes == b'MZ')
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.
Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.
@JulienPalard yep, still WIP because we have a discussion about the solution on the bug tracker.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters