-
-
Notifications
You must be signed in to change notification settings - Fork 628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove pyd file in installation folder #10070
Conversation
@larry801 @LeonarddeR can you test this? |
Hello @clementb49, |
Hi, For this one, a changelog isn't quite necessary unless @LeonarddeR says otherwise. Thanks. |
This approach would also remove .pyd files from systemConfig directory, right? If so it might break |
Yes, pyd files in systemConfig is definitely different. Thanks for pointing this out. |
What do you think i need to detect if it is a pyd file in the systemconfig folder and not delete it or we leave it like this.
Clément Boussiron
… Le 12 août 2019 à 11:13, Leonard de Ruijter ***@***.***> a écrit :
Yes, pyd files in systemConfig is definitely different. Thanks for pointing this out.
Having said that, I wonder whether there are any add-ons with pyd files in them. If so, that should be strongly discouraged anyway.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@josephsl might know whether there are add-ons supplying pyd files |
Looking at the add-ons which I have curenty installed two of them namely OCR, and WinWizard are bundling .pyd files. They aren't very useful in the systemConfig in my opinion,. Even if we don't know about any add-on doing this better to be safe than sorry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As pointed out, the current code removes *.pyd from the systemCOnfig directory.
I think the following suggestion is what we want. It removes all pyd files from all folders (including systemConfig), except for the pyd files that are declared compatible with the python release NVDA is based on (i.e. ending with .cp37-win32.pyd
source/installer.py
Outdated
@@ -210,7 +210,7 @@ def removeOldProgramFiles(destPath): | |||
# in a newer version of NVDA. | |||
for curDestDir,subDirs,files in os.walk(destPath): | |||
for f in files: | |||
if f.endswith((".pyc", ".pyo")): | |||
if f.endswith((".pyc", ".pyo", ".pyd")): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be the best approach.
if f.endswith((".pyc", ".pyo", ".pyd")): | |
if f.endswith((".pyc", ".pyo", ".pyd")) and not f.endswith(importlib.machinery.EXTENSION_SUFFIXES[0]): |
make sure to import importlib.machinery
at the top of the file.
Hi, I know that Resource Monitor is one of those that bundle a C extension DLL (.pyd). Thanks.
From: Leonard de Ruijter <notifications@github.com>
Sent: Monday, August 12, 2019 3:08 AM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Joseph Lee <joseph.lee22590@gmail.com>; Mention <mention@noreply.github.com>
Subject: Re: [nvaccess/nvda] remove pyd file in installation folder (#10070)
@josephsl <https://github.com/josephsl> might know whether there are add-ons supplying pyd files
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#10070?email_source=notifications&email_token=AB4AXEADLKV43DRNLXPQP2DQEEZB3A5CNFSM4IK3T4TKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4CCYHQ#issuecomment-520367134> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AB4AXEBJ27FE7VWYU3SOPNTQEEZB3ANCNFSM4IK3T4TA> .
|
Ok, I update this PR with the change requested.
Thanks for your feedback.
Clément Boussiron
… Le 12 août 2019 à 15:45, Joseph Lee ***@***.***> a écrit :
Hi, I know that Resource Monitor is one of those that bundle a C extension DLL (.pyd). Thanks.
From: Leonard de Ruijter ***@***.***>
Sent: Monday, August 12, 2019 3:08 AM
To: nvaccess/nvda ***@***.***>
Cc: Joseph Lee ***@***.***>; Mention ***@***.***>
Subject: Re: [nvaccess/nvda] remove pyd file in installation folder (#10070)
@josephsl <https://github.com/josephsl> might know whether there are add-ons supplying pyd files
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#10070?email_source=notifications&email_token=AB4AXEADLKV43DRNLXPQP2DQEEZB3A5CNFSM4IK3T4TKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4CCYHQ#issuecomment-520367134> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AB4AXEBJ27FE7VWYU3SOPNTQEEZB3ANCNFSM4IK3T4TA> .
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@LeonarddeR this PR is now updated with your requested change. |
Why not just remove all pyd file in destPath? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @clementb49
That will still leave old, incompatible pyd files in systemConfig add-ons |
Hello I am the author of Character Information addon which uses .pyd files (to get last version of unicodedata2). Here are my thoughts about .pyd files removal in the addons.
Reading this ticket however, makes me think that I should look not only at python major version but also at mid version number (7) since I include unicodedata2.cp37-win32.pyd. At least, here is a use case when removing .pyd of the extensions will fail in the hypothesis NVDA installer removes the .pyd files not linked to current python version.
|
Note that removing pyd files only applies to the systemConfig directory
in the NVDA program files, in which directory add-ons are installed that
are used at the logon screen. I doubt that your add-on would ever be
used on the logon screen.
Having said that, I don't think Python 3.7 would ever load a file that
ends with .cp38-win32.pyd, so I can live with a patch that removes every
pyd file except for those ending with .cp3*-win32.pyd
|
Oh sorry, I did not realize that this is only for logon screen. |
It turns out that .pyd files are also removed from userConfig in case of portable copies. If someone wants to provide support for versions of NVDA based on Python 3 but still make his add-on compatible with Python 2 it wouldn't work for users of portable copies. Also configurations aren't version dependent, so if someone installs Python 3 version of NVDA as a portable, then use this version to install NVDA, and then downgrade for some reason to Python 2 version his add-onns would not be functional. The quick fix for that would be not to touch userConfig at all. |
@lukaszgo1 to be clear, are you suggesting this pr be reverted? That is fine if yes. I found your comment a little hard to follow though. |
@michaelDCurran I have created #10224 to fix the problem described above. As long as it would be merged before 2019.3 there is no reason to revert this one. |
* Stop removing compiled Python files from user and system configs during update of NVDA. - In addition remove all .dll and manifest files. - stop removing mpr.dll explicitly - it is removed along with all other libraries. * Review actions.
Link to issue number:
Fixes #10063
Summary of the issue:
If you upgrade from NVDA python 2 to NVDA python 3, it is necessary to remove pyc, pyo, pyd files.
The problem is that the current alpha version of nvda removes just pyc, pyd files.
Description of how this pull request fixes the issue:
This PR adds the ability to the installer to remove pyd files.
Testing performed:
Placed a handyTech.pyd 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:
None
Change log entry:
None