Skip to content

MoveFileEx: catch WindowsError instead of WinError - #9876

Merged
feerrenrut merged 5 commits into
nvaccess:threshold_py3_stagingfrom
josephsl:moveFileExOSError
Jul 11, 2019
Merged

MoveFileEx: catch WindowsError instead of WinError#9876
feerrenrut merged 5 commits into
nvaccess:threshold_py3_stagingfrom
josephsl:moveFileExOSError

Conversation

@josephsl

@josephsl josephsl commented Jul 5, 2019

Copy link
Copy Markdown
Contributor

Link to issue number:

Follow-up to #9847

Summary of the issue:

In installer, MoveFileEx catches wrong exception.

Description of how this pull request fixes the issue:

Instead of catching WinError, catch WindowsError (an alias of OSError in Python 3).

Testing performed:

Tested in Python 3 interpreter and NvDA console.

Known issues with pull request:

None

Change log entry:

None

@josephsl
josephsl requested a review from feerrenrut July 5, 2019 17:08
@LeonarddeR

Copy link
Copy Markdown
Collaborator

I don't think WinError was ever an exception. Should have been WindowsError, which is an alias of OSError on Python 3.

@josephsl

josephsl commented Jul 5, 2019 via email

Copy link
Copy Markdown
Contributor Author

Comment from Leonard de Ruijter (Babbagecom): WindowsError is an alias of OSError in Python 3, so just use this unless real-life testing shows OSError must be used.
@josephsl josephsl changed the title MoveFileEx: catch OSError instead of WinError MoveFileEx: catch WindowsError instead of WinError Jul 5, 2019
@feerrenrut

Copy link
Copy Markdown
Contributor

Can you confirm that this will put the windows error code in the log please?

@josephsl

josephsl commented Jul 8, 2019 via email

Copy link
Copy Markdown
Contributor Author

josephsl added 2 commits July 8, 2019 10:20
…ge when MoveFileEx fails.

Comment from Reef Turner (NV Access): add exception traceback info for WindowsError.
@LeonarddeR

Copy link
Copy Markdown
Collaborator

@feerrenrut: I think this is important to go into threshold_py3_staging before merging it into threshold. It is currently preventing me from updating a copy.

@feerrenrut feerrenrut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @josephsl

@feerrenrut
feerrenrut merged commit 2c7680c into nvaccess:threshold_py3_staging Jul 11, 2019
@nvaccessAuto nvaccessAuto added this to the 2019.3 milestone Jul 11, 2019
@josephsl
josephsl deleted the moveFileExOSError branch September 16, 2019 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants