justindujardin / pathy

simple, flexible, offline capable, cloud storage with a Python path-like interface
Apache License 2.0
170 stars 23 forks source link

Fix/python3.9 #46

Closed justindujardin closed 3 years ago

justindujardin commented 3 years ago

Python 3.9 introduced a change to the way scandir is used in the guts of the pathlib.Path class. This causes KeyErrors to be thrown because Pathy's scandir function only works as a generator, not a contextmanager.

This PR refactors the scandir functionality to work as a context manager and a generator.

The root cause seems to be: https://bugs.python.org/issue39916

codecov[bot] commented 3 years ago

Codecov Report

Merging #46 (f84d3cb) into master (36c8de9) will increase coverage by 0.10%. The diff coverage is 87.20%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #46      +/-   ##
==========================================
+ Coverage   89.09%   89.20%   +0.10%     
==========================================
  Files           7        7              
  Lines         899      926      +27     
==========================================
+ Hits          801      826      +25     
- Misses         98      100       +2     
Impacted Files Coverage Δ
pathy/gcs.py 79.87% <81.25%> (+0.51%) :arrow_up:
pathy/file.py 88.38% <87.50%> (+0.30%) :arrow_up:
pathy/base.py 91.24% <93.33%> (-0.08%) :arrow_down:

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 36c8de9...f84d3cb. Read the comment docs.

justindujardin commented 3 years ago

:tada: This PR is included in version 0.3.5 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: