jkehler / awslambda-psycopg2

1.12k stars 363 forks source link

basestring error #54

Closed omersi closed 2 years ago

omersi commented 4 years ago

when importing version 3.7 and running natively, it issues and exception:

import psycopg2 File "/opt/psycopg2/__init__.py", line 68, in <module> import psycopg2.extensions as _ext File "/opt/psycopg2/extensions.py", line 211, in <module> from psycopg2. _range import Range # noqa File "/opt/psycopg2/_range.py", line 502, in <module> oid=3904, subtype_oid=23, array_oid=3905) File "/opt/psycopg2/_range.py", line 283, in __init__ self._create_ranges(pgrange, pyrange) File "/opt/psycopg2/_range.py", line 302, in _create_ranges if isinstance(pgrange, basestring): NameError: name 'basestring' is not defined a solution is to replace basestring with str

mikheillomidze commented 3 years ago

I have the same issue on python3.8. How can I resolve it?

jessemorton commented 2 years ago

May have to do with needing to upgrade to 2.8 or later. See https://github.com/psycopg/psycopg2/issues/1419