Skip to content
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

PCAN: Fix Detection of Library on Windows on ARM #1463

Merged
merged 1 commit into from Dec 21, 2022
Merged

PCAN: Fix Detection of Library on Windows on ARM #1463

merged 1 commit into from Dec 21, 2022

Conversation

sanssecours
Copy link
Contributor

Before this commit detection of the PCAN DLL would fail on Windows on ARM, regardless if you used the native Python version, or the x64 version of Python. After this fix detection should work properly as long as the PCAN library for your version of Python is listed first in the PATH variable. The default:

  1. C:\Program Files\PEAK-System\PEAK-Drivers 4\APIs\ARM64\ before
  2. C:\Program Files\PEAK-System\PEAK-Drivers 4\APIs\x64\

should work if you use the (native) ARM version of Python. If you reorder these paths, then loading the library works in the x64 version of Python.

I tested the fix on the native version of Python 3.11 and the x64 version of Python 3.10 in Window on ARM, where everything seemed to work as expected. For more information, please take a look at issue #1461.

Before this commit detection of the PCAN DLL would fail on Windows on
ARM, regardless if you used the native Python version, or the x64
version of Python. After this fix detection should work properly as long
as the PCAN library for your version of Python is listed first in the
`PATH` variable. The default:

1. `C:\Program Files\PEAK-System\PEAK-Drivers 4\APIs\ARM64\` before
2. `C:\Program Files\PEAK-System\PEAK-Drivers 4\APIs\x64\`

should work if you use the (native) ARM version of Python. If you
reorder these paths, then loading the library works in the x64 version
of Python.

This commit closes #1461.
@sanssecours
Copy link
Contributor Author

Looks like the test suite does not like the Window emoji (🪟) on Windows:

...
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001fa9f' in position 21: character maps to <undefined>
[44](https://github.com/hardbyte/python-can/actions/runs/3748530924/jobs/6369914247#step:5:45)
  gh: FAIL code 2 (13.53 seconds)
[45](https://github.com/hardbyte/python-can/actions/runs/3748530924/jobs/6369914247#step:5:46)
  evaluation failed :( (13.75 seconds)

At least that is what I would assume from the output of the Python code:

print("\U0001fa9f")

Should I reopen the pull request from a different different branch (that only contains ASCII characters)?

@felixdivo
Copy link
Collaborator

I'd suggest just merging this. @hardbyte?

@zariiii9003
Copy link
Collaborator

zariiii9003 commented Dec 21, 2022

Where is the emoji coming from? pip?

Edit: Your branch name... i see 😄

@zariiii9003 zariiii9003 merged commit e9252de into hardbyte:develop Dec 21, 2022
@sanssecours sanssecours deleted the 🪟 branch December 21, 2022 18:31
@zariiii9003
Copy link
Collaborator

I merged it and now the CI fails, oops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to Load PCANBasic Module on Windows on ARM
3 participants