Skip to content
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

os.path.exists appears to fail on UNC paths #5

Open
simonokeefe opened this issue Jan 14, 2022 · 3 comments
Open

os.path.exists appears to fail on UNC paths #5

simonokeefe opened this issue Jan 14, 2022 · 3 comments
Assignees

Comments

@simonokeefe
Copy link
Member

simonokeefe commented Jan 14, 2022

Knox's Pozi Connect log file shows that the os.path.exists function fails on a valid UNC path.

Condition: os.path.exists('\\knox.local\fileserver\GIS\Data\Development\Property\data_in\LandVictoria\SpatialDatamart\VicmapSimplified1\latest\VMPROP\V_PARCEL_MP.tab') is False

This Stack Overflow comment suggests using os.path.isfile instead of os.path.exists.

https://stackoverflow.com/questions/15077424/pros-and-cons-between-os-path-exists-vs-os-path-isdir#comment72540108_15077527

@simonokeefe simonokeefe self-assigned this Jan 14, 2022
@simonokeefe
Copy link
Member Author

Knox tried os.path.isfile but it also failed.

Condition: os.path.isfile('\\knox.local\fileserver\GIS\Data\Development\property\data_in\LandVictoria\SpatialDatamart\VicmapSimplified1\latest\VMPROP\V_PARCEL_MP.tab') is False

@rdewit
Copy link
Member

rdewit commented Jan 14, 2022

Could it have something to do with the dot in the network mount name? Or could it be this:

Note: os.path.exists() function may return False, if permission is not granted to execute os.stat() on the requested file, even if the path exists.

(from: https://www.geeksforgeeks.org/python-os-path-exists-method/)

@simonokeefe
Copy link
Member Author

@rdewit Thanks for your input. I didn't realise you were notified about issues or anything in this repo. I'll await further feedback from the council about another workaround I've suggested for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants