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

3.1.0 issue: AttributeError: 'NoneType' object has no attribute 'encode' #346

Closed
devrimgunduz opened this issue Mar 6, 2023 · 4 comments · Fixed by #347
Closed

3.1.0 issue: AttributeError: 'NoneType' object has no attribute 'encode' #346

devrimgunduz opened this issue Mar 6, 2023 · 4 comments · Fixed by #347
Assignees
Labels

Comments

@devrimgunduz
Copy link

devrimgunduz commented Mar 6, 2023

Hi,

I'm trying to run pg_activity 3.1.0 (installed via RPMs) on Fedora 37 (Python 3.11, psycopg 3.1.8), and getting this. Any idea what am I missing?

Thanks!

$ pg_activity
Traceback (most recent call last):
File "/usr/bin/pg_activity", line 33, in
sys.exit(load_entry_point('pg-activity==3.1.0', 'console_scripts', 'pg_activity')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pgactivity/cli.py", line 388, in main
dataobj = data.pg_connect(
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pgactivity/data.py", line 518, in pg_connect
data = Data.pg_connect(
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pgactivity/data.py", line 94, in pg_connect
pg_conn = pg.connect(
^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pgactivity/pg.py", line 45, in connect
return psycopg.connect(*args, autocommit=True, row_factory=dict_row, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/psycopg/connection.py", line 719, in connect
params = cls._get_connection_params(conninfo, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/psycopg/connection.py", line 778, in _get_connection_params
params = conninfo_to_dict(conninfo, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/psycopg/conninfo.py", line 79, in conninfo_to_dict
opts = _parse_conninfo(conninfo)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/psycopg/conninfo.py", line 96, in _parse_conninfo
return pq.Conninfo.parse(conninfo.encode())
^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'encode'

@dlax
Copy link
Member

dlax commented Mar 6, 2023

It looks like your psycopg package is not working fine. Can you try python -c 'import psycopg; psycopg.connect()' to confirm?

@dlax dlax self-assigned this Mar 6, 2023
@dlax dlax added the packaging label Mar 6, 2023
@dlax
Copy link
Member

dlax commented Mar 6, 2023

Hm, no, sorry; I read too fast, that's indeed something on our side. I'll take a closer look.

@dlax
Copy link
Member

dlax commented Mar 6, 2023

I released version 3.1.1 with a fix. Thank you!

@devrimgunduz
Copy link
Author

3.1.1 works great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants