Consistent File Access (using pathlib.Path instead of os.path)
See original GitHub issueWe use both os
and pathlib
libraries for reading/writing files. I’d like to fix up the code to use either or. We can have a discussion on which is better here, but it seems a bit weird having two libs in that do the same thing
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Python 3's pathlib Module: Taming the File System
With pathlib , file paths can be represented by proper Path objects instead of plain strings as before. These objects make code dealing...
Read more >Why You Should Start Using Pathlib as an Alternative to the ...
Let's assume you have a Path object that points to a directory. Pathlib allows you to easily iterate over that directory's content and...
Read more >Pathlib vs. os.path.join in Python - Stack Overflow
The documentation for pathlib says that "For low-level path manipulation ... (commas instead of slashes) to join paths with pathlib as well:.
Read more >Introduction to the Python Pathlib Module - Stack Abuse
The Pathlib module in Python simplifies the way in working with files and folders. The Pathlib module is available from Python 3.4 and ......
Read more >pathlib and paths with arbitrary bytes - Stein Magnus Jodal
In this post, I'll have a look at how pathlib can be used to handle file paths containing arbitrary bytes, as this is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For example, this line: https://github.com/mtgjson/mtgjson-python/blob/8666ea0e10c152e97936c2440857512604e10f79/mtgjson4/mtg_http.py#L135
could be rewritten as:
Sounds like a solid argument to me.
Ticket update: Move away from
os.path
->pathlib.Path