Heya,
I have a string parameter that hold a file path of the format: \\ServerURL\Project\Path
Is then input with set(), displays correctly in the parameter, but when read out using eval() it returns as: \ServerURL\Project\Path
I know I can just add an extra backslash at the beginning to fix it but just curious if this is known/fixable. Perhaps something to do with raw strings?
Cheers!
Eval() Incorrectly Returning File Path String
1038 5 3- stephenscollay
- Member
- 5 posts
- Joined: July 2022
- Offline
- AslakKS
- Member
- 160 posts
- Joined: Feb. 2016
- Offline
- stephenscollay
- Member
- 5 posts
- Joined: July 2022
- Offline
Thanks a lot! No ideas how in hour of searching I never found that. That fixes it but it does feel a bit buggy that it returns in that manner as by rights the non raw string should still be \\ and not \. It just means that at some point, the eval() function returns the non raw string as a raw string which it then outputs. Its interesting because normally single slashes wouldnt be possible in a python non raw string so it has a check to convert those back to double slashes but at the same time converting the quad slash to a double. Worth a bug report?
- Jonathan de Blok
- Member
- 256 posts
- Joined: July 2013
- Offline
- stephenscollay
- Member
- 5 posts
- Joined: July 2022
- Offline
Yeah, I am currently doing that conversion, bit of a pain due to the path logic that I use but Id rather it work on both systems. Also it appears that when windows format file locations are in the file string, the file chooser doesn't open at the directory in the string.
Edited by stephenscollay - Feb. 22, 2023 17:41:31
- doctorbob
- Member
- 30 posts
- Joined:
- Offline
-
- Quick Links