blakev / python-syncthing

Python bindings to the Syncthing REST interface.
MIT License
75 stars 24 forks source link

Cannot create 2 Syncthing objects #8

Closed Jvlythical closed 7 years ago

Jvlythical commented 8 years ago

e.g. a = Syncthing(api_key=1, ...) b = Syncthing(api_key=2, ...)

Results in calls from object a (e.g. a.sys.config()) to get b's config rather than the expected a's config.

The issue is caused by the C class having a static variable C.iface which gets overridden when a new Syncthing object is created. As a result, when object a tries to make a new api call, it uses b's iface variable.

blakev commented 7 years ago

Can you confirm if this is still an issue? I've re-implemented the API and should no longer have this problem.

blakev commented 7 years ago

Marking as closed, I cannot replicate this any more.