Skip to content

[Python] Regression - Generated code gets overwritten with empty contents when included in another .fbs file #8490

@akb825

Description

@akb825

After updating to 24.12.23, I noticed that many of the generated Python files have contents such as this:

# automatically generated by the FlatBuffers compiler, do not modify

# namespace: DeepSeaPhysics

# NOTE Axis.py does not declare any structs or enums

After seeing that they are generated in some cases but not others, I have tracked down the issue to using #include with another .fbs file, where any included types will have its Python files overwritten.

For example, let's say you have foo.fbs with the Foo table, and bar.fbs that includes foo.fbs. If you generate foo.fbs, a Foo.py file will be generated with the proper types. However, as soon as you generate bar.fbs, it will overwrite Foo.py with an empty file with a comment noting that it doesn't declare any structs or enums, rendering the generated code unusable.

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