-
Notifications
You must be signed in to change notification settings - Fork 99
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 function ZPublisher.utils.fix_properties. #993
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can call this to fix lines properties to only contain strings, not bytes. It also replaces the deprecated property types ulines, utext, utoken, and ustring with their non-unicode variants. See #987 for why this is needed. Note: the code is not called by Zope itself. The idea is that integrators who think they need this in their database, can call it. Sample use: app.ZopeFindAndApply(app, apply_func=fix_properties) I intend to use this (or a temporary copy) in the Plone 6 upgrade code. See plone/Products.CMFPlone#3305
jugmac00
reviewed
Dec 2, 2021
Maurits van Rees wrote at 2021-12-1 23:59 -0800:
***@***.*** commented on this pull request.
> + # This is a tuple, so force a safe, just to be sure.
+ obj._properties = obj._properties
Still the comment could be improved.
Suggestion: We changed a mutable subcomponent; ensure the change is made
persistent
|
dataflake
reviewed
Dec 2, 2021
Co-authored-by: Jens Vagelpohl <jens@plyp.com>
dataflake
approved these changes
Dec 2, 2021
dataflake
reviewed
Dec 2, 2021
Co-authored-by: Jens Vagelpohl <jens@plyp.com>
mauritsvanrees
added a commit
to plone/plone.app.upgrade
that referenced
this pull request
Dec 2, 2021
See plone/Products.CMFPlone#3305. This goes through all objects in the site and does two things: 1. Make sure lines contain only strings, instead of bytes, or worse: a combination of strings and bytes. 2. Replace deprecated ulines, utext, utoken, and ustring properties with their non-unicode variant, using native strings. See plone/Products.CMFPlone#3305 I have just created and merged a PR that adds a utility function in Zope that we use: zopefoundation/Zope#993 It will be included in Zope 5.4, but this is not released yet, so for now we use our own copy.
mauritsvanrees
added a commit
to plone/plone.app.upgrade
that referenced
this pull request
Dec 2, 2021
This goes through all objects in the site and does two things: 1. Make sure lines contain only strings, instead of bytes, or worse: a combination of strings and bytes. 2. Replace deprecated ulines, utext, utoken, and ustring properties with their non-unicode variant, using native strings. See plone/Products.CMFPlone#3305 I have just created and merged a PR that adds a utility function in Zope that we use: zopefoundation/Zope#993 It will be included in Zope 5.4, but this is not released yet, so for now we use our own copy.
mauritsvanrees
added a commit
to plone/plone.app.upgrade
that referenced
this pull request
Dec 3, 2021
This goes through all objects in the site and does two things: 1. Make sure lines contain only strings, instead of bytes, or worse: a combination of strings and bytes. 2. Replace deprecated ulines, utext, utoken, and ustring properties with their non-unicode variant, using native strings. See plone/Products.CMFPlone#3305 I have just created and merged a PR that adds a utility function in Zope that we use: zopefoundation/Zope#993 It will be included in Zope 5.4, but this is not released yet, so for now we use our own copy.
mister-roboto
pushed a commit
to plone/buildout.coredev
that referenced
this pull request
Dec 20, 2021
Branch: refs/heads/master Date: 2021-12-04T00:38:09+01:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.app.upgrade@9be379b Fix unicode properties. This goes through all objects in the site and does two things: 1. Make sure lines contain only strings, instead of bytes, or worse: a combination of strings and bytes. 2. Replace deprecated ulines, utext, utoken, and ustring properties with their non-unicode variant, using native strings. See plone/Products.CMFPlone#3305 I have just created and merged a PR that adds a utility function in Zope that we use: zopefoundation/Zope#993 It will be included in Zope 5.4, but this is not released yet, so for now we use our own copy. Files changed: A news/3305.bugfix M plone/app/upgrade/v60/alphas.py M plone/app/upgrade/v60/configure.zcml Repository: plone.app.upgrade Branch: refs/heads/master Date: 2021-12-15T00:35:41+01:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.app.upgrade@8ada20f Fix unicode properties: fix sub objects as well. I thought this was the default. Files changed: M plone/app/upgrade/v60/alphas.py Repository: plone.app.upgrade Branch: refs/heads/master Date: 2021-12-20T11:53:36+01:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.app.upgrade@74eff47 Merge pull request #265 from plone/maurits-fix-unicode-properties Fix unicode properties. Files changed: A news/3305.bugfix M plone/app/upgrade/v60/alphas.py M plone/app/upgrade/v60/configure.zcml
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
You can call this to fix lines properties to only contain strings, not bytes.
It also replaces the deprecated property types ulines, utext, utoken, and ustring with their non-unicode variants.
See #987 for why this is needed.
Note: the code is not called by Zope itself. The idea is that integrators who think they need this in their database, can call it.
Sample use:
I intend to use this (or a temporary copy) in the Plone 6 upgrade code.
See plone/Products.CMFPlone#3305
I tried it on a few databases, and it works there, although only very little is changed.