Skip to content

cwrap.py and pwrap.py are triplicated across demo/ ratc/ tools/ and the demo/ratc copies still use http:// with the api key in the URL #448

@avinxshKD

Description

@avinxshKD

We have cwrap.py in demo/, ratc/, and tools/.., three copies of basically the same file. same story for pwrap.py. The demo and ratc versions are copy-pastes of each other with one line different.

The bigger problem: demo/ and ratc/ both POST to http://www.controlcore.org/pm/{yuyu}{apikey} plaintext HTTP with the API key sitting in the URL. tools/ was updated to https at some point but nobody backported it

Also pwrap.py was never properly cleaned up when cwrap.py was cwrap got context managers and specific exceptions, pwrap still has bare open() calls leaking handles every loop iteration and bare except: everywhere catching KeyboardInterrupt.

One more: if the first POST comes back empty (len(r.text)==0), variable t is never assigned but while oldt==t runs right after that's a NameError waiting to happen.

These six files should be one shared module with cwrap/pwrap as thin wrappers around it.

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