google / google/flatbuffers

Python code generation: wrong import

Open
#4,718 9 comments 3 reactions 2 assignees Claimed by @jtdavis777 View on GitHub
stale
Dominant language
C++
Stars
26.5k
Forks
3.7k
PR merge metrics
No merged PRs in 30d

Description

Hey,

I've put together a small repro case: https://github.com/Tinche/fb-python-issue

Check out the repo and run flatc -p -I . **/*.fbs.

I'm running flatc version 1.9.0 (Apr 6 2018 01:08:33) on macOs.

This is a minimized case from what we're using at work. This line in particular is the problem: https://github.com/Tinche/fb-python-issue/blob/master/fbs/networking/socket/inbox/GetConversationsResponse.py#L28

(It should read: from ....inbox.Conversation import Conversation, if we're favoring relative imports.)

The code generator probably gets confused by the top level packages both being named 'inbox'.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.