We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Not raise a TypeError
Raises a TypeError
_cast_by_example
value
None
example
1
>>> _cast_by_example('value', ('example',)) Traceback (most recent call last): File "<input>", line 1, in <module> File "<input>", line 14, in _cast_by_example TypeError: 'NoneType' object is not iterable
The problem is in this line:
monkey/infection_monkey/config.py
Line 28 in 8f0251e
The issue is calling tuple(None):
tuple(None)
>>> tuple(None) Traceback (most recent call last): File "<input>", line 1, in <module> TypeError: 'NoneType' object is not iterable
The problem line is almost exactly the same as this line (four lines below the problem line):
Line 32 in 8f0251e
After looking at that, it seems like a potential fix would be either:
if value is None or value == (None,): # or if value is None or value == tuple([None]):
Both of these produce a tuple with one element which is None.
>>> (None,) (None,) >>> tuple([None]) (None,)
I didn't send a PR since I wasn't exactly sure if this would be correct and if so, which one of these would be preferred.
The text was updated successfully, but these errors were encountered:
Hey, Well, that's a bug. I think you're right on the solution. Want to open a one liner PR? 🥇
Also, what did you change in the configuration to run into this bug?
Sorry, something went wrong.
Will be solved in a bugfix soon :)
Bugfix in _cast_by_example, see issue #109
3aa1b9e
fixed in #111
itaymmguardicore
No branches or pull requests
Expected Behavior
Not raise a TypeError
Actual Behavior
Raises a TypeError
Steps to Reproduce the Problem
_cast_by_example
with avalue
which isn'tNone
andexample
as a tuple with a minimum length of1
.The problem is in this line:
monkey/infection_monkey/config.py
Line 28 in 8f0251e
The issue is calling
tuple(None)
:Potential Fix
The problem line is almost exactly the same as this line (four lines below the problem line):
monkey/infection_monkey/config.py
Line 32 in 8f0251e
After looking at that, it seems like a potential fix would be either:
Both of these produce a tuple with one element which is
None
.I didn't send a PR since I wasn't exactly sure if this would be correct and if so, which one of these would be preferred.
The text was updated successfully, but these errors were encountered: