This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2019-07-01.10:15:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1561976106.06.0.0411152988485.issue37467@roundup.psfhosted.org>
In-reply-to
Content
The bug can be reproduced on the master branch of Python. I tested with versions:

* lxml 4.3.4
* xmlsec 1.3.3  

The filename comes from a lxml.etree.XMLSyntaxError exception which inherits from SyntaxError. The bug can be reproduced without lxml nor xmlsec, just with attached excepthook_syntaxerror.py:

$ ./python excepthook_syntaxerror.py
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/excepthook_syntaxerror.py", line 3, in <module>
    raise SyntaxError("msg", (b"bytes_filename", 123, 0, "text"))
Objects/unicodeobject.c:492: _PyUnicode_CheckConsistency: Assertion "((((((PyObject*)(op))->ob_type))->tp_flags & ((1UL << 28))) != 0)" failed
Enable tracemalloc to get the memory block allocation traceback

object  : b'bytes_filename'
type    : bytes
refcount: 4
address : 0x7fe22fe7ce50
Fatal Python error: _PyObject_AssertFailed

Current thread 0x00007fe23cfbf740 (most recent call first):
  File "/home/vstinner/prog/python/master/excepthook_syntaxerror.py", line 5 in <module>
Aborted (core dumped)


excepthook_syntaxerror.py uses:

raise SyntaxError("msg", (b"bytes_filename", 123, 0, "text"))
History
Date User Action Args
2019-07-01 10:15:06vstinnersetrecipients: + vstinner
2019-07-01 10:15:06vstinnersetmessageid: <1561976106.06.0.0411152988485.issue37467@roundup.psfhosted.org>
2019-07-01 10:15:05vstinnerlinkissue37467 messages
2019-07-01 10:15:05vstinnercreate