jimbaker / tagstr

This repo contains an issue tracker, examples, and early work related to PEP 999: Tag Strings
51 stars 6 forks source link

UnicodeDecodeError for '>\\N{' in htmltag.py / taglib.py #37

Closed pauleveritt closed 3 months ago

pauleveritt commented 10 months ago

Running the htmltag.py demo gives an exception:

  File "/Users/pauleveritt/projects/pauleveritt/tagstr/src/tagstr/taglib.py", line 14, in decode_raw
    yield arg.encode("utf-8").decode("unicode-escape")
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in position 1-3: malformed \N character escape

This is the tag string value causing the problem:

<body {some_attrs} attr1={i}><div{j}>\N{{GRINNING FACE}}: {i} along with {j}</div{j}></body>
pauleveritt commented 3 months ago

This is less an issue with the PEP and more with the demo.