Skip to content

Workspace log proto uses Python reserved keyword #6887

@Utsav2

Description

@Utsav2

ATTENTION! Please read and follow:

Description of the problem / feature request:

Workspace log proto uses Python reserved keyword

Feature requests: what underlying problem are you trying to solve with this feature?

The protobuf field here is named from: https://source.bazel.build/bazel/+/master:src/main/java/com/google/devtools/build/lib/bazel/debug/workspace_log.proto;l=84?q=WorkspaceEvent.

message SymlinkEvent {
  // path to which the symlink will point to
  string from = 1;
  // path of the symlink
  string to = 2;
}

Since from is a keyword, Python protobuf users can't use this field.

python
Python 2.7.12 (default, Nov 12 2018, 14:36:49) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = object()
>>> a.from = object()
  File "<stdin>", line 1
    a.from = object()
         ^
SyntaxError: invalid syntax

See https://stackoverflow.com/questions/30142750/reserved-keyword-is-used-in-protobuf-in-python for more context.

Could these be renamed to from_path and to_path, and the old uses be removed?

Metadata

Metadata

Assignees

Labels

P2We'll consider working on this in future. (Assignee optional)team-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.type: feature request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions