Closed nautics889 closed 1 year ago
There are a couple of lines in pynetbox/core/endpoint.py module having string concatenation without type casting. Line 461:
pynetbox/core/endpoint.py
raise ValueError( "Objects passed must be list[dict|Record] - was " + type(objects) )
Line 475:
raise ValueError( "Object passed must be dict|Record - was " + type(objects) )
This obviously can lead to TypeError:
TypeError
>>> 'Some string ' + type(something) Traceback (most recent call last): File "C:\Program Files\JetBrains\PyCharm 2022.3.2\plugins\python\helpers\pydev\pydevconsole.py", line 364, in runcode coro = func() File "<input>", line 1, in <module> TypeError: can only concatenate str (not "type") to str
It should have explicit type casting via str() like, e. g. like at this line.
str()
As for me the most readable solution would be to use .format() (like there).
.format()
Fixed with #539
There are a couple of lines in
pynetbox/core/endpoint.py
module having string concatenation without type casting. Line 461:Line 475:
This obviously can lead to
TypeError
:It should have explicit type casting via
str()
like, e. g. like at this line.As for me the most readable solution would be to use
.format()
(like there).