[S] Change in pysim[master]: transport: show full traceback on failed reader init
laforge has abandoned this change. ( https://gerrit.osmocom.org/c/pysim/+/34687?usp=email ) Change subject: transport: show full traceback on failed reader init .. Abandoned dexter submitted the new approach here: I4c4807576fe63cf71a7d33b243a3f8fea0b7ff23 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34687?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I46e913a516dbc13f7610512484f515ab25d3fbae Gerrit-Change-Number: 34687 Gerrit-PatchSet: 6 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge Gerrit-Reviewer: osmith Gerrit-CC: fixeria Gerrit-MessageType: abandon
[S] Change in pysim[master]: transport: show full traceback on failed reader init
Attention is currently required from: fixeria, laforge, osmith. dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/34687?usp=email ) Change subject: transport: show full traceback on failed reader init .. Patch Set 6: (1 comment) File pySim/transport/__init__.py: https://gerrit.osmocom.org/c/pysim/+/34687/comment/fea4e2d2_348abe47 PS4, Line 318: except Exception as e > I am wondering if we really need to catch exceptions here. […] I also think that not catching the exception at all would be the better solution. The caller still has the option to handle the exception and print it nicely if he wants to. I submitted the new approach here: I4c4807576fe63cf71a7d33b243a3f8fea0b7ff23 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34687?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I46e913a516dbc13f7610512484f515ab25d3fbae Gerrit-Change-Number: 34687 Gerrit-PatchSet: 6 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge Gerrit-Reviewer: osmith Gerrit-CC: fixeria Gerrit-Attention: osmith Gerrit-Attention: laforge Gerrit-Attention: fixeria Gerrit-Comment-Date: Tue, 10 Oct 2023 10:38:43 + Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria Gerrit-MessageType: comment
[S] Change in pysim[master]: transport: show full traceback on failed reader init
Attention is currently required from: fixeria, laforge, osmith. dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/34687?usp=email ) Change subject: transport: show full traceback on failed reader init .. Patch Set 6: (1 comment) Commit Message: https://gerrit.osmocom.org/c/pysim/+/34687/comment/c4fdd4c7_b92988cd PS4, Line 9: failes > fails? Done -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34687?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I46e913a516dbc13f7610512484f515ab25d3fbae Gerrit-Change-Number: 34687 Gerrit-PatchSet: 6 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge Gerrit-Reviewer: osmith Gerrit-CC: fixeria Gerrit-Attention: osmith Gerrit-Attention: laforge Gerrit-Attention: fixeria Gerrit-Comment-Date: Tue, 10 Oct 2023 09:51:30 + Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria Gerrit-MessageType: comment
[S] Change in pysim[master]: transport: show full traceback on failed reader init
Attention is currently required from: dexter, laforge, osmith. Hello Jenkins Builder, laforge, osmith, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/34687?usp=email to look at the new patch set (#5). The following approvals got outdated and were removed: Code-Review+1 by osmith, Verified+1 by Jenkins Builder Change subject: transport: show full traceback on failed reader init .. transport: show full traceback on failed reader init When the reader initialization fails with an exception we may have a major hardware problem and it may not be enough to print only the exception message. Also in some rare cases an exception message may not be available. To make it easier to debug problems lets print the full traceback like we already do it in pySim-shell.py. Related: OS#6210 Change-Id: I46e913a516dbc13f7610512484f515ab25d3fbae --- M pySim/transport/__init__.py 1 file changed, 22 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/87/34687/5 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34687?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I46e913a516dbc13f7610512484f515ab25d3fbae Gerrit-Change-Number: 34687 Gerrit-PatchSet: 5 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge Gerrit-Reviewer: osmith Gerrit-CC: fixeria Gerrit-Attention: osmith Gerrit-Attention: laforge Gerrit-Attention: dexter Gerrit-MessageType: newpatchset
[S] Change in pysim[master]: transport: show full traceback on failed reader init
Attention is currently required from: dexter, laforge. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/34687?usp=email ) Change subject: transport: show full traceback on failed reader init .. Patch Set 4: (2 comments) Commit Message: https://gerrit.osmocom.org/c/pysim/+/34687/comment/1c968293_3119e18c PS4, Line 9: failes fails? File pySim/transport/__init__.py: https://gerrit.osmocom.org/c/pysim/+/34687/comment/44ffb089_e7bb2c3a PS4, Line 318: except Exception as e I am wondering if we really need to catch exceptions here. All we're doing is printing the backtrace and returning `None`, right? All callers of this function check the returned value and do `sys.exit()` if it's `None`. This kinda mimics what happens when you don't catch the exceptions at all and let them raise... I would suggest simply removing this `try-catch` block as well as all checks against `None` - this way we efficiently achieve the same result without any additional logic. -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34687?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I46e913a516dbc13f7610512484f515ab25d3fbae Gerrit-Change-Number: 34687 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge Gerrit-Reviewer: osmith Gerrit-CC: fixeria Gerrit-Attention: laforge Gerrit-Attention: dexter Gerrit-Comment-Date: Mon, 09 Oct 2023 14:51:39 + Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
[S] Change in pysim[master]: transport: show full traceback on failed reader init
Attention is currently required from: dexter. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/34687?usp=email ) Change subject: transport: show full traceback on failed reader init .. Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34687?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I46e913a516dbc13f7610512484f515ab25d3fbae Gerrit-Change-Number: 34687 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith Gerrit-Attention: dexter Gerrit-Comment-Date: Mon, 09 Oct 2023 10:56:28 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
[S] Change in pysim[master]: transport: show full traceback on failed reader init
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/34687?usp=email ) Change subject: transport: show full traceback on failed reader init .. transport: show full traceback on failed reader init When the reader initialization failes with an exception we may have a major hardware problem and it may not be enough to print only the exception message. Also in some rare cases an exception message may not be available. To make it easier to debug problems lets print the full traceback like we already do it in pySim-shell.py. Related: OS#6210 Change-Id: I46e913a516dbc13f7610512484f515ab25d3fbae --- M pySim/transport/__init__.py 1 file changed, 22 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/87/34687/1 diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py index 79f82c2..6bce674 100644 --- a/pySim/transport/__init__.py +++ b/pySim/transport/__init__.py @@ -5,6 +5,7 @@ import abc import argparse +import traceback from typing import Optional, Tuple from construct import Construct @@ -293,6 +294,7 @@ Init card reader driver """ sl = None # type : :Optional[LinkBase] + try: if opts.pcsc_dev is not None: print("Using PC/SC reader number %u" % opts.pcsc_dev) @@ -314,9 +316,8 @@ baudrate=opts.baudrate, **kwargs) return sl except Exception as e: -if str(e): -print("Card reader initialization failed with exception:\n" + str(e)) -else: -print( -"Card reader initialization failed with an exception of type:\n" + str(type(e))) +print("Card reader initialization failed with an exception:") +print("-8<-") +traceback.print_exc() +print("-8<-") return None -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34687?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I46e913a516dbc13f7610512484f515ab25d3fbae Gerrit-Change-Number: 34687 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-MessageType: newchange