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

AttributeError: 'NoneType' object has no attribute 'write' #132

Closed
mpyatishev opened this issue Jul 30, 2014 · 4 comments
Closed

AttributeError: 'NoneType' object has no attribute 'write' #132

mpyatishev opened this issue Jul 30, 2014 · 4 comments
Labels

Comments

@mpyatishev
Copy link

I could not run curl.py example.

~/work>python3.4 curl.py http://mail.ru
Exception in callback StreamProtocol.connection_made(<_SelectorSocketTransport fd=7 read=polling write=<idle, bufsize=0>>)
handle: <Handle StreamProtocol.connection_made(<_SelectorSocketTransport fd=7 read=polling write=<idle, bufsize=0>>)>
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/events.py", line 102, in _run
    self._callback(*self._args)
  File "/usr/local/lib/python3.4/dist-packages/aiohttp/parsers.py", line 251, in connection_made
    transport, self, self.reader, self._loop)
  File "/usr/lib/python3.4/asyncio/streams.py", line 254, in __init__
    assert reader is None or isinstance(reader, StreamReader)
AssertionError
Traceback (most recent call last):
  File "curl.py", line 26, in <module>
    loop.run_until_complete(curl(sys.argv[1]))
  File "/usr/lib/python3.4/asyncio/base_events.py", line 268, in run_until_complete
    return future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 271, in result
    raise self._exception
  File "/usr/lib/python3.4/asyncio/tasks.py", line 247, in _step
    result = next(coro)
  File "curl.py", line 9, in curl
    response = yield from aiohttp.request('GET', url)
  File "/usr/local/lib/python3.4/dist-packages/aiohttp/client.py", line 107, in request
    resp = req.send(conn.writer, conn.reader)
  File "/usr/local/lib/python3.4/dist-packages/aiohttp/client.py", line 505, in send
    request.send_headers()
  File "/usr/local/lib/python3.4/dist-packages/aiohttp/protocol.py", line 649, in send_headers
    self.transport.write(hdrs)
AttributeError: 'NoneType' object has no attribute 'write'
~/work>python3.4 -V
Python 3.4.1
@popravich
Copy link
Member

Python 3.4.1 has newer version of Tulip and the following changeset adds assertion raised above:
http://hg.python.org/cpython/rev/bf1b0afe419b#l1.55
So for 3.4.1 the aiohttp.parsers.StreamParser should subclass acyncio.StreamReader

@popravich
Copy link
Member

same as #131

@fafhrd91
Copy link
Member

fafhrd91 commented Aug 2, 2014

fixed

@fafhrd91 fafhrd91 closed this as completed Aug 2, 2014
@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants