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.

util.files should support pathlib objects

See original GitHub issue

Description

Title says it all: now that #896 is implemented, we can support pathlib natively.

Steps/Code to Reproduce

import librosa
librosa.util.find_files(pathlib.Path('foo', 'bar'))  # search in foo/bar

ought to work. Right now it fails.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bmcfeecommented, Jun 22, 2020

It turns out that this just works out of the box, and no changes are necessary. Closing this one out.

1reaction
bmcfeecommented, Mar 2, 2020

@SuperKogito cool, thanks for volunteering!

Essentially, yes, it gives you a list of audio files in the given path. There are several options though (extensions, subdirectory search, case-sensitivity, etc), so it’s a bit more complex than one might expect at a first glance. Hopefully the documentation explains things thoroughly enough, but feel free to ask for clarification on the expected behavior.

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 To Use the pathlib Module to Manipulate Filesystem ...
The Path constructor intelligently handles both types of objects and cleanly joins them using the appropriate operating system separator, in ...
Read more >
Five Most Useful Pathlib Operations | by Jenny Lee - Medium
4. Get the full path of a file or directory. The .resolve() method will return a new path object with the absolute path...
Read more >
Python Path – How to Use the Pathlib Module with Examples
Here, Pure path class objects will help you get the path working on your machine with some basic operations like creating child paths...
Read more >
read_* functions should support pathlib objects #6657 - GitHub
Describe the problem This currently throws an error: import pathlib import mne data_dir = pathlib.Path('/Users/hoechenberger/Projects/TaLa/' ...
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