Skip to content

fix for extra back slashes for windows UNC paths #1044

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

Closed
wants to merge 2 commits into from

Conversation

HudsonMC16
Copy link

This is to address UNC paths breaking, as discussed in issue #1019

Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

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

Thanks a lot for giving it a go. While looking at it, I came up with a concern that we could talk about before merging.

@@ -419,6 +419,8 @@ def string_decode(v):
optval = string_decode(optval[1:])
# end handle multi-line
# preserves multiple values for duplicate optnames
# fix for extra back slashes so windows UNC paths are not mangled
optval = optval.replace('\\\\', '\\')
Copy link
Member

Choose a reason for hiding this comment

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

Have you checked what happens if that file is written back to disk?
Maybe this change could be constrained to files that are open for reading only (if this is even known).

Otherwise I fear that writing such a mangled file back, for example because some other value changed, will cause it to become invalid for some users.

What is your thoughts on this?

Copy link
Author

Choose a reason for hiding this comment

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

It looks like it might be platform dependent. Config entries get written here and the defenc encoding is determined here. I'll test it on my win10 machine, and if it works, we might wrap that replace call in an if is_win: statement as a precaution.

@Byron
Copy link
Member

Byron commented Sep 4, 2020

@HudsonMC16 I reworded the contribution guidelines to make clear adding oneself to the AUTHORS file is not a requirement at all.

@NotoriousRebel
Copy link

Any updates?

@HudsonMC16
Copy link
Author

I'm sorry, I completely lost track of this. I'll run some tests after new year's.

@Byron Byron marked this pull request as draft January 6, 2021 06:52
@Byron
Copy link
Member

Byron commented May 13, 2021

Thanks for the work put into this PR from everyone involved. I hope it can be resubmitted once there is some time to see it through. Thanks for your understanding.

@Byron Byron closed this May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants