- 27 Apr, 2022 29 commits
-
-
Arnaud Fontaine authored
-
Arnaud Fontaine authored
With Python2, properties were all str(). with Python3, we need to distinguish binary-like properties from text-like properties. This should ideally be implemented by checking PropertySheet elementary_type (such as `data` for bytes() and `string` or `text` for str()) for each property. For now (bootstrap/addERP5Site) though, let's consider all properties in .xml to be UTF-8 str() and statically define which is which for non-.xml files.
-
Arnaud Fontaine authored
And _mysql/mysqldb API (_mysql.connection.query()) converts the query string to bytes() (additionally, cursor.execute(QUERY, ARGS) calls query() after converting everything to bytes() too).
-
Arnaud Fontaine authored
Use the latter form that works on both. On non-PythonScript code, this is of course not an issue but Python2 PythonScript does not have a __code__ properties and requires a patch on Shared.DC.Scripts.Signature (applied by SlapOS recipe) so that FuncCode() object is set to not only func_code but also __code__.
-
Arnaud Fontaine authored
-
Arnaud Fontaine authored
py3: RestrictedPython: Fix `Unauthorized: Using import with a level specification isn't supported by AccessControl.`
-
Arnaud Fontaine authored
-
Arnaud Fontaine authored
Done through various 2to3 fixers (zope.fixers, modernize, future) and also contain manual changes. This is a single commit so that we have a clearer picture of how code converted with my2to3 should look like. Except straightforward @implementer decorator 2to3 fixer, only product/ folder was considered as the goal was to be able to create an ERP5Site. * Use @implementer decorator introduced in zope.interface 3.6.0 (2010): The implements syntax used under Python 2.X does not work under 3.X, since it depends on how metaclasses are implemented and this has changed. Instead it now supports a decorator syntax (also under Python 2.X). Applied thanks to 2to3 `zope.fixers` package. * Use `six.moves` rather than `future` install_aliases() feature because the latter use unicode_literals and "wraps" module aliases so that unicode() are returned for text rather than str() (Python2 standard library). This notably breaks BusinessTemplate code which uses urllib quote() for filesystem paths... * No more unbound methods in python3 so use six.get_unbound_function(). * dict.(iteritems,iterkeys,itervalues)() => six.\1(dict) thanks to `dict_six` 2to3 fixer from `modernize`: $ python-modernize -w -f dict_six product/ * Manually make sure that dict.{items,values,keys}() returns a real list when needed rather than a dict_{items,values,keys} when it is latter modified. By default, 2to3 blindly does list(dict.{items,values,keys}()) which is not acceptable from performances point of view. With my2to3, this will be possible to handle such case automatically.
-
Arnaud Fontaine authored
And also disable pylint patch as pylint version with Python3 support is not supported yet by ERP5...
-
Arnaud Fontaine authored
* Add functions to properly convert/handle bytes/str/unicode (from slapos.util) (stricter than six.ensure_{text,str}()). * Python3 {keys,values,items}() now returns dict_{keys,values,items} rather than real list() so add ensure_list() to create a list() when it is latter modified but do nothing on Python2 for performance sake.
-
Arnaud Fontaine authored
-
Arnaud Fontaine authored
-
Arnaud Fontaine authored
File "product/TimerService/timerserver/TimerServer.py", line 71, in run s.send('GET / HTTP/1.1\r\n\r\n') TypeError: a bytes-like object is required, not 'str'
-
Arnaud Fontaine authored
And Zope4 now mandates it to be a string ({Shared.DC.ZRDB.TM.TM,ITransactionManager}.sortKey()).
-
Arnaud Fontaine authored
-
Arnaud Fontaine authored
This changes the API to implement similar feature in Python3, but this should not be an issue because Interactor are only for non-ERP5 object...
-
Arnaud Fontaine authored
-
Arnaud Fontaine authored
This should probably be fixed upstream.
-
Arnaud Fontaine authored
py3: DCWorkflow is python2-only so make ERP5Site creation work on Python3 WITH_LEGACY_WORKFLOW=False. ERP5 Workflow implementation should ideally not depend on DCWorkflow at all so that legacy DCWorkflow can be disabled for Python2 but this would require much more work.
-
Arnaud Fontaine authored
Mainly for maintenance sake and to update the code before porting it to python3.
-
Arnaud Fontaine authored
-
Arnaud Fontaine authored
-
Arnaud Fontaine authored
-
Arnaud Fontaine authored
-
Arnaud Fontaine authored
-
Arnaud Fontaine authored
-
Arnaud Fontaine authored
-
Vincent Pelletier authored
When spawning an activity, store the current security context's user in the Message object itself, so the activity security context can be re-created with the same security during activity execution. This allows a user to be modified (different groups, global roles, maybe removed altogether) after they spawned activities and before these activities could run. It also means that any temporary custom group or global role granted to that user (by a privilege elevation mechanism out of the scope of this change) will still be effective during the activity execution. This follows the principle that foo.activate(...).bar(...) should be equivalent to its "immediate execution" version foo.bar(...) by ensuring that the security context of the activity is the same as the one which was applied to the code which spawned that activity, independently of any intermediate configuration change - hence improving (deferred and fragmentary) transaction isolation. This also removes the need to look the user up, then looking up their assignments (and other documents involved in group computation), etc, saving the cost of these calls. Also, remove redundant user_name argument of Message.changeUser method.
-
Jérome Perrin authored
The action was removed in 6dce55b0 (dms: drop PDF thumbnail view, 2021-06-01) but some CSS declarations were not removed. Also remove some old commented out javascript that was referencing the old PDF preview
-
- 26 Apr, 2022 6 commits
-
-
Arnaud Fontaine authored
-
Arnaud Fontaine authored
-
Jérome Perrin authored
When a validated component is edited, `mixin.component.RecordablePropertyMetaClass` records the `text_content` property. This recorded property will be cleared afterwards if no errors are found, but this causes differences in business template XML for each component the first time they are edited. This change is about removing the `_recorded_property_dict` when there are no property recorded, which leads to slightly smaller pickles (and business template XML, because they are also pickles). See merge request nexedi/erp5!1605
-
Jérome Perrin authored
-
Jérome Perrin authored
This makes smaller pickles
-
Jérome Perrin authored
-
- 25 Apr, 2022 3 commits
-
-
Romain Courteaud authored
More investigations are needed on jio side
-
Romain Courteaud authored
jio 3.45.0 fixed the issue
-
Romain Courteaud authored
-
- 22 Apr, 2022 2 commits
-
-
Romain Courteaud authored
-
Romain Courteaud authored
Proxy field rendering was improved by 25ad9ece
-