MagicStack / asyncpg

A fast PostgreSQL Database Client Library for Python/asyncio.
Apache License 2.0
6.99k stars 404 forks source link

Using non-ascii character in database password is not allowed in `asyncpg`, but postgresql allows non-ascci character in its password. #1018

Closed sumitsharansatsangi closed 1 year ago

sumitsharansatsangi commented 1 year ago

Hi, I was trying to insert a non-ascii character in the postgresql database password, It works perfectly fine with the postgresql, Tried to connect using Beekeeper and works successfully. I was able to connect my database, do some operation , everything was perfectly fine.

But when I tried to use it with asyncpg , it gives following error.

Traceback (most recent call last):
  File "asyncpg/protocol/coreproto.pyx", line 154, in asyncpg.protocol.protocol.CoreProtocol._process__auth
  File "asyncpg/protocol/coreproto.pyx", line 561, in asyncpg.protocol.protocol.CoreProtocol._parse_msg_authentication
  File "asyncpg/protocol/coreproto.pyx", line 649, in asyncpg.protocol.protocol.CoreProtocol._auth_password_message_md5
UnicodeEncodeError: 'ascii' codec can't encode characters in position 19-23: ordinal not in range(128)

I want to know , why the limitation from asyncpg, when postgresql is allowing it.

I request you to please remove the limitation , if there is no special reason to put it.

Thank you.