-
Notifications
You must be signed in to change notification settings - Fork 49
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
String formatting errors in exception arguments #966
Comments
Thanks for reporting! |
For extra credit someone should craft a regular expression for finding all instances of this! I've found four so far, but I'm not sure that's all of them. Edit: self nerd-snipe! The regular expression |
Related to this we also have a number of places where we are still passing multiple arguments to the logger, as in: self.logger.debug("Here's some foo", bar) They are also not really causing problems but it would be good to get them switched to f-strings. |
I tried to take care of a lot of these in #951. |
I think I got the rest of these in #983. The regex doesn't turn up anything else. Feel free to reopen. |
Describe the bug
In POCS there are a few instance of
raise ValueError("Blah, blah, blah, {}!", obj)
where it should be
raise ValueError("Blah, blah, blah, {}!".format(obj))
or
raise ValueError(f"Blah, blah, blah, {obj}!")
, e.g.POCS/pocs/focuser/focuser.py
Line 242 in 22532da
POCS/pocs/focuser/focuser.py
Line 249 in 22532da
These don't cause problems in POCS itself (beyond some funny looking exceptions) but they do cause problems for the remote cameras in huntsman-pocs, because the Pyro4 network layer ends up trying to serialise
ValueErrors
that contain, in theirargs
list, a reference to an object that it can't serialise, resulting in opaque 'circular reference' exceptions from Pyro.The text was updated successfully, but these errors were encountered: