Git Product home page Git Product logo

asyncio-examples's People

Contributors

jimmysong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

asyncio-examples's Issues

Crash on subprocess checker

I'm watching your conference video and trying the examples. I ran the subprocess-checker several times in a row and got once an uncaught exception.

(aiohttp) luismenina@ALD-1781-LA:~/devel/asyncio-examples$ python subprocess-checker.py list.txt 4
{'200': 31}
getting website statuses took 5.9 seconds
(aiohttp) luismenina@ALD-1781-LA:~/devel/asyncio-examples$ python subprocess-checker.py list.txt 4
{'200': 31}
getting website statuses took 6.1 seconds
(aiohttp) luismenina@ALD-1781-LA:~/devel/asyncio-examples$ pip install requests
Requirement already satisfied: requests in ./aiohttp/lib/python3.7/site-packages (2.20.1)
Requirement already satisfied: certifi>=2017.4.17 in ./aiohttp/lib/python3.7/site-packages (from requests) (2018.11.29)
Requirement already satisfied: idna<2.8,>=2.5 in ./aiohttp/lib/python3.7/site-packages (from requests) (2.7)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./aiohttp/lib/python3.7/site-packages (from requests) (3.0.4)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in ./aiohttp/lib/python3.7/site-packages (from requests) (1.24.1)
(aiohttp) luismenina@ALD-1781-LA:~/devel/asyncio-examples$ python subprocess-checker.py list.txt 4
Traceback (most recent call last):
  File "/home/luismenina/devel/asyncio-examples/aiohttp/lib/python3.7/site-packages/urllib3/response.py", line 324, in _decode
    data = self._decoder.decompress(data)
  File "/home/luismenina/devel/asyncio-examples/aiohttp/lib/python3.7/site-packages/urllib3/response.py", line 77, in decompress
    ret += self._obj.decompress(data)
zlib.error: Error -3 while decompressing data: incorrect header check

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/luismenina/devel/asyncio-examples/aiohttp/lib/python3.7/site-packages/requests/models.py", line 750, in generate
    for chunk in self.raw.stream(chunk_size, decode_content=True):
  File "/home/luismenina/devel/asyncio-examples/aiohttp/lib/python3.7/site-packages/urllib3/response.py", line 494, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "/home/luismenina/devel/asyncio-examples/aiohttp/lib/python3.7/site-packages/urllib3/response.py", line 466, in read
    data = self._decode(data, decode_content, flush_decoder)
  File "/home/luismenina/devel/asyncio-examples/aiohttp/lib/python3.7/site-packages/urllib3/response.py", line 329, in _decode
    "failed to decode it." % content_encoding, e)
urllib3.exceptions.DecodeError: ('Received response with content-encoding: gzip, but failed to decode it.', error('Error -3 while decompressing data: incorrect header check'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "naive-checker.py", line 22, in <module>
    print(json.dumps(website_statuses(websites)))
  File "naive-checker.py", line 10, in website_statuses
    response = requests.get(website)
  File "/home/luismenina/devel/asyncio-examples/aiohttp/lib/python3.7/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/home/luismenina/devel/asyncio-examples/aiohttp/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/luismenina/devel/asyncio-examples/aiohttp/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/luismenina/devel/asyncio-examples/aiohttp/lib/python3.7/site-packages/requests/sessions.py", line 668, in send
    history = [resp for resp in gen] if allow_redirects else []
  File "/home/luismenina/devel/asyncio-examples/aiohttp/lib/python3.7/site-packages/requests/sessions.py", line 668, in <listcomp>
    history = [resp for resp in gen] if allow_redirects else []
  File "/home/luismenina/devel/asyncio-examples/aiohttp/lib/python3.7/site-packages/requests/sessions.py", line 247, in resolve_redirects
    **adapter_kwargs
  File "/home/luismenina/devel/asyncio-examples/aiohttp/lib/python3.7/site-packages/requests/sessions.py", line 686, in send
    r.content
  File "/home/luismenina/devel/asyncio-examples/aiohttp/lib/python3.7/site-packages/requests/models.py", line 828, in content
    self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
  File "/home/luismenina/devel/asyncio-examples/aiohttp/lib/python3.7/site-packages/requests/models.py", line 755, in generate
    raise ContentDecodingError(e)
requests.exceptions.ContentDecodingError: ('Received response with content-encoding: gzip, but failed to decode it.', error('Error -3 while decompressing data: incorrect header check'))
Traceback (most recent call last):
  File "subprocess-checker.py", line 29, in <module>
    stats, _, _ = result.decode().split("\n")
ValueError: not enough values to unpack (expected 3, got 1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.