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

ValueError: startfile: filepath too long for Windows #8

Open
robmarkcole opened this issue Sep 22, 2017 · 8 comments
Open

ValueError: startfile: filepath too long for Windows #8

robmarkcole opened this issue Sep 22, 2017 · 8 comments

Comments

@robmarkcole
Copy link

When running:

from geojsonio import display
with open('map.geojson') as f:
    contents = f.read()
    display(contents)

with data from Google in the file map.geojson I receive the following error:

ValueError                                Traceback (most recent call last)
<ipython-input-6-cd14c4214ce4> in <module>()
      3 with open('map.geojson') as f:
      4     contents = f.read()
----> 5     display(contents)

C:\ProgramData\Anaconda3\lib\site-packages\geojsonio\geojsonio.py in display(contents, domain, force_gist)
     35     """
     36     url = make_url(contents, domain, force_gist)
---> 37     webbrowser.open(url)
     38     return url
     39 # display() used to be called to_geojsonio. Keep it around for now...

C:\ProgramData\Anaconda3\lib\webbrowser.py in open(url, new, autoraise)
     58     for name in _tryorder:
     59         browser = get(name)
---> 60         if browser.open(url, new, autoraise):
     61             return True
     62     return False

C:\ProgramData\Anaconda3\lib\webbrowser.py in open(self, url, new, autoraise)
    511         def open(self, url, new=0, autoraise=True):
    512             try:
--> 513                 os.startfile(url)
    514             except OSError:
    515                 # [Error 22] No application is associated with the specified

ValueError: startfile: filepath too long for Windows
@jwass
Copy link
Owner

jwass commented Sep 25, 2017

Hi @robmarkcole,
I don't have Windows so it's difficult for me to figure out what the real max. length would be. Do you think you could help figure it out on your machine?

A workaround is to use display(..., force_gist=True)

@HADDADENICAR
Copy link

i have the same problem after adding force_gist=True i have the following error
AuthenticationFailed: 401 Requires authentication

@minroh
Copy link

minroh commented Nov 18, 2018

I get the same error:

AuthenticationFailed: 401 Requires authentication
I have Windows 10 Enterprise x64
Python 3.6.4

@tomchristian
Copy link

I have the same issue as Haddadenicar and Minroh.
In the 1st case I get: ValueError: startfile: filepath too long for Windows
With force_gist=True, I get: AuthenticationFailed: 401 Requires authentication

@jwnys
Copy link

jwnys commented Feb 11, 2020

Same problem here

@nicelgueta
Copy link

Has anyone managed to find a workaround for this? Still encountering the same issues described above - file too long, then 401 with force_gist.
geojsonio==0.0.3

@kevin552216
Copy link

I use make_url instead of display to avoid this error.
Here's the step.
room = geopandas.read_file("file").to_json()
url = geojsonio.make_url(room)
print(url)
#double click the url
image
image

@xavfa
Copy link

xavfa commented Feb 8, 2021

Hi, I am facing the same issue, but using the above workaround gives me error due to too long url....is there any other workaround ? My try is to over plot building's footprint on map and I get this message (ValueError: startfile: filepath too long for Windows) when I try to plot too many buildings. Thus is there a work round by making a loop for plotting element but pointing the same page ?
Thanks in advance for any help

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

10 participants