Skip to content

Backup.py bug with datetime #30

@chaoscreater

Description

@chaoscreater

When I run your script on Windows, I get the following error:

OSError: [Errno 22] Invalid argument: 'backup-2021-08-10T09:26:37.344645.json'

The reason is because of the semi-colon (:) that is used in the filename. Windows doesn't accept : as a filename.

To fix this, change the Backup.py line:
now_string = datetime.now().isoformat()

into this:

now_string = datetime.today().strftime('%Y-%m-%d')

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