Skip to content

Remove .pyc and .pyo files when updating - #9961

Merged
feerrenrut merged 1 commit into
nvaccess:thresholdfrom
BabbageCom:i9960
Jul 23, 2019
Merged

Remove .pyc and .pyo files when updating#9961
feerrenrut merged 1 commit into
nvaccess:thresholdfrom
BabbageCom:i9960

Conversation

@LeonarddeR

@LeonarddeR LeonarddeR commented Jul 23, 2019

Copy link
Copy Markdown
Collaborator

Link to issue number:

Fixes #9960

Summary of the issue:

When updating NVDA, old *.pyc and *.pyo files can stay around. This could be problematic for Python 2 pyc files that Python 3 tries to open. Furthermore, it could cause issues such as reported in #9960, where the logHandler gets really mad if it tries to log a traceback for a file in library.zip which is also available in the installation directory.

Description of how this pull request fixes the issue:

When removing old program files, check for *.pyc and *.pyo files and get rid of them/

Testing performed:

Placed a handyTech.pyc file in C:\Program Files (x86)\NVDA\brailleDisplayDrivers. Made sure it disappeared after installing the try build for this pr.

Known issues with pull request:

  1. This removes *,pyc and *.pyo files from systemConfig as well, but I think that's fine.
  2. This does not yet fix the issue where old braille display driver dll's stick around on the system, particularly handy tech, hims and alva.

Change log entry:

None needed

@LeonarddeR
LeonarddeR requested a review from feerrenrut July 23, 2019 08:00

@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 @LeonarddeR

@DrSooom

DrSooom commented Jul 24, 2019

Copy link
Copy Markdown
  1. This removes *,pyc and *.pyo files from systemConfig as well, but I think that's fine.

Perhaps only as long as add-ons weren't copied to that configuration folder via the GUI. Does the logon screen started instance of NVDA have write permission for this folder, as pyc and pyo files are created from the py files on NVDA startup? If this is the case, then the Installer should recommend to restart the PC after NVDA was successfully updated.

@LeonarddeR

LeonarddeR commented Jul 24, 2019 via email

Copy link
Copy Markdown
Collaborator Author

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