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

Adding more input context to all error messages. #581

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

MicahGale
Copy link
Collaborator

Description

Please include a summary of the change and which issue is fixed if applicable. Please also include relevant motivation and context.

Fixes #579

Checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

@MicahGale MicahGale changed the title Tried to add specific error wrapper for @tjlaboss Adding more input context to all error messages. Oct 23, 2024
@tjlaboss
Copy link
Collaborator

Traceback (most recent call last):
  File "grab_beginning_comment.py", line 1, in <module>
    import montepy
  File "montepy/__init__.py", line 10, in <module>
    from . import input_parser
  File "montepy/input_parser/__init__.py", line 6, in <module>
    from . import input_reader
  File "montepy/input_parser/input_reader.py", line 2, in <module>
    from montepy import mcnp_problem
  File "montepy/mcnp_problem.py", line 397
    f"{'\n'.join(obj._input.input_lines)}"
                                          ^
SyntaxError: f-string expression part cannot include a backslash

@MicahGale
Copy link
Collaborator Author

What version of python was this on? I didn't get a syntax error in 3.12.

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.

Print active line when error occurs during reading
2 participants