Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix path encoding#978

Merged
tiangolo merged 4 commits into
fastapi:masterfrom
patrickmckenna:fix-path-encoding
Feb 16, 2020
Merged

Fix path encoding#978
tiangolo merged 4 commits into
fastapi:masterfrom
patrickmckenna:fix-path-encoding

Conversation

@patrickmckenna

@patrickmckenna patrickmckenna commented Feb 13, 2020

Copy link
Copy Markdown
Contributor

This PR adds a case to jsonable_encoder so that pathlib.PurePath objects are serializable. Related to #563.

I know there was some discussion in that thread about how to handle the OS-dependent str representations of pathlib.Path objects. Perhaps I'm misunderstanding something, but shouldn't users who need OS-agnostic treatment of paths be using pathlib.Pure*Path types to get str representations in their native form, no matter where their code is running?

/cc @devtud

@codecov

codecov Bot commented Feb 13, 2020

Copy link
Copy Markdown

Codecov Report

Merging #978 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #978   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files         294    294           
  Lines        7717   7732   +15     
=====================================
+ Hits         7717   7732   +15
Impacted Files Coverage Δ
fastapi/encoders.py 100% <100%> (ø) ⬆️
tests/test_jsonable_encoder.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66954c7...379921a. Read the comment docs.

@tiangolo tiangolo merged commit 3c18038 into fastapi:master Feb 16, 2020
@tiangolo

Copy link
Copy Markdown
Member

Awesome! Thank you for your contribution! 🚀 🍰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants