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
Exceptions in ConfigParser don't set .args #48936
Comments
The ConfigParser module defines a variety of custom exceptions, many of class NoOptionError(Error):
def __init__(self,option,section):
Error.__init__(self,"No option %r in section: %r" %
(option,section))
self.option = option
self.section = section
self.args = (option,section) #!! Added this line This is kind of a minor point, but the missing args means that these I can't speak for Python 3.0, but it's my understanding that .args Don't ask how I came across this---it was the source of a really bizarre |
Sound argument. I've prepared a patch for Py3k that adds Brett, the code change is trivial. Tests aren't complicated as well. Should this change also be ported to py27-maint? |
Tests failed after patching test file, all passed after patching the code on Windows against 3.2. The patch looks simple and clean so I don't see why it can't be committed. As this is a behaviour issue the code should also be backported. |
Thanks, Mark. Should I do the backporting or do you have some technology/process for this? I can do the backport as well if it doesn't require SVN commit access. I would need some help because it would be my first backport :) |
Łukasz, no problem. It would be my first backport too! :) I think that it's best left to the committers as they've well used to doing things like this. |
Committed revision 83150. Still needs backporting to 3.1, 2.7 and possibly even 2.6. |
Patch doesn't apply cleanly to 3.1 or earlier. As it is *arguably* a new feature rather than a bugfix I'm closing the issue. I certainly wouldn't argue against someone else backporting though... |
New changeset 8e091e36fc80 by Łukasz Langa in branch '2.7': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: