Ich bin dabei ein altes Python2 Programm auf Python3 umzuschreiben.
Ich bekomme da diese Warnung:

/local/home/framstag/python/./fexit.py:905: DeprecationWarning: 
ssl.wrap_socket() is deprecated, use SSLContext.wrap_socket()

Der Code an dieser Stelle ist:

    sock = ssl.wrap_socket(sock)

Wenn ich das aendere in:

    sock = ssl.SSLContext.wrap_socket(sock)

bricht mir das Programm ab mit dieser Fehlermeldung:

  File "/local/home/framstag/python/./fexit.py", line 905, in http_connect
    sock = ssl.SSLContext.wrap_socket(sock)
TypeError: SSLContext.wrap_socket() missing 1 required positional argument: 
'sock'


Ich hab da wohl was nicht verstanden. Wie gehts richtig?


sock hatte ich so erzeugt:

    sock = socket.create_connection((server,port))

-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK
Universitaet Stuttgart         E-Mail: horlac...@tik.uni-stuttgart.de
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    https://www.tik.uni-stuttgart.de/
_______________________________________________
python-de Mailingliste -- python-de@python.org
Zur Abmeldung von dieser Mailingliste senden Sie eine Nachricht an 
python-de-le...@python.org
https://mail.python.org/mailman3/lists/python-de.python.org/
Mitgliedsadresse: arch...@mail-archive.com

Reply via email to