Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix encoding on Windows #20

Merged
merged 3 commits into from
Sep 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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