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

check_example_io_plugin_fails_with_python_backtrace fails with Python 3.13 due to changed backtrace format #374

Closed
AdamWill opened this issue May 2, 2024 · 2 comments

Comments

@AdamWill
Copy link

AdamWill commented May 2, 2024

Python 3.13 changes the backtrace format, so instead of what the test expects to see:

Example sudo python plugin will log to /some/not/writable/directory/sudo.log
Traceback:
  File "SRC_DIR/example_io_plugin.py", line 64, in __init__
    self._open_log_file(path.join(log_path, "sudo.log"))
  File "SRC_DIR/example_io_plugin.py", line 134, in _open_log_file
    self._log_file = open(log_path, "a")

We get this:

Example sudo python plugin will log to /some/not/writable/directory/sudo.log
Traceback:
  File "SRC_DIR/example_io_plugin.py", line 64, in __init__
    self._open_log_file(path.join(log_path, "sudo.log"))
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "SRC_DIR/example_io_plugin.py", line 134, in _open_log_file
    self._log_file = open(log_path, "a")
                     ~~~~^^^^^^^^^^^^^^^

There are two obvious ways to deal with this - expect different output for Python 3.13+ and Python <= 3.12, or drop the lines containing only ~, ^ and whitespace characters before doing the comparison - but I'm not much of a C coder so I don't know how to do the second off the top of my head (I will try and figure it out, though), and I don't know if there's a 'standard' way of checking the Python version that we should use if going down that path...

@millert
Copy link
Collaborator

millert commented May 3, 2024

Thanks for the heads-up. This is fixed by 89918ca

@millert millert closed this as completed May 3, 2024
@AdamWill
Copy link
Author

AdamWill commented May 3, 2024

oh, hey, you already had a thing. handy! thanks. :)

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

No branches or pull requests

2 participants