Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Provide more info about failuers to load CLR assemblies#1076

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

lostmsu
Copy link
Member

What does this implement/fix? Explain your changes.

  1. When trying to implicitly load assemblies, and that failsnot because an assembly is missing, but because loading failed for some reason, emit Python warning.
  2. When trying to import a module in our import hook, if the module name is an assembly name, and CLR fails to load it, and Python also fails to find a module with the same name, add the exceptions we got from both during the attempt into__cause__ attribute of the finalImportError.

BREAKING:clr.AddReference will now throw exceptions besidesFileNotFoundException.

Additional: a few uses ofBorrowedReference

Does this close any currently open issues?

This addresses#261
It is an alternative to#298

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example

@lostmsulostmsuforce-pushed thePR/ImportErrorImprovement branch from645687e to4e1ea84CompareMarch 4, 2020 02:47
@lostmsulostmsuforce-pushed thePR/ImportErrorImprovement branch 2 times, most recently fromccf5203 toe6610ebCompareApril 27, 2020 21:35
@lostmsulostmsuforce-pushed thePR/ImportErrorImprovement branch frome6610eb to46a51d4CompareMay 13, 2020 21:05
@codecov-io
Copy link

Codecov Report

Merging#1076 intomaster willnot change coverage.
The diff coverage isn/a.

Impacted file tree graph

@@           Coverage Diff           @@##           master    #1076   +/-   ##=======================================  Coverage   86.66%   86.66%           =======================================  Files           1        1             Lines         300      300           =======================================  Hits          260      260             Misses         40       40
FlagCoverage Δ
#setup_linux65.33% <ø> (ø)
#setup_windows72.00% <ø> (ø)

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update72fae73...46a51d4. Read thecomment docs.

@lostmsulostmsu added this to the3.0.0 milestoneMay 14, 2020
if (Path.IsPathRooted(name))
{
if (!Path.HasExtension(name))
if (!Path.HasExtension(name) && Runtime.InteropVersion < new Version(3, 0))
Copy link
Member

Choose a reason for hiding this comment

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

If this was for compatibility, you can probably remove it.

@filmor
Copy link
Member

Fine by me, but please add a changelog entry for the breaking change.

@lostmsulostmsuforce-pushed thePR/ImportErrorImprovement branch 4 times, most recently from58ef45f to37df647CompareAugust 18, 2020 20:43
…ore info when CLR assemblies are failed to be loaded1. When trying to implicitly load assemblies, and that fails NOT because an assembly is missing, but because loading failed for some reason, emit Python warning.2. When trying to import a module in our import hook, if the module name is an assembly name, and we fail to load it, and Python also fails to find a module with the same name, add the exceptions we got during the attempt to load it into __cause__ of the final ImportErrorBREAKING: clr.AddReference will now throw exceptions besides FileNotFoundException.Additional: a few uses of BorrowedReferenceThis addressespythonnet#261It is an alternative topythonnet#298
@lostmsulostmsuforce-pushed thePR/ImportErrorImprovement branch from37df647 to6eb9258CompareAugust 18, 2020 21:14
@lostmsu
Copy link
MemberAuthor

I dropped the update, that tried to remove legacy "CLR." module from this change, as it started growing in scope, and is not directly related to this change.

filmor reacted with thumbs up emoji

@codecov-commenter
Copy link

codecov-commenter commentedAug 18, 2020
edited
Loading

Codecov Report

Merging#1076 intomaster willnot change coverage.
The diff coverage isn/a.

Impacted file tree graph

@@           Coverage Diff           @@##           master    #1076   +/-   ##=======================================  Coverage   86.25%   86.25%           =======================================  Files           1        1             Lines         291      291           =======================================  Hits          251      251             Misses         40       40
FlagCoverage Δ
#setup_linux64.94% <ø> (ø)
#setup_windows72.50% <ø> (ø)

Flags with carried forward coverage won't be shown.Click here to find out more.


Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update3e1fc2e...6eb9258. Read thecomment docs.

@lostmsulostmsu merged commit5b989cb intopythonnet:masterAug 19, 2020
@lostmsulostmsu deleted the PR/ImportErrorImprovement branchAugust 19, 2020 06:29
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@filmorfilmorfilmor approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
3.0.0
Development

Successfully merging this pull request may close these issues.

4 participants
@lostmsu@codecov-io@filmor@codecov-commenter

[8]ページ先頭

©2009-2025 Movatter.jp