Browse Source

python3.5: fixed TypeError in _sync_event when reading file

Fabian Peter Hammerle 3 years ago
parent
commit
0085bb2898
2 changed files with 2 additions and 1 deletions
  1. 1 0
      CHANGELOG.md
  2. 1 1
      ical2vdir/__init__.py

+ 1 - 0
CHANGELOG.md

@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ### Fixed
 - python3.5:
   - `TypeError` in `_write_event` when renaming temporary file
+  - `TypeError` in `_sync_event` when reading file
   - tests: `TypeError` when converting to `pathlib.Path`
 
 ## [0.1.1] - 2020-02-06

+ 1 - 1
ical2vdir/__init__.py

@@ -113,7 +113,7 @@ def _sync_event(
         _LOGGER.info("creating %s", output_path)
         _write_event(event, output_path)
     else:
-        with open(output_path, "rb") as current_file:
+        with output_path.open("rb") as current_file:
             current_event = icalendar.Event.from_ical(current_file.read())
         if _events_equal(event, current_event):
             _LOGGER.debug("%s is up to date", output_path)