fiona cannot find file in windows path with `!` character
See original GitHub issueExpected behavior and actual behavior.
fiona
cannot find file with !
in path,
For example, fiona
seems to interpret !test\test.geojson
as test est.geojson
click
validates the path successfully in my script with:
@click.option(... type=click.Path(exists=True))
Based on https://ss64.com/nt/syntax-esc.html I tried escaping the !
with ^
and ^^
with no luck, click
then tells me the path does not exist. Perhaps there is a better way to escape the character?
I can just copy data over to a location with a more reasonable path name but thought this might be worth reporting.
Steps to reproduce the problem.
> mkdir !test
> copy test.geojson !test\test.geojson
> python
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import fiona
>>> with fiona.open("!test\test.geojson") as src:
... src.crs
...
Traceback (most recent call last):
File "fiona\_shim.pyx", line 73, in fiona._shim.gdal_open_vector
File "fiona\_err.pyx", line 270, in fiona._err.exc_wrap_pointer
fiona._err.CPLE_OpenFailedError: 'test est.geojson' does not exist in the file system, and is not recognized as a supported dataset name.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "Q:\projects\Mempr\Wind_Mapping\scripts\windsites\venv_36\lib\site-packages\fiona\env.py", line 406, in wrapper
return f(*args, **kwargs)
File "Q:\projects\Mempr\Wind_Mapping\scripts\windsites\venv_36\lib\site-packages\fiona\__init__.py", line 257, in open
layer=layer, enabled_drivers=enabled_drivers, **kwargs)
File "Q:\projects\Mempr\Wind_Mapping\scripts\windsites\venv_36\lib\site-packages\fiona\collection.py", line 159, in __init__
self.session.start(self, **kwargs)
File "fiona\ogrext.pyx", line 484, in fiona.ogrext.Session.start
File "fiona\_shim.pyx", line 80, in fiona._shim.gdal_open_vector
fiona.errors.DriverError: 'test est.geojson' does not exist in the file system, and is not recognized as a supported dataset name.
>>>
Operating system
Windows Server 2016 Standard Version 1607
Fiona and GDAL version and provenance
Pre-built from https://www.lfd.uci.edu/~gohlke/pythonlibs/
Fiona-1.8.6-cp36-cp36m-win_amd64.whl
GDAL-2.3.3-cp36-cp36m-win_amd64.whl
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Can't install Fiona on Windows - Stack Overflow
The GDAL DLL files and gdal-data directory need to be in your Windows PATH otherwise building Fiona will fail to work. Follow below...
Read more >11 Ways to Fix "The System Cannot Find The Path Specified ...
11 Ways to Fix "The System Cannot Find The Path Specified" Error on Windows · 1. Run Command Prompt as an Administrator ·...
Read more >Fiona 2.0dev documentation
On Windows, these paths need to be provided by the user. You will need to find the include files and the library files...
Read more >Error installing GeoPandas? - GIS Stack Exchange
The problem is with fiona not with shapely , try to install it separately not as a dependence of geopandas. Download the right...
Read more >Cannot Open the file because the file path is more than 218 ...
Microsoft Excel: 218 characters. Microsoft Windows standard file path limit is 259-characters which means rule may apply to other type file (e,g ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, I found a bug in fiona’s path parsing:
!
causes the path to be parsed as though it were a zip archive. The workaround is to avoid!
in your filenames until we can fix this and make another release.Closed by #773.