Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.4k
bpo-32903: Fix a memory leak in os.chdir() on Windows#5801
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
izbyshev commentedFeb 22, 2018
Should I create a bug report for such simple fixes? |
zhangyangyu left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Makes sense. But I suggest removing the empty lines to keep code style consistent. And it's better toreturn True instead ofreturn result in UNC condition. Also, add a NEWs entry please.
GetCurrentDirectory() can't return non-normalized paths.
izbyshev commentedFeb 28, 2018
@zhangyangyu Thank you for reviewing! I've removed the empty lines and also realized that checking for
Do you mean that |
zhangyangyu commentedFeb 28, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@izbyshev , No, I mean before when it's a UNC path, |
izbyshev commentedFeb 28, 2018
Actually, there mustnever be any difference, otherwise it is a bug (if |
zhangyangyu commentedMar 1, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The function is declared to return |
izbyshev commentedMar 1, 2018
@zhangyangyu I totally misunderstood your point, sorry. I thought you were arguing that If you worry about somebody using |
zhangyangyu commentedMar 1, 2018
Don't change the signature plz. Just add another check to let it return |
izbyshev commentedMar 1, 2018
@zhangyangyu Done! |
zhangyangyu commentedMar 1, 2018
@izbyshev Seems you can't remove the check for And the code would be more explicit if you still use |
izbyshev commentedMar 1, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@zhangyangyu If you want to go deeper, the original |
izbyshev commentedMar 1, 2018
Regarding |
zhangyangyu commentedMar 1, 2018
Okay. But I would suggest changing the checks by a new issue if you are sure and asking our Windows gurus to decide, I really can't decide on that since I don't Windows :-(. Leave this issue only about the memory issue.
Why? if |
izbyshev commentedMar 1, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I wanted to take the opportunity to perform a minor cleanup by changing path checks since it doesn't distract from this small issue. But if you insist, I can revert the changes and use the original checks.
If you care about explicit code, the type of |
zhangyangyu commentedMar 1, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Sorry for much bikeshedding. But believe me it's not a good idea to do the cleanup in this issue. Feel free to open a new issue to push that. Of course, thanks for this contribution! |
izbyshev commentedMar 1, 2018
Thank you for reviewing. I don't think it's worth opening a new issue for cleanup since the checks are correct, they are just a bit less clean and optimal than they could be. |
miss-islington commentedMar 1, 2018
Thanks@izbyshev for the PR, and@zhangyangyu for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.6, 3.7. |
(cherry picked from commit3e197c7)Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
bedevere-bot commentedMar 1, 2018
GH-5945 is a backport of this pull request to the3.7 branch. |
miss-islington commentedMar 1, 2018
Sorry,@izbyshev and@zhangyangyu, I could not cleanly backport this to |
bedevere-bot commentedMar 1, 2018
GH-5946 is a backport of this pull request to the3.6 branch. |
(cherry picked from commit3e197c7)Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
bedevere-bot commentedMar 1, 2018
GH-5947 is a backport of this pull request to the2.7 branch. |
…python#5946)(cherry picked from commit3e197c7)Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
https://bugs.python.org/issue32903