Status: New
Labels: Type-Defect Priority-Medium

New issue 315 by erroneous duplicate definition error if imported file in subdirectory

What steps will reproduce the problem?
Create "foo.proto" containing:
  import "bar.proto";

Create "x/bar.proto" containing:
  message bar {
    optional int32 x = 1;

Try to compile:
protoc --python_out=. -I. -Ix foo.proto x/bar.proto

What is the expected output? What do you see instead?
Compilation shall succeed, just like it does if "x/bar.proto"
is "bar.proto" instead.
It also succeeds if "foo.proto" contains:
  import "x/bar.proto"

What version of the product are you using? On what operating system?
2.3.0 and 2.4.1
Linux and MacOS

Please provide any additional information below.

        foo.proto  20 bytes
        bar.proto  40 bytes

You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to