Skip to content

build_encoder_function behaves incorrectly for repeated string fields #75

Description

@PeterZhizhin

This piece of code (

elif isinstance(value, list) and all(map(lambda x: 0 <= x <= 255, value)):
) leads to the following exception for repeated string fields.

I'm getting this error in Exonum launcher for the config field:

exonum_launcher.instances.instance_spec_loader.InstanceSpecLoadError: Couldn't get a proto description for artifact: dit-votings-service, error: '<=' not supported between instances of 'int' and 'str'

I would suggest changing the lambda in the following way:

all(map(lambda x: 0 <= x <= 255 if isinstance(x, int) else False, value))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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