Skip to content
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 4 commits into from
Dec 2, 2021

Conversation

mauritsvanrees
Copy link
Member

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

I tried it on a few databases, and it works there, although only very little is changed.

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
src/ZPublisher/utils.py Outdated Show resolved Hide resolved
@d-maurer
Copy link
Contributor

d-maurer commented Dec 2, 2021 via email

src/ZPublisher/utils.py Outdated Show resolved Hide resolved
Co-authored-by: Jens Vagelpohl <jens@plyp.com>
src/ZPublisher/utils.py Outdated Show resolved Hide resolved
@mauritsvanrees mauritsvanrees merged commit 49e9574 into master Dec 2, 2021
@mauritsvanrees mauritsvanrees deleted the maurits-fix-unicode-properties branch December 2, 2021 22:52
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants