Skip to content

FileExistsError: [Errno 17] File exists: '.cache' #111

@jroitgrund

Description

@jroitgrund

version 0.1.25

FileExistsError: [Errno 17] File exists: '.cache'
<snip>
  File "<my-own-code>", line 26, in get_ical_events
    raw_events = events(ical_link, start=from_date, end=to_date)
  File "icalevents/icalevents.py", line 38, in events
    ical_download = ICalDownload(http=http)
  File "icalevents/icaldownload.py", line 37, in __init__
    http = Http('.cache')
  File "__init__.py", line 1249, in __init__
    self.cache = FileCache(cache)
  File "__init__.py", line 771, in __init__
    os.makedirs(self.cache)
  File "os.py", line 225, in makedirs
    mkdir(name, mode)

I'm guessing that due to concurrent calls to events where they both try and create .cache at the exact same time, the check

        if not os.path.exists(cache):
            os.makedirs(self.cache)

in httplib2 races.

Fixing upstream: httplib2/httplib2#224

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