Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build_encoder_function behaves incorrectly for repeated string fields #75

Open
PeterZhizhin opened this issue Jan 5, 2022 · 0 comments · May be fixed by #76
Open

build_encoder_function behaves incorrectly for repeated string fields #75

PeterZhizhin opened this issue Jan 5, 2022 · 0 comments · May be fixed by #76

Comments

@PeterZhizhin
Copy link

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))
@PeterZhizhin PeterZhizhin linked a pull request Jan 6, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant