-
-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Add 'surgical editing' to ConfigParser #42811
Comments
See also: [ 1399309 ] ConfigParser to save with order The attached patch adds a new method, update_file, to IMO the attached patch is better than 1399309 because IMO the attached patch is better than 1371075 because The attached patch is essentially a tidied up version Also attached are additional unittests for the new Please let me know if there are recommended changes. This patch does not address any of the additional |
Logged In: YES Wanting to keep the whole thing (except defaultsection) in It sounds like you can do this by "updating" to an empty |
Logged In: YES Before I lose track of the updated patches I made.. They can http://scottdial.com/python-dev/ConfigParser.diff The notes I emailed Tony were:
--- And in reponse to Jim's comment, such a feature is not in |
I've looked at the patches attached here. They look reasonable, and in isolation I would be happy for them to be accepted, although I have no personal use for the functionality. However, patch 131075 (ConfigParser to accept a custom dict to allow ordering) has since been accepted, and in the light of that, this patch may no longer be appropriate. From the descriptions, and a review of the code, I am not clear how the two are related. The justification should be updated to reflect the fact that patch 131075 has been accepted - or if there is no longer sufficient justification for what may well be a second way to do the same thing, then this patch should be withdrawn. I have looked at Scott Dial's updated patches, but I am not clear on what they add. There has obviously been some discussion which happened off the tracker - as a result I can't comment on the DEFAULTSECT issue. The whitespace stripping issue needs a clearer description. I don't see what is happening here. One or other of the patches is presumably mishandling leading or trailing whitespace in options, but I can't tell which. The "growing blank lines" fix sounds sensible. Recommendation:
Otherwise, I would recommend rejection on the grounds that the functionality now appears to be available via the acceptance of 1371075 (albeit in a form that this patch claims is inferior). Paul Moore |
I assume that Paul meant 1371075 and not 131075 was accepted. 1371075 didn't do what Guido wanted at the time this patch was opened (or have documentation or unit tests), but I guess opinion has changed over time. There is incomplete overlap between that patch and this. This patch is really about being able to modify a configuration file 'in place', without losing the ordering or (importantly) comments. 1371075 provides the first (if you write/find an appropriate ordered dict), but not the second. However, it seems unlikely that merely preserving comments is enough to make this change worthwhile. I have no problem with it being rejected or being subsumed into some other patch. |
Anyone interested in updating this? |
As noone has shown any interest in this for over three years I suggest it is closed as rejected. Note also that bpo-1371075 has been accepted and the OP's comments on msg49354. |
I want to review and update the patches. I’ll probably have the time to do it in August/September. |
Thanks Brian, I’d forgotten I could assign to me. I feel bound now <wink> |
Éric, as this is one of the major features I'm implementing at the moment for the great configparser overhaul for Python 3.2, I hope you won't mind me taking this over :) |
Be my guest :) Thanks for your work. FYI, note that it seems more usual to ask first before unassigning someone. |
What is the state of that feature, as of today? |
According to a review done at the PyCon 2014 sprints, comment and blank line preservation has not yet been implemented. |
I would have liked for configparser to keep comments when my program re-write configuration file too. |
Hello, I intend to do a proposal for this topic, and I have some questions:
I will try to see if it remains readable to put an option in try to ping @ezio-melotti Thanks in advance |
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: