question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Replace all `os.path` in ignite and tests by `pathlib.Path`

See original GitHub issue

Let’s update the codebase and tests:

  1. replace all os.path.exists(folder) usage by Path(folder).exists()
  2. replace all os.path.join(a, b) by Path(a) / b
  3. replace os.makedirs(folder) by Path.mkdir(folder, parents=True)
  4. update all folder/files being str to Union[str, Path] and make all folder/file-like attributes as Path objects.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
vfdev-5commented, Jan 20, 2022

@nishithshowri006 there is #2422 PR covering a part of it.

1reaction
parthvaidyacommented, Jan 13, 2022

No let Yash work as I actually got caught up in something else

Read more comments on GitHub >

github_iconTop Results From Across the Web

pathlib — Object-oriented filesystem paths — Python 3.11.1 ...
Source code: Lib/pathlib.py This module offers classes representing filesystem paths with semantics appropriate for different operating systems.
Read more >
How can I replace a substring in a Python pathlib.Path?
Rename this path to the given path, clobbering the existing destination if it exists, and return a new Path instance pointing to the...
Read more >
Python 3's pathlib Module: Taming the File System
In this tutorial, you will see how to work with file paths—names of directories and files—in Python. You will learn new ways to...
Read more >
Replace `os.path` with `pathlib`? · Issue #4916 - GitHub
Path objects and methods to manipulate directories and files instead of the string manipulators in os.path.* and gain a lot of code readability....
Read more >
Migrating from OS.PATH to PATHLIB Module in Python
In this article, I will go over the most frequent tasks related to file paths and show how you can refactor the old...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found