Skip to content

python 3.12 + py-postgresql 1.3.0: AttributeError: module 'ssl' has no attribute 'wrap_socket' #129

@dvekeman

Description

@dvekeman

The current released version, python-postgresql 1.3.0, fails on python 3.12 because ssl.wrap_socket was removed.

This results in an error

    Traceback (most recent call last):
      File "<..>/lib/python3.12/site-packages/postgresql/protocol/client3.py", line 184, in connect
        self.socket = self.socket_factory.secure(self.socket)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<...>/lib/python3.12/site-packages/postgresql/python/socket.py", line 57, in secure
        return ssl.wrap_socket(socket, **self.socket_secure)
               ^^^^^^^^^^^^^^^
    AttributeError: module 'ssl' has no attribute 'wrap_socket'

It looks like this is fixed on the main branch already. Are there any plans to release 1.3.1 soon?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions