Skip to content

Unserialize does not support nil #6

@cmounce

Description

@cmounce

Calling luadata.unserialize('nil') raises an exception (expected behavior: return None). serialize() works going in the other direction, but unserialize() does this:

>>> luadata.serialize(None)
'nil'
>>> luadata.unserialize('nil')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/chris/.local/lib/python3.10/site-packages/luadata/serializer/unserialize.py", line 354, in unserialize
    raise Exception(
Exception: Unserialize luadata failed on pos 3:
    nil
       ^
    unexpected empty value.

The same thing also happens when nil occurs within a table, e.g., {1,2,nil,4,5}.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions