{"id":2789,"date":"2017-10-25T17:32:41","date_gmt":"2017-10-25T15:32:41","guid":{"rendered":"http:\/\/blog.gocept.com\/?p=2789"},"modified":"2017-10-25T17:34:54","modified_gmt":"2017-10-25T15:34:54","slug":"testing-zope-4beta2","status":"publish","type":"post","link":"https:\/\/blog.gocept.com\/2017\/10\/25\/testing-zope-4beta2\/","title":{"rendered":"Migrating from Zope 2.13 to 4.0b2"},"content":{"rendered":"
TL;DR: <\/strong>There are some rough edges when migrating an existing Data.fs and needed Python code from Zope 2.13 to Zope 4 but there is nothing what cannot be solved.<\/p>\n The German company PerFact Innovation\u00a0(www.perfact-innovation.de<\/a>) has a customer product built on Zope 2.13. The code needed for the customisation to different customers is stored in the ZODB. They invited me to a workshop where we looked into the migration story to Zope 4. We used the just released Zope 4.0b2.<\/p>\n After half a day the core functions of the customer product where working including the switch from ZServer to WSGI. There were some rough edges we had to come around. I list them here as a reference for other people who start migrating their code to Zope 4.<\/p>\n We also poke around with a fresh Zope 4 installation on Python 3 to see what this will bring. It was nice to see that a\u00a0 Expect most of the bugs and some of the uglinesses listed below to be fixed in Zope 4.0b3.<\/p>\n There are some bugs we could easily hack around in the workshop. Most of them are even fixed by now:<\/p>\n Some things are still a bit raw in Zope 4 but for a beta version it is possible to live with them:<\/p>\n We were facing some of the breaking changes in Zope 4, which will require further development if the customer product should behave and be developed like before:<\/p>\n We were facing some required changes on different levels to get the code running:<\/p>\n It is not impossible to migrate an existing Data.fs to Zope 4 (while staying on Python 2). It is even easier if the through the web approach was used to create the Data.fs as only very little code has to be modified that way.<\/p>\n Please test your applications on Zope 4 during the beta phase (until fall 2018) so we will get a final release which will be ready for production usage. If you have questions we are here to help.<\/p>\n","protected":false},"excerpt":{"rendered":" Beta-Testing Zope 4 together with PerFact Innovation<\/p>\n","protected":false},"author":15344399,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[10221],"tags":[19551,1158,832,581,72208],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pFP3y-IZ","jetpack-related-posts":[{"id":3306,"url":"https:\/\/blog.gocept.com\/2019\/05\/10\/zope-roadmap\/","url_meta":{"origin":2789,"position":0},"title":"Zope roadmap","author":"Michael Howitz","date":"May 10, 2019","format":false,"excerpt":"Zope 4 is the successor of Zope 2.13 supporting both Python 2.7 and Python 3. After the release of its final version 4.0: Zope 2.13 will drop into \"security fixes only\" mode. It will stay in this mode as long as there is a supported Plone version using Zope 2.13:\u2026","rel":"","context":"In "en"","block_context":{"text":"en","link":"https:\/\/blog.gocept.com\/category\/en\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2019\/05\/abend-amerika-ausflug-844167.jpg?fit=1200%2C772&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2019\/05\/abend-amerika-ausflug-844167.jpg?fit=1200%2C772&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2019\/05\/abend-amerika-ausflug-844167.jpg?fit=1200%2C772&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2019\/05\/abend-amerika-ausflug-844167.jpg?fit=1200%2C772&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2019\/05\/abend-amerika-ausflug-844167.jpg?fit=1200%2C772&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3225,"url":"https:\/\/blog.gocept.com\/2018\/05\/24\/zope-is-welcome-in-the-python-3-wonderland\/","url_meta":{"origin":2789,"position":1},"title":"Zope is welcome in the Python 3 wonderland!","author":"Michael Howitz","date":"May 24, 2018","format":false,"excerpt":"Earl Zope already got the beta permission to stay in the Python 3 wonderland some months ago. His current objective is to help old friends to come to the Python 3 wonderland and to make new friends. He has to build trust in his will and ability to stay in\u2026","rel":"","context":"In "en"","block_context":{"text":"en","link":"https:\/\/blog.gocept.com\/category\/en\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2018\/05\/zope-4-welcome-sprint.jpg?fit=1200%2C637&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2018\/05\/zope-4-welcome-sprint.jpg?fit=1200%2C637&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2018\/05\/zope-4-welcome-sprint.jpg?fit=1200%2C637&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2018\/05\/zope-4-welcome-sprint.jpg?fit=1200%2C637&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2018\/05\/zope-4-welcome-sprint.jpg?fit=1200%2C637&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3229,"url":"https:\/\/blog.gocept.com\/2018\/06\/07\/migrate-a-zope-zodb-data-fs-to-python-3\/","url_meta":{"origin":2789,"position":2},"title":"Migrate a Zope ZODB Data.fs to Python 3","author":"Michael Howitz","date":"June 7, 2018","format":false,"excerpt":"TL;DR Use\u00a0zodbupdate. Problem A ZODB\u00a0Data.fs\u00a0which was created under Python 2 cannot be opened under Python 3. This is prevented by using a different magic code in the first bytes of the file. This is done on purpose because str\u00a0has a different meaning for the two Python versions: Under Python 2\u2026","rel":"","context":"In "en"","block_context":{"text":"en","link":"https:\/\/blog.gocept.com\/category\/en\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2018\/06\/spring-3383890_1280.jpg?fit=1200%2C797&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2018\/06\/spring-3383890_1280.jpg?fit=1200%2C797&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2018\/06\/spring-3383890_1280.jpg?fit=1200%2C797&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2018\/06\/spring-3383890_1280.jpg?fit=1200%2C797&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2018\/06\/spring-3383890_1280.jpg?fit=1200%2C797&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":2632,"url":"https:\/\/blog.gocept.com\/2017\/09\/22\/earl-zope-ii-is-dead-long-live-earl-zope\/","url_meta":{"origin":2789,"position":3},"title":"Earl Zope II is dead, long live Earl Zope","author":"Michael Howitz","date":"September 22, 2017","format":false,"excerpt":"Zope 4.0b1 released","rel":"","context":"In "en"","block_context":{"text":"en","link":"https:\/\/blog.gocept.com\/category\/en\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2017\/09\/pexels-photo-68806-e1506067407549.jpg?fit=1200%2C832&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2017\/09\/pexels-photo-68806-e1506067407549.jpg?fit=1200%2C832&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2017\/09\/pexels-photo-68806-e1506067407549.jpg?fit=1200%2C832&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2017\/09\/pexels-photo-68806-e1506067407549.jpg?fit=1200%2C832&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2017\/09\/pexels-photo-68806-e1506067407549.jpg?fit=1200%2C832&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3350,"url":"https:\/\/blog.gocept.com\/2019\/11\/13\/union-cms-released-on-python-3\/","url_meta":{"origin":2789,"position":4},"title":"union.cms released on Python 3","author":"Michael Howitz","date":"November 13, 2019","format":false,"excerpt":"union.cms is a content management system which was once developed on Zope 2. It was one of the early adopters of the Five technology aka using Zope 3 components in Zope 2. Now it is one of the proud early adopters of Zope 4 on Python 3. It is used\u2026","rel":"","context":"In "en"","block_context":{"text":"en","link":"https:\/\/blog.gocept.com\/category\/en\/"},"img":{"alt_text":"Green tree python","src":"https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2019\/11\/green-tree-python-1312700.jpg?fit=1200%2C863&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2019\/11\/green-tree-python-1312700.jpg?fit=1200%2C863&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2019\/11\/green-tree-python-1312700.jpg?fit=1200%2C863&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2019\/11\/green-tree-python-1312700.jpg?fit=1200%2C863&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2019\/11\/green-tree-python-1312700.jpg?fit=1200%2C863&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3312,"url":"https:\/\/blog.gocept.com\/2019\/05\/10\/celebration-zope-4-final-release\/","url_meta":{"origin":2789,"position":5},"title":"Celebration: Zope 4 final release","author":"Michael Howitz","date":"May 10, 2019","format":false,"excerpt":"TL;DR: Zope 4 beta phase ended, final version released! After hard, long years of preparation Earl Zope now finally made it to get a permanent license for the Python 3 wonderland: In September 2016 almost 20 people started with the reanimation of Zope at the Zope Resurrection sprint. This marked\u2026","rel":"","context":"In "en"","block_context":{"text":"en","link":"https:\/\/blog.gocept.com\/category\/en\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2019\/05\/fireworks-945386_1920.jpg?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2019\/05\/fireworks-945386_1920.jpg?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2019\/05\/fireworks-945386_1920.jpg?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2019\/05\/fireworks-945386_1920.jpg?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/blog.gocept.com\/wp-content\/uploads\/2019\/05\/fireworks-945386_1920.jpg?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/posts\/2789"}],"collection":[{"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/users\/15344399"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/comments?post=2789"}],"version-history":[{"count":26,"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/posts\/2789\/revisions"}],"predecessor-version":[{"id":3202,"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/posts\/2789\/revisions\/3202"}],"wp:attachment":[{"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/media?parent=2789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/categories?post=2789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.gocept.com\/wp-json\/wp\/v2\/tags?post=2789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}The story<\/h2>\n
DTMLMethod<\/code>\u00a0calling another one while mixing
bytes<\/code> and
unicode<\/code>\u00a0 no longer leads to strange encoding problems but keeps
bytes<\/code>\u00a0 as
bytes<\/code>.<\/p>\n
Bugs<\/h2>\n
\n
getitem<\/code>\u00a0style (e. g. metal<\/span>:<\/span>use-macro<\/span>=<\/span>“<\/span>python:here.master.macros[‘foo’]“)<\/span><\/span>\u00a0is not allowed. Its Python class seems to be missing a security declaration. Reported in [zopefoundation\/Zope#210]<\/a><\/li>\n
Script (Python)<\/code>\u00a0in the ZMI because the default script code is not Python 3 compatible. Already fixed in\u00a0[zopefoundation\/Products.PythonScripts#10]<\/a>\u00a0awaiting release.<\/li>\n<\/ul>\n
Uglinesses<\/h2>\n
\n
SiteError<\/code>. You have to add an
index_html<\/code>\u00a0object in the ZODB yourself. Reported in [zopefoundation\/Zope#212]<\/a><\/li>\n
SyntaxError<\/code>\u00a0in a
Script (Python)<\/code> and saving this code, you will see an error page and your code does not get saved. Previously a warning was rendered. Reported in\u00a0[zopefoundation\/Products.PythonScripts#11]<\/a><\/li>\n
Products.PythonScripts<\/code>\u00a0there are even more warnings at startup. Reported in\u00a0[zopefoundation\/Products.PythonScripts#13]<\/a><\/li>\n<\/ul>\n
Breaking changes<\/h2>\n
\n
products<\/code>\u00a0directive is no longer supported in the\u00a0
zope.conf<\/code>\u00a0(only via\u00a0ZServer<\/a>). This means that the contents of the
Products<\/code>\u00a0directory inside the Zope instance directory have to become Python packages which can be installed via
pip<\/code>\u00a0resp.\u00a0
zc.buildout<\/code>.<\/li>\n<\/ul>\n
Required changes<\/h2>\n
\n
\n
Products.ZODBMountPoint<\/code>)<\/li>\n
Products.Transience<\/span><\/code>)<\/li>\n
Globals<\/code>\u00a0module. In Zope 2.13 it only contained\u00a0imports to keep the backwards compatibility with older Zope releases.
Globals<\/code>\u00a0is gone now. To find out how to change your imports look at the\u00a0Globals module on the 2.13 branch<\/a>.<\/li>\n
--<\/code>\u00a0in HTML comments as it is not allowed there. (See also the\u00a0HTML comments<\/a>\u00a0document of the WebDesignGroup.)<\/li>\n
standard_error_message<\/code>\u00a0does not exist any more in Zope 4. It only supports exception views which have to be written in file system code. See Catching and rendering exceptions<\/a>\u00a0as a tutorial how to create exception views and even a hack to restore using
standard_error_message<\/code>.<\/li>\n<\/ul>\n
Conclusion<\/h2>\n