jack-mil / bing-rewards

A script to automate daily Bing rewards points
MIT License
201 stars 26 forks source link

Config file not found #56

Closed Tri4ceKid closed 1 day ago

Tri4ceKid commented 3 days ago

I'm just trying to get to the config file to edit arguments, but it's not there... nothing is. Screenshot 2024-11-28 095825

Apologies in advance, am big noob

Tri4ceKid commented 1 day ago

Took a bit of digging, but I found the config file in ~\AppData\Local\Packages\PythonSoftware...\LocalCache\Roaming\bing-rewards. Not sure why it saved there, but that appears to have solved my issue.

jack-mil commented 1 day ago

That is really strange... Do you have Python installed through the Microsoft Store? Even still, I am surprised it messed up the paths. These are the paths that are supposed to be searched. I am guessing that the MS Store distribution of Python overrides the $APPDATA environment variable.

def config_location() -> Path:
    r"""Check these locations in order for config.json.

    - %APPDATA%\bing-rewards\
    - $XDG_CONFIG_HOME/bing-rewards/
    - $HOME/.config/bing-rewards/
    """
    # Config file in .config or APPDATA on Windows
    config_home = Path(
        os.environ.get('APPDATA')
        or os.environ.get('XDG_CONFIG_HOME')
        or Path(os.environ['HOME'], '.config'),
        'bing-rewards',
    )

    return config_home.joinpath('config.json')