betcode-org / betfair

betfairlightweight - Betfair API-NG python wrapper (with streaming)
MIT License
419 stars 147 forks source link

Parent directory is added to given certs path #279

Open yorickvanzweeden opened 4 years ago

yorickvanzweeden commented 4 years ago

In baseclient.py:158-161:

        certs = self.certs or "/certs/"
        ssl_path = os.path.join(os.pardir, certs)
        try:
            cert_path = os.listdir(ssl_path)

If given an absolute path, nothing changes. If given a relative path, the parent directory is added. Adding the parent directory seems confusing to me, as I would expect I should give the path relative from the working directory.

I appear to not be the only one: https://github.com/liampauling/betfair/issues/30#issuecomment-296386369

Can this be changed or atleast mentioned in the README?

Example: projectdir |--- betfair |--- script.py _ |--- certs/

I would expect to give the argument './betfair/certs/', but this would lead to '../betfair/certs'. To account for this, I would have to put in 'project_dir/betfair/certs/', leading to '../project_dir/betfair/certs'. As my working directory is project_dir, it seems like I am referring to 'project_dir/project_dir/betfair/certs'

liampauling commented 4 years ago

Welcome any PR's to the readme or code

mzaja commented 1 year ago

@liampauling What went wrong with this pull request? I can see it was closed rather than merged after being open for 1.5 years.

liampauling commented 1 year ago

My comments where not addressed so I guess I just closed to clean it up, happy to reopen once all fixed

mzaja commented 1 year ago

Pull request opened: https://github.com/betcode-org/betfair/pull/520.