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
fixed handling of input filenames with non-ascii characters [processing] #8968
Conversation
Hi victor, can you check if there is already a test for out file with non-ascii chars? if not would be fine create a simple test... just duplicate one of the already available but set the output non-ascii... or create a unit test for that part of SagaAlgorithm.py |
Good catch, Luigi. Actually, I thought that both of the issues indicated in the comment where about the same (they are marked as possible duplicates), but they are not. One refers to inputs, and another to outputs. I fixed the inputs, but not the outputs. Will redo the commit to remove the issue mention in there. With outputs, it looks like SAGA can handle non-ascii chars, but then the file it generates has strange characters, so it wont be in the same path that the user selecteed, and Processing will show error. Fixing that will require a different approach (although it requires this fix as well, to be able to write the script file), probably creating the file with a safe name and then renaming. Will work on that and create a separate PR with the corresponding tests. |
Looks like there is no problem now in SAGA when using filenames with non-ascii chars, so some code used for replacing filenames has been removed. Also some code for python2, which is not needed now. fixes #18617
Looks good to me. |
@@ -396,12 +396,6 @@ def exportRasterLayer(self, parameterName, layer): | |||
else: | |||
filename = os.path.basename(layer.source()) | |||
|
|||
validChars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the Travis issue is stemming from allowing "." characters now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I added that code back, just in case
I added the code to handle non-ascii in outputs as well. Still missing a test, though |
Tests added |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
@volaya any plan to fix the test? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again approved
@volaya please backport soon... packaging will be tomorrow 22/02! |
Description
Fixed handling of input filenames with non-ascii characters.
Both raster and vector layers used as input for SAGA can now contain non-ascii chars.
Looks like there is no problem now in SAGA when using filenames with non-ascii chars, so some code used for replacing filenames has been removed. Also some code for python2, which is not needed now.
fixes #18617
It would be good if someone could test this in Linux before merging. Should work, but just in case SAGA behaves differently there.
Checklist
fixes #11111
in the commit message next to the description[FEATURE]
in the commit message[needs-docs]
in the commit message and contain sufficient information in the commit message to be documentedscripts/prepare-commit.sh
script before each commit