The current code fails on windows because of the forward slashes; using os.path.join solves the problem and it is in general more robust
test: avoid os-dependant path #18952
pull fametrano wants to merge 1 commits into bitcoin:master from fametrano:patch-2 changing 1 files +12 −2-
fametrano commented at 8:31 PM on May 11, 2020: contributor
-
8a22fd0114
avoided os-dependant path
The current code fails on windows because of the forward slashes; using os.path.join solves the problem and it is in general more robust
- fametrano renamed this:
avoided os-dependant path
avoid os-dependant path
on May 11, 2020 - DrahtBot added the label Tests on May 11, 2020
-
fanquake commented at 9:52 AM on May 13, 2020: member
@sipsorcery want to take a look here & confirm the fix for windows?
-
sipsorcery commented at 9:55 AM on May 13, 2020: member
Hmm Windows should typically be able to deal with
/paths. Maybe it's a Python on Windows problem. I'll verify. -
MarcoFalke commented at 10:39 AM on May 13, 2020: member
Jup, I don't think this is a bug fix. We've been running the functional tests on windows just fine.
-
elichai commented at 12:30 PM on May 13, 2020: contributor
FWIW, In the future if we really want to be have the slashes agnostic, we can use
pathlib.Pathwhich overrides the Div operator to insert slashes so you could do:Path(some_path) / 'src' / 'bitcoind'. -
laanwj commented at 1:23 PM on May 13, 2020: member
I like using
os.path.joinhere (it's consistent—what we use in other places too). But yes, please change the motivation if it's a refactor not a fix. -
sipsorcery commented at 5:43 PM on May 13, 2020: member
I can verify that the current
test_framework.pyonmasterdoesn't have any path issues when run on Windows.It's hard to see where it could ever become a problem since modern day Windows accepts
/as an alternative path separator.The command below works fine on my Windows 10 machine:
cd c:/dev\github/sipsorcery_bitcoin//build_msvc -
fametrano commented at 1:11 AM on May 16, 2020: contributor
I import the test suite code in another project to automate regtest testing: when looking for the bitcoind binary on a Windows 10 machine, Python 3.8.2, no WSL, the original code fails. Also, just two lines below the code is using os.path.join, so consistency is lacking
- MarcoFalke renamed this:
avoid os-dependant path
test: avoid os-dependant path
on May 16, 2020 -
MarcoFalke commented at 10:12 AM on May 16, 2020: member
ACK 8a22fd01140bd957036fc00419b147e4268ae9b1
- MarcoFalke merged this on May 16, 2020
- MarcoFalke closed this on May 16, 2020
- sidhujag referenced this in commit dc527842e6 on May 17, 2020
- Fabcien referenced this in commit d733ebb73f on Feb 1, 2021
- DrahtBot locked this on Feb 15, 2022