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

Ugly traceback in PythonException #1359

Closed
@benoithudson

Description

@benoithudson

Environment

  • Pythonnet version: 2.5.0 and earlier
  • Python version: 3.7 and 2.7
  • Operating System: any
  • .NET Runtime: any

Details

  • Describe what you were trying to get done.

Within Unity, when a PythonException is thrown, we usually print the exception. It comes out looking like:

PythonException: TypeError : cannot create weak reference to 'PySideTestUI' object['  File "<string>", line 3, in <module>/n', '  File "/Users/bhudson/projects/com.unity.scripting.python/com.unity.scripting.python/Samples/PySideExample/PySideExample.py", line 168, in create_or_reinitialize/n    _PYSIDE_UI = PySideTestUI()/n', '  File "/Users/bhudson/projects/com.unity.scripting.python/com.unity.scripting.python/Samples/PySideExample/PySideExample.py", line 54, in __init__/n    self._dialog = self.load_ui_widget(ui_path.replace("////", "/"))/n', '  File "/Users/bhudson/projects/com.unity.scripting.python/com.unity.scripting.python/Samples/PySideExample/PySideExample.py", line 130, in load_ui_widget/n    ui.useCameraButton.clicked.connect(self.use_camera)/n']

All on one line. It's very hard to read.

The pythonnet issue is that we have a list of strings that got str() called on it rather than joining them. Then a separate bug is that something is flipping backslashes to slashes but I don't think that's pythonnet's responsibility.

The reason is here:https://github.com/pythonnet/pythonnet/blob/master/src/runtime/pythonexception.cs#L53

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp