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 handling of paths with forward slashes on Windows #1049

Merged
merged 3 commits into from Jan 25, 2020

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Jan 23, 2020

I noticed with the UW SIFT application that paths returned by the file dialog (Qt5) always had forward slashes, even on Windows. This is expected behavior by Qt5. These forward slashes were causing Satpy to not recognize any of the filenames. While I could workaround this in SIFT, Satpy has other users in the past with this issue. I always thought this was a user problem, but now that I find out some applications/frameworks like Qt5 create paths like this, I think Satpy should have the fix.

The one thing I don't like about this PR is that it adds an extra step to get_filebase which is used multiple times in the reader loading process. I'm not sure if it is "better" to move this operation higher up in the reader loading functions for not. Additionally, I notice that match_filenames creates a list instead of returning a generator. It doesn't seem necessary to do this so I might change that too (feedback welcome).

  • Tests added and test suite added to parent suite
  • Tests passed
  • Passes flake8 satpy

@coveralls
Copy link

coveralls commented Jan 23, 2020

Coverage Status

Coverage increased (+0.03%) to 87.523% when pulling 7a0899e on djhoese:bugfix-windows-forward-slash into fa997a0 on pytroll:master.

@codecov
Copy link

codecov bot commented Jan 23, 2020

Codecov Report

Merging #1049 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1049      +/-   ##
==========================================
+ Coverage   87.49%   87.52%   +0.02%     
==========================================
  Files         188      188              
  Lines       29238    29245       +7     
==========================================
+ Hits        25582    25596      +14     
+ Misses       3656     3649       -7
Impacted Files Coverage Δ
satpy/tests/test_yaml_reader.py 99.57% <100%> (+0.43%) ⬆️
satpy/readers/yaml_reader.py 94.4% <100%> (ø) ⬆️
satpy/scene.py 89.91% <0%> (+0.17%) ⬆️
satpy/readers/__init__.py 94.56% <0%> (+1.2%) ⬆️

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 fa997a0...7a0899e. Read the comment docs.

@djhoese djhoese merged commit 7b8989f into pytroll:master Jan 25, 2020
@djhoese djhoese deleted the bugfix-windows-forward-slash branch January 25, 2020 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants