`importOSMeasure` fail when parameter description contains "%".
Larry7707 opened this issue · 2 comments
When importing ReduceSpaceInfiltrationByPercentage
, the parameter description contains "%", so it will raise error on line 172.
def __repr__(self):
return (self.display_name + "<" + self.type + "> " + str(self.choices) + \
" Current Value: %s")%(self.default_value if not self.userInput else self.userInput)
Suggest to change it to something like below.
def __repr__(self):
temp = " Current Value: %s" % self.default_value if not self.userInput else self.userInput
return self.display_name + "<" + self.type + "> " + str(self.choices) + temp
Thanks for reporting this @Larry7707 .
By any chance are you working with Elliot_Glassman?
I see that the same case was reported on the forum a couple of days ago.
It seems that I incorrectly identified the faulty character in my forum response, though. I thought is was a '(' but it seems I should have been reading the code in the error message to identify it as a '%'. Thank you also for the recommendation on the solution. I have a slightly more pythonic way that of doing it that should be even more resilient to different types of special characters:
2aca345
Thanks again!
Thanks for the update. Your way seems better and yes Elliot and I are on the same team. One more note may be that I think a general way to prevent this kind of bugs is to avoid any formatting with variables because people are evil and they want to break our functions by assigning an evil value to it :)
Happy July 4th!