Skip to content

Commit

Permalink
Merge pull request #20 from hugovk/fix-encoding
Browse files Browse the repository at this point in the history
Fix encoding on Windows
  • Loading branch information
marcusvolz authored Sep 4, 2022
2 parents ebb5fa2 + b482ba6 commit 2b66523
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/stravavis/process_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def process_file(fpath):
# Function for processing an individual GPX file
# Ref: https://pypi.org/project/gpxpy/
def process_gpx(gpxfile):
activity = gpxpy.parse(open(gpxfile))
with open(gpxfile, encoding="utf-8") as f:
activity = gpxpy.parse(f)

lon = []
lat = []
Expand Down
2 changes: 1 addition & 1 deletion tests/gpx/activity_7448910422.gpx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<time>2021-09-02T07:10:04.000Z</time>
</metadata>
<trk>
<name>West Berkshire Cycling</name>
<name>West Berkshire Cycling 🍻</name>
<type>cycling</type>
<trkseg>
<trkpt lat="51.401515267789363861083984375" lon="-1.26182804815471172332763671875">
Expand Down

0 comments on commit 2b66523

Please sign in to comment.