Invalid paths are currently detected by catching OsError exceptions, as shown below. This doesn't actually seem to work.
- Create unit tests as needed to clarify what works and what doesn't.
- Identify and implement an invalid path test that passes all unit tests.
# Process the response from the receiver/user into a Path object
processed_response = None
msg = ''
try:
processed_response = Path(raw_response)
except OSError:
# Craft error message
msg = f"\n\'{raw_response}\' is not a valid file path. Please try again."
return (processed_response, msg)
Invalid paths are currently detected by catching OsError exceptions, as shown below. This doesn't actually seem to work.