MagicStack / MagicStack/asyncpg
OverflowError: date value out of range
Personne n'a encore pris cette issue.
- Langage dominant
- Python
- Étoiles
- 8.1k
- Forks
- 468
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
* **asyncpg version**: 0.18.3
* **PostgreSQL version**: 10.7
* **Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?**: Yes
* **Python version**: 3.7
* **Platform**: Mac OS
* **Do you use pgbouncer?**: No
* **Did you install asyncpg with pip?**: Yes
* **If you built asyncpg locally, which version of Cython did you use?**:
* **Can the issue be reproduced under both asyncio and
[uvloop](https://github.com/magicstack/uvloop)?**:
asyncpg is failing to parse timestamp
code:
```
import asyncio
import asyncpg
async def run():
conn = await asyncpg.connect(user='secure', password='secure',
database='secure',
host='secure.com', port=15432, timeout=600)
values = await conn.fetch('''SELECT _ts FROM Events''')
print(values)
await conn.close()
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
```
```
Timestamp format: 2019-01-01T08:42:25.921Z
```
```
Traceback (most recent call last):
File "/scratch_65.py", line 21, in
loop.run_until_complete(run())
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/scratch_65.py", line 15, in run
values = await conn.fetch('''SELECT _ts FROM Events''')
File "/lib/python3.7/site-packages/asyncpg/connection.py", line 421, in fetch
return await self._execute(query, args, 0, timeout)
File "/lib/python3.7/site-packages/asyncpg/connection.py", line 1414, in _execute
query, args, limit, timeout, return_status=return_status)
File "/lib/python3.7/site-packages/asyncpg/connection.py", line 1422, in __execute
return await self._do_execute(query, executor, timeout)
File "/lib/python3.7/site-packages/asyncpg/connection.py", line 1444, in _do_execute
result = await executor(stmt, None)
File "asyncpg/protocol/protocol.pyx", line 196, in bind_execute
File "asyncpg/protocol/coreproto.pyx", line 65, in asyncpg.protocol.protocol.CoreProtocol._read_server_messages
File "asyncpg/protocol/coreproto.pyx", line 202, in asyncpg.protocol.protocol.CoreProtocol._process__bind_execute
File "asyncpg/protocol/coreproto.pyx", line 498, in asyncpg.protocol.protocol.CoreProtocol._parse_data_msgs
File "asyncpg/protocol/protocol.pyx", line 754, in asyncpg.protocol.protocol.BaseProtocol._decode_row
File "asyncpg/protocol/prepared_stmt.pyx", line 282, in asyncpg.protocol.protocol.PreparedStatementState._decode_row
File "asyncpg/protocol/codecs/base.pyx", line 288, in asyncpg.protocol.protocol.Codec.decode
File "asyncpg/protocol/codecs/base.pyx", line 195, in asyncpg.protocol.protocol.Codec.decode_scalar
File "asyncpg/pgproto/./codecs/datetime.pyx", line 252, in asyncpg.pgproto.pgproto.timestamptz_decode
OverflowError: date value out of range
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par asyncpg/pgproto/./codecs/datetime.pyx à timestamptz_decode, puis reproduisez l’échec à l’aide de la requête Python fournie contre PostgreSQL. Suivez la manière dont l’horodatage signalé est décodé et ajoutez une couverture pour ce cas si le dépôt dispose d’un emplacement de test pertinent. Le travail est terminé lorsque la requête renvoie l’horodatage sans OverflowError.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- postgresql, python
- Domaine
- databases
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100