1. 03 Mar, 2023 5 commits
    • Jérome Perrin's avatar
    • Jérome Perrin's avatar
      patches/WSGIPublisher: update patch for Zope4 · 5b042ba3
      Jérome Perrin authored
      Zope2 did not have WSGIPublisher, this patch was a backport of the
      module from Zope 4. Now that we use Zope 4, we no longer need to copy
      the module code, but we still need a patch to apply the deadline patch.
      5b042ba3
    • Aurel's avatar
      xhtml_style: adjust standard_error_message for Zope4 · e50a6133
      Aurel authored
      There are some few differences:
      
      In Zope4 exceptions are callable, but we don't want to call them here,
      so we use a python: expression instead of the path expression which
      tries to call error_value.
      
      error_message is sometimes not passed.
      
      The context is different: Since Zope 4, the `standard_error_message` is
      rendered in the context of REQUEST['PUBLISHED'], which in case of
      publishing a skin (page template or script) in the context of a document
      is is the skin itself, but for error rendering in case of erp5_web Web
      Site or Web Section, we expect standard_error_message_template to always
      be rendered in the context of the document, that's why we use
      REQUEST.PARENTS[0] as context.
      
        REQUEST.PUBLISHED = <PythonScript at /erp5/script used for /erp5/module/document>
        REQUEST.PARENTS [<Document>, <Module>, <ERP5Site>, ...]
      
      In case of redirect, the body is no longer empty, but we explicitly
      return an empty body to keep the same behavior as zope2
      e50a6133
    • Jérome Perrin's avatar
      Revert "*: keep using func_code and not yet __code__ with scripts" · d2af3276
      Jérome Perrin authored
      This reverts commit eaae74a0.
      
      On Zope4 branch we are ready to use __code__
      d2af3276
    • Aurel's avatar
      fixup! a17bb910 use unichr instead of chr · 63e63f60
      Aurel authored
      63e63f60
  2. 02 Mar, 2023 32 commits
  3. 01 Mar, 2023 1 commit
  4. 28 Feb, 2023 2 commits
    • Roque's avatar
      58070276
    • Levin Zimmermann's avatar
      pandas: Fix unpickle np arrays with py2+pd>0.19.x · d223aede
      Levin Zimmermann authored
      Pandas 0.20.0 introduced a bug fix [1] which changed the behaviour of
      'DataFrame.to_records()', so that the resulting Record objects dtype names are
      unicodes if the data frames column names were unicode. Before this bug fix
      the dtype names were str, no matter whether the column names were str or unicode.
      
      Unfortunately np unpickle breaks if dtype names are unicode [2]. Since
      many of our data frame columns are unicode, loading arrays often
      fails. In python3 this isn't a problem anymore, so until then we fix
      this by introducing a simple monkey patch to pandas, which basically
      reverts the mentioned bug fix.
      
      [1] https://github.com/pandas-dev/pandas/issues/11879
      [2] Small example to reproduce this error:
      
      ''
      import os
      
      import numpy as np
      import pandas as pd
      
      r = pd.DataFrame({u'A':[1,2,3]}).to_records()
      a = np.ndarray(shape=r.shape, dtype=r.dtype.fields)
      p = "t"
      
      try:
        os.remove(p)
      except:
        pass
      
      with open(p, 'wb') as f:
        np.save(f, a)
      with open(p, 'rb') as f:
        np.load(f)
      ''
      
      /reviewed-on !1738
      /reviewed-by @jerome @klaus
      d223aede