Comments (9)
It looks like it needs an "Accept-Encoding" header.
wget https://cdnjs.cloudflare.com/ajax/libs/leaflet//1.0.3/images/marker-icon.png
doesn't work, but
wget --header='Accept-Encoding: gzip, deflate, br' https://cdnjs.cloudflare.com/ajax/libs/leaflet//1.0.3/images/marker-icon.png
does.
from flexx.
Thanks @jrversteegh, that explains it, and I manage to get the example working again in #742.
@Galeras14 Could you please check whether #742 fixes it for you to?
from flexx.
I've kind of solve the issue of urllib3 following #3020 issue on urllib3.
Still, the leaflet.py example give me this error, even we the suggested modifications:
Traceback (most recent call last):
File "/Users/admin/PycharmProjects/Genealogie/sample/ui/essai.py", line 82, in
flx.assets.add_shared_data(icon, _get_data('images/%s' % icon))
File "/Users/admin/PycharmProjects/Genealogie/sample/ui/essai.py", line 53, in _get_data
assert res.ok, f"{res.status_code}: {res.reason}"
AssertionError: 404: Not Found
from flexx.
I can reproduce that it does not work. The first exception is when the script tries to obtain https://cdnjs.cloudflare.com/ajax/libs/leaflet//1.0.3/images/marker-icon.png
. However, it works fine when I copy-paste that link in the browser. Same for https://cdnjs.cloudflare.com/ajax/libs/leaflet//1.0.3/leaflet.js
when I comment the lines that downloads the icons.
So it may be related to the user agent - perhaps leaflet is trying to prevent non-browsers from using the API
from flexx.
Hi, thanks a lot for your help. However I'm still having trouble.
I get this error message from _get data function:
assert res.ok, f"{res.status_code}: {res.reason}"
AssertionError: 404: Not Found
In addition, I'm now having a warning message:
/Users/admin/PycharmProjects/Genealogie/env/lib/python3.7/site-packages/urllib3/init.py:38: NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: urllib3/urllib3#3020
exceptions.NotOpenSSLWarning,
Not sure if it is Mac environment or if it is because I'm using Python 3.8.
from flexx.
Is that the system Python 3.8? Have you tried upgrading to the latest urllib3 using e.g. pip install -U urllib3
?
from flexx.
Yes, I'm in the latest version of urllib3, 2.0.7
from flexx.
Mmm. It's pretty annoying that leaflet produces a 404, and not a more meaningful error code. This way there is no way to see whether the problem is the header or your wifi being down 😕
I tried #742 and I got the same error. It looks like I was trying out some stuff and pushed the wrong version. I updated that PR to the version that works for me too. Sorry for that!
edited: I initially linked to the wrong pr above because of a typo, which I now fixed
from flexx.
With your modification, the example works for me and my app works again.
Thanks a lot !
from flexx.
Related Issues (20)
- how to set a timer HOT 10
- the pycomponents has conflicts with js? HOT 8
- Run as a desktop app, how to close the incognito window? HOT 1
- How to Change the "Starting Flexx App"? HOT 2
- Run as a desktop app, how to hide or remove the close button on the browser ? HOT 1
- Trying to build a SPA / Saas with Flexx HOT 1
- Flexx lacks of a lot of features HOT 4
- I couldn't find any example of sending ajax request and getting response HOT 1
- PlotlyWidget in offline mode HOT 2
- "Lost connection to server" on every little connection error/timeout HOT 6
- Is there a way to send data from my client side js widget to server side (for example images, videos)? HOT 5
- 使用freeze失败
- _mutate_xxx‘s bug or for some other reason HOT 2
- No certificate found HOT 2
- Lost connection with server: message too big (1009) HOT 1
- ui css:max-height < min-height HOT 6
- 'Too many open files' error HOT 14
- Use flx.create_element to create a label in the for loop, bind the onclick event, and dynamically transfer parameters. lambda fun error HOT 1
- use multiprocessing in flexx after freeze, The window keeps popping up HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flexx.