Skip to content

Improve checking for invalid path in _doProcessRawResponse() method of UserQueryCommandPathSave/Open classes #2

@KevinRGeurts

Description

@KevinRGeurts

Invalid paths are currently detected by catching OsError exceptions, as shown below. This doesn't actually seem to work.

  1. Create unit tests as needed to clarify what works and what doesn't.
  2. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions