Skip to content

Commit 0e91f16

Browse files
committed
Fix reading timezone files
1 parent a111349 commit 0e91f16

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- Fixed `from_format()` not recognizing input strings when the specified pattern had escaped elements.
88
- Fixed missing `x` token for string formatting.
9+
- Fixed reading timezone files.
910

1011

1112
## [2.0.3] - 2018-07-30

pendulum/tz/zoneinfo/reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def _check_read(self, fd, nbytes): # type: (...) -> bytes
6464
"""
6565
result = fd.read(nbytes)
6666

67-
if not result or len(result) != nbytes:
67+
if (not result and nbytes > 0) or len(result) != nbytes:
6868
raise InvalidZoneinfoFile(
6969
"Expected {} bytes reading {}, "
7070
"but got {}".format(nbytes, fd.name, len(result) if result else 0)

0 commit comments

Comments
 (0)