FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fixed TupleCodec not clearing Python exception after unsuccessful decoding by lostmsu · Pull Request #1083 · pythonnet/pythonnet · GitHub

Repository navigation

Fixed TupleCodec not clearing Python exception after unsuccessful decoding - #1083

Merged
filmor merged 1 commit into
pythonnet:masterfrom
losttech:PR/TupleCodec/ClearError
Mar 10, 2020
Merged

filmor merged 1 commit into
pythonnet:masterfrom
losttech:PR/TupleCodec/ClearError

Conversation

lostmsu commented Mar 9, 2020

Copy link
Copy Markdown
Member

What does this implement/fix? Explain your changes.

When TupleCodec.TryDecode is trying to decode a tuple from Python to .NET, and the element type in Python does not match one in .NET, Converter.ToManaged on that element will fail and leave PyErr set. That caused it to be picked up later by a random check for PyErr and raised as .NET exception in unexpected places.

This change clears PyErr in TryDecode if decoding of an element fails, thus allowing other codecs/overloads to be probed safely.

Copy link
Copy Markdown

Codecov Report

Merging #1083 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1083   +/-   ##
=======================================
  Coverage   86.75%   86.75%           
=======================================
  Files           1        1           
  Lines         302      302           
=======================================
  Hits          262      262           
  Misses         40       40
Flag Coverage Δ
#setup_linux 65.56% <ø> (ø) ⬆️
#setup_windows 71.52% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 925c166...b501931. Read the comment docs.

lostmsu added this to the 2.4.1 milestone Mar 9, 2020
filmor merged commit a320d49 into pythonnet:master Mar 10, 2020
lostmsu deleted the PR/TupleCodec/ClearError branch March 10, 2020 20:16
lostmsu modified the milestones: 2.4.1, 2.5.0 Apr 23, 2020
AlexCatarino pushed a commit to QuantConnect/pythonnet that referenced this pull request Jun 29, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL