New submission from David <deivid.rodrig...@riseup.net>:

Hello!

Newbie to python here. I run into an issue with one desktop library, Cinnamon. 
Specifically this one: 
https://github.com/linuxmint/Cinnamon/issues/5926#issuecomment-411232144. This 
library uses the urllib in the standard library to download some json. But for 
some reason, it does not work for me. If however, I use 
[https://github.com/urllib3/urllib3](urllib3), it just works. It sounds like 
something the standard library could do better, so I'm reporting it here in 
case it's helpful.

A minimal example would be:


```python
from urllib.request import urlopen
 
data = urlopen("https://cinnamon-spices.linuxmint.com/json/applets.json";).read()
 
print(data)
```

which just hangs for me. If I pass a specific number of bytes (less than 
~65000), it works, but only downloads parts of the file.

Using the equivalent code in urllib3 works just fine:

```python
import urllib3

http = urllib3.PoolManager()
response = http.request('GET', 
'https://cinnamon-spices.linuxmint.com/json/applets.json')
print(response.data)

```

This is on

```
Python 3.7.0 (default, Aug  7 2018, 23:24:26) 
[GCC 5.5.0 20171010] on linux
```

Any help troubleshooting this would be appreciated!

----------
messages: 323275
nosy: deivid
priority: normal
severity: normal
status: open
title: situation where urllib3 works, but urllib does not work

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34357>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to