Closed unode closed 6 years ago
A simple workaround could be to replace any /
or \
(windows) in the string by _
.
@luispedro Realized one use-case of this code that got broken with the above fix.
/path/to/file1
/another/path/to/file2
samples = readlines('file_with_full_paths.txt')
sample = lock1(samples)
sample
now contains _path_to_file1
which follows the fix above makes the variable sample
useless for users.
Do you see any problem in returning /path/to/file1
from lock1()
regardless of the name used for the lock?
Yeah, that's how it should work.
Fix in in place. Only missing a test-case to avoid future regressions. Not sure how to go about testing this thought.
Thanks! This should be mentioned in the ChangeLog
and What's New page for 1.0
Test could be:
ngless "0.9"
print(lock1(['testing/slashes\\ and spaces']))
That last was already https://github.com/ngless-toolkit/ngless/blob/master/tests/parallel_folder_lock/lock.ngl minus the print()
.
Now it tests this too.
The idea of adding print
is that you can test whether the result is correct by having a output.stdout.txt
file.
Yup: https://github.com/ngless-toolkit/ngless/commit/2eff0333f595d472a2aa0bc85bb5f39066c3626b - What I was missing is that the tests run with --quiet
.
errors with: