Motivation
os.path
is quite verbose in the tests and is problematic, because strings can be appended to it, for example it is possible to type:
0>>> os.path.join('a/') + '/../b.txt'
1'a//../b.txt'
This may lead to issues down the line when the tests are run on Windows and expect a different path separator.
Possible solution
While some uses of os.path
are hard(er) to replace, with questionable benefits, I think removing the use of TestNode.datadir
and replacing it with TestNode.datadir_path
is a good first step.
Useful Skills
- Compile Bitcoin Core and run the python tests
- Basic familiarity with the Bitcoin Core RPC, and the python tests
os.path
andpathlib
knowledge
Guidance for new contributors
Want to work on this issue?
For guidance on contributing, please read CONTRIBUTING.md before opening your pull request.