nickovs / unificontrol

A high-level Python interface to the Unifi controller software
Apache License 2.0
96 stars 41 forks source link

No way to use library with unifi controller #39

Open Kolia56 opened 9 months ago

Kolia56 commented 9 months ago

Hello, I'm running Unifi Controller 7.2.97-18705-1 on a CloudKey (firmware v1.1.19). Self signed certificate This program run on a Windows 10 machine with Python 3.12.0

from unificontrol import UnifiClient
client = UnifiClient(host='xxx.xxx.xxx.xxx', username='xxx', password='yyyyyy')

triggers the following exception

Exception ignored in: <function PinningHTTPSAdapter.__del__ at 0x000001DB23C41580>
Traceback (most recent call last):
  File "C:\Users\NicolasRabaté\AppData\Roaming\Python\Python312\site-packages\unificontrol\pinned_requests.py", line 85, in __del__
  File "C:\Program Files\Python312\Lib\tempfile.py", line 478, in __getattr__
AttributeError: '_io.TextIOWrapper' object has no attribute 'delete'

What could be the reason? Thank you

nickovs commented 9 months ago

It appears that there was some change to the deletion semantics on Windows in Python 3.12. I don't have a Windows machine on which to try things, but I will take a look and see if I can work out what is going on.

Kolia56 commented 9 months ago

It appears that there was some change to the deletion semantics on Windows in Python 3.12. I don't have a Windows machine on which to try things, but I will take a look and see if I can work out what is going on.

Thank you very much to take care of this issue. Let me know if I can be of any help on this matter for further testing, for instance.

Vasilich commented 3 weeks ago

any chance to look at it? I use it on HomeAssistantOS (Linux based), so no Windows involved, but I get the same exception message as topicstarter,