pydtl-relativepath tool from pydtl community can be used to solve many issues that occurs with relative paths and imports from various modules in your complex framework.
MIT License
0
stars
0
forks
source link
pathlib objext does not work with normal string operations #15
def _validate_path(self, path: str):
if not os.path.isfile(path):
raise FileNotFoundError(f"File not found at path: {path}")
if not path.endswith(".xlsx"):
raise ValueError("File should be in Excel format")
Error : FileNotFoundError: File not found at path: "<folder>Testplan.xlsx"
System Info
Windows 10
python version: 3.11.6 (64-bit)
pydtl-relative_path: 0.2.0
Checked other resources
Description
After constructing the path, I am trying to parse and check if it is an Excel file. the logic for that is developed in normal string manipulations.
Reproduce Steps
sample code:
Error Message and Stack Trace (if applicable)
Error :
FileNotFoundError: File not found at path: "<folder>Testplan.xlsx"
System Info
Windows 10 python version: 3.11.6 (64-bit) pydtl-relative_path: 0.2.0