pozi / PoziConnectConfig

0 stars 5 forks source link

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

Open simonokeefe opened 2 years ago

simonokeefe commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

@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.