Skip to content

Commit

Permalink
Don't cache the file object
Browse files Browse the repository at this point in the history
The file object will be left at the end of the file after reading,
leading to other things that use it (like parse) trying to read from
EOF.
  • Loading branch information
dopplershift committed Apr 27, 2023
1 parent 7a1329b commit d98faec
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/metpy/remote/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"""
import bisect
from datetime import datetime, timedelta
from functools import cached_property
import itertools
from pathlib import Path
import shutil
Expand Down Expand Up @@ -36,7 +35,7 @@ def url(self):
def name(self):
return Path(self.path).name

@cached_property
@property
def file(self):
return self._obj.get()['Body']

Expand Down

0 comments on commit d98faec

Please sign in to comment.