-
-
Notifications
You must be signed in to change notification settings - Fork 155
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Code
From README.md
:
if obj.type.name == "Font":
font: Font = obj.read()
if font.m_FontData:
extension = ".ttf"
if font.m_FontData[0:4] == b"OTTO":
extension = ".otf"
with open(os.path.join(path, font.m_Name+extension), "wb") as f:
f.write(font.m_FontData)
Error
The error message that is produced by python.
Usually something like
TypeError: memoryview: a bytes-like object is required, not 'list'
Bug
From the example in README.md, it seems that Font.m_FontData is treated as a bytes object.
While in generated classes (classes.generated), Font.m_FontData is typed with List[str].
However in real usage, Font.m_FontData actually returns List[int] containing the byte values as a list.
To Reproduce
- a copy of the file that causes the problem
- following data:
- Python version: 3.10.12
- UnityPy version: 1.22.3, 1.22.5 and 1.23.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working