create_db and getDB do not accept `pathlib Paths`
See original GitHub issueDescribe the bug The operations in the title do not support a Path argument for the DB. Usage requires converting to string
How to reproduce
from pathlib import Path
from pysondb import db
BASE_DIR = Path(__file__).absolute().parent
AUDIT_PATH = BASE_DIR / "audit/"
AUDIT_DB = AUDIT_PATH / "audit_db.json"
def setup_audit_db() -> None:
"""setup_audit_db
Establishes the audit directory and database if
does not exist"""
print(f"Establishing audit database {AUDIT_DB}")
os.makedirs(AUDIT_PATH, exist_ok=True)
db.create_db(AUDIT_DB)
Expected behavior Expected that string or Path would work in the noted operations
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
pathlib — Object-oriented filesystem paths — Python 3.11.1 ...
Pure paths¶. Pure path objects provide path-handling operations which don't actually access a filesystem. There are three ways to access these classes, which...
Read more >python Path from pathlib module doesn't add path separator
Path cannot assume how the result will be used further, so it constructs the path object from the input data as is.
Read more >accept pathlib paths wherever a path/file is expected #11033
i'd like pd.read_table(some_path / 'filename.tsv') to work without going through str()
Read more >Python 3's pathlib Module: Taming the File System
Unfortunately, pathlib does not explicitly support safe moving of files. To avoid possibly overwriting the destination path, the simplest is to test whether ......
Read more >Python Path – How to Use the Pathlib Module with Examples
To understand how you can construct a basic path using Pathlib, ... In this case, PurePath() doesn't allow us to know the drive's...
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
Look forward to the change.
https://github.com/pysonDB/pysonDB-v2