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

asyncio.streams.IncompleteReadError is removed from python3.8 #454

Closed
psafarov opened this issue Dec 5, 2019 · 9 comments
Closed

asyncio.streams.IncompleteReadError is removed from python3.8 #454

psafarov opened this issue Dec 5, 2019 · 9 comments

Comments

@psafarov
Copy link

psafarov commented Dec 5, 2019

https://github.com/aio-libs/aiomysql/blob/master/aiomysql/connection.py#L599 exception should be replaced

dongweiming added a commit to dongweiming/aiomysql that referenced this issue Dec 28, 2019
@dongweiming dongweiming mentioned this issue Dec 28, 2019
4 tasks
dongweiming added a commit to dongweiming/lyanna that referenced this issue Dec 28, 2019
@bitnom
Copy link

bitnom commented Feb 3, 2020

Upon running a stress test, I keep getting the error "AttributeError: module 'asyncio.streams' has no attribute 'IncompleteReadError'" and then my aiohttp server crashes. I installed aiomysql from master but did not fix.

@bitnom
Copy link

bitnom commented Feb 3, 2020

Nevermind that. I see the branch referenced in the requirements file. It fixed my issue. She must be merged here.

@tonal
Copy link

tonal commented Feb 5, 2020

Manky path:

def aiomysql_path():
  try:
    from aiomysql.connection import IncompleteReadError
    return
  except:
    pass

  try:
    from asyncio.streams import IncompleteReadError
    return
  except:
    pass

  import asyncio
  from pymysql import OperationalError

  async def _read_bytes(self, num_bytes):
    try:
      data = await self._reader.readexactly(num_bytes)
    except asyncio.exceptions.IncompleteReadError as e:
      msg = "Lost connection to MySQL server during query"
      raise OperationalError(2013, msg) from e
    except (IOError, OSError) as e:
      msg = "Lost connection to MySQL server during query (%s)" % (e,)
      raise OperationalError(2013, msg) from e
    return data

  from aiomysql.connection import Connection
  Connection._read_bytes = _read_bytes

webknjaz added a commit that referenced this issue Apr 24, 2020
@spumer
Copy link

spumer commented May 31, 2020

Can you up lib version? Cause current version is too old and no fix at last release (0.0.20)

@spumer
Copy link

spumer commented Aug 4, 2020

@webknjaz can you help?

@webknjaz
Copy link
Member

webknjaz commented Aug 4, 2020

Ask @terrycain and @jettify @ #466

@nikita-davydov
Copy link

BUMP

@spumer
Copy link

spumer commented Dec 10, 2020

@ndavydovdev release published 14 days ago: #466 (comment)

@nikita-davydov
Copy link

@ndavydovdev release published 14 days ago: #466 (comment)

Hmmm, I think, databases uses older version, thanks

andr-04 added a commit to andr-04/aiomysql that referenced this issue May 18, 2021
* commit '0a8af2355562ea961477738d66b3334332447186':
  Bump version and tweak setup.py (aio-libs#540)
  Fill changelog for 0.0.21 release (aio-libs#538)
  Support python 3.7 and 3.8 in tests and travis CI
  Update dependencies (aio-libs#485)
  chore(flake8): fixed flake8 errors (aio-libs#484)
  added support for sqlalchemy default parameters aio-libs#455 (aio-libs#456)
  Fix flake
  Fixed invalid datatime for MySQL 5.7
  Rewrote tests to use pytest exclusively
  Fixed linting
  Attempted to move db completely to docker
  Fix Travis attempt 1
  Fix aio-libs#454
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

7 participants
@tonal @webknjaz @spumer @psafarov @bitnom @nikita-davydov and others