profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/perrinjerome/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

perrinjerome/mopidy-local-zodb 4

ZODB local library extension for Mopidy http://www.mopidy.com

perrinjerome/cssspriter 2

Simple tool to rewrite a CSS to use sprites in place of images

perrinjerome/music 1

Music player web app for beets.io

perrinjerome/500lines 0

500 Lines or Less

perrinjerome/arduino-mqtt-tutorial 0

A comprehensive tutorial on getting started with MQTT protocol using NodeMCU, MQTTBox and Node-RED

perrinjerome/bk-tools 0

Scripts I wrote to help using MySQL and Percona products.

perrinjerome/buildout 0

Buildout is a deployment automation tool written in and extended with Python

perrinjerome/cloudooo 0

XML-RPC document conversion server

perrinjerome/cmake-language-server 0

CMake LSP Implementation

perrinjerome/d3py 0

a plottling library for python, based on D3

PR opened openlawlibrary/pygls

remove defaults from optional fields

pygls is serializing too many fields

pygls 0.11.0 serializes certain optional fields, regardless of whether the server has explicitly set them - or whether the client has declared support for them.

Updating jedi-language-server to take pygls 0.11.0 I see that we are now returning various fields that we previously didn't eg on CompletionItem we always set deprecated and preselect. I'm pretty sure that this is wrong: not least, there are deprecatedSupport and preselectSupport on CompletionClientCapabilities: if the client has not declared support for these things then presumably we're not supposed to return them.

The approach I have taken is to remove all defaults for Optional fields:

  • when the default was not None, this had the effect of making the field not optional after all, as above
  • when the default was None it was redundant to declare it as such, so it's just more compact not to bother

This pull request partially undoes f248002a2fb8a10fb9a5d2bd5a0160a04a6189aa. I'm not sure what the motivation for that was, but flagging it in case I've broken something.

Code review checklist (for code reviewer to complete)

  • [ ] Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • [ ] Title summarizes what is changing
  • [ ] Commit messages are meaningful (see this for details)
  • [ ] Tests have been included and/or updated, as appropriate
  • [ ] Docstrings have been included and/or updated, as appropriate
  • [ ] Standalone docs have been updated accordingly
  • [ ] CONTRIBUTORS.md was updated, as appropriate
  • [ ] Changelog has been updated, as needed (see CHANGELOG.md)
+357 -362

0 comment

36 changed files

pr created time in 5 hours

startedpmd/pmd

started time in 13 hours

issue openedzopefoundation/Acquisition

PURE_PYTHON: bad access to attributes with acquisition wrapper value

The problem is demonstrated by the following code:

>>> from Acquisition import Implicit
>>> class I(Implicit):
...   def add(self, id, o):
...     setattr(self, id, o)
...     return getattr(self, id)
... 
>>> top = I()
>>> f = top.add("f", I())
>>> 
>>> i = I()
>>> i.add("f", f)
<__main__.I object at 0x7f7b8acbf668>
>>> i.f.aq_self is f
False

Works in the "C" version.

The problem is caused by Acquisition._Wrapper.__of__:

    def __of__(self, parent):
        # Based on __of__ in the C code;
        # simplify a layer of wrapping.

        # We have to call the raw __of__ method or we recurse on our
        # own lookup (the C code does not have this issue, it can use
        # the wrapped __of__ method because it gets here via the
        # descriptor code path)...
        wrapper = self._obj.__of__(parent)
        if (not isinstance(wrapper, _Wrapper) or
                not isinstance(wrapper._container, _Wrapper)):
            return wrapper
        # but the returned wrapper should be based on this object's
        # wrapping chain
        wrapper._obj = self

        while (isinstance(wrapper._obj, _Wrapper) and
               (wrapper._obj._container is wrapper._container._obj)):
            # Since we mutate the wrapper as we walk up, we must copy
            # XXX: This comes from the C implementation. Do we really need to
            # copy?
            wrapper = type(wrapper)(wrapper._obj, wrapper._container)
            wrapper._obj = wrapper._obj._obj
        return wrapper

It fails, if parent is not a wrapper.

created time in 15 hours

issue closedzopefoundation/Zope

Strange acquisition loops

Python 3(.6), master

The code below demonstrates an acquisition loop:

>>> from Products import Five
>>> from Zope2.App.zcml import load_config, load_string
>>> load_config("configure.zcml", Five)
>>> load_string("""
... <configure xmlns:browser="http://namespaces.zope.org/browser"
...  xmlns="http://namespaces.zope.org/zope"> 
...   <browser:view
...       name="permission_view"
...       for="*"
...       class="Products.Five.browser.tests.pages.PermissionView"
...       permission="zope2.Public"
...       />
... </configure>
... """)
>>> from OFS.Folder import Folder
>>> f = Folder()
>>> 
>>> from zope.publisher.browser import TestRequest
>>> from zope.component import getMultiAdapter
>>> from Acquisition import aq_acquire, aq_parent, aq_inner
>>> 
>>> R = TestRequest()
>>> view = getMultiAdapter((f, R), name=u'permission_view')
>>> o = view
>>> for i in range(10):
...   print(i, type(o))
...   p = aq_parent(aq_inner(o))
...   if p is None: break
...   o = p
... 
0 <class 'Products.Five.browser.metaconfigure.permission_view'>
1 <class 'Acquisition.ImplicitAcquisitionWrapper'>
2 <class 'Products.Five.browser.metaconfigure.permission_view'>
3 <class 'Acquisition.ImplicitAcquisitionWrapper'>
4 <class 'Products.Five.browser.metaconfigure.permission_view'>
5 <class 'Acquisition.ImplicitAcquisitionWrapper'>
6 <class 'Products.Five.browser.metaconfigure.permission_view'>
7 <class 'Acquisition.ImplicitAcquisitionWrapper'>
8 <class 'Products.Five.browser.metaconfigure.permission_view'>
9 <class 'Acquisition.ImplicitAcquisitionWrapper'>

The code comes from Products.Five.browser.tests:pages.txt. I have extracted it in order to analyze why the test hangs.

The problem is actually in Acquisition. However, I have not yet been able to reproduce it there.

Playing with Acquisition's Python version, the problem was solved with the following modified aq_parent definition:

def aq_parent(obj):
    # needs to be safe to call from __getattribute__ of a wrapper
    # and reasonably fast
    if isinstance(obj, _Wrapper):
        return object.__getattribute__(obj, '_container')
    # if not a wrapper, deal with the __parent__
    # Do not acquisition wrap access to `__parent__`
    #return getattr(obj, '__parent__', None)
    parent = getattr(obj, '__parent__', None)
    if isinstance(parent, _Wrapper) and parent.aq_parent is obj:
        parent = parent.aq_self
    return parent

With this change, the loop results in the expected:

0 <class 'ExtensionClass.permission_view'>
1 <class 'OFS.Folder.Folder'>

closed time in 19 hours

d-maurer

issue commentzopefoundation/Zope

Strange acquisition loops

While this is a problem, it is of no great practical importance. It affects precisely the following situation:

  • an object o which is not acquisition wrapped and an instance of ExtensionClass.Base
  • its __parent__ is computed from another attribute whose value is not acquisition wrapped and an instance of Acquisition.{Im,Ex}plicit.

In this case, aq_parent(aq_inner(aq_parent(aq_inner(o)))) is o and acquisition chain traversal (via aq_parent(aq_inner(...))) leads to an infinite loop.

The code in this report reveals such a situation -- but it is quite rare. Usually,in the Zope world, instances of Acquistion.{Im,Ex}plicit are acquisition wrapped. In this case, computing __parent__ from the attribute adds an additional wrapper, too, but it is cut away by aq_inner and no loop results. Likely, no special measure is required.

I hit the problem by change. For "https://github.com/zopefoundation/Zope/pull/978", I play with a PURE_PYTHON setup. For a still unknown reason, this setup seems to unwrap acquisition wrappers on access. Thus, in the situation above, even if the attribute value (used in the computation of __parent__) is wrapped, it appears unwrapped (and causes the loop). I will try to find out what goes wrong and file a new issue.

d-maurer

comment created time in 19 hours

push eventNexedi/erp5

Gabriel Monnerat

commit sha ef31160820946969ac73e0b2ac3d55ad74d307be

erp5_web_renderjs_ui: add graphic gadget to service worker

view details

push time in a day

issue commentzopefoundation/Zope

Strange acquisition loops

Jens Vagelpohl wrote at 2021-6-18 06:41 -0700:

The problem can either be fixed in BrowserView or in Acquisition. I would prefer the second option.

I agree. Do you want to move this issue to Acquisition?

I am still investigating: there are more strange things in connection with the Products.Five.browser.tests:pages.txt tests related to context and __parent__ handling. I hope to find a common fix.

d-maurer

comment created time in a day

issue commentzopefoundation/Zope

Strange acquisition loops

The problem can either be fixed in BrowserView or in Acquisition. I would prefer the second option.

I agree. Do you want to move this issue to Acquisition?

d-maurer

comment created time in a day

issue commentzopefoundation/Zope

Strange acquisition loops

Acquisition seems to be careful not to add an additional acquisition wrapper on access to __parent__ (that's why I could not reproduce the problem there). But, Products.Five.browser.BrowserView is not. If it is combined with Implicit (as in Products.Five..browser.tests.pages.PermissionView) an additional acquisition wrapper is added which can lead to an aq_parent loop.

The problem can either be fixed in BrowserView or in Acquisition. I would prefer the second option.

d-maurer

comment created time in 2 days

issue closedopenlawlibrary/pygls

Release v0.11.0

  • [x] update versions
  • [x] update CHANGELOG
  • [x] tag/build release
  • [x] upload to PyPI

closed time in 2 days

danixeee

issue commentopenlawlibrary/pygls

Release v0.11.0

Released: https://pypi.org/project/pygls/0.11.0/.

danixeee

comment created time in 2 days

push eventSlapOS/slapos.core

Xavier Thompson

commit sha 8a2561ada7ac77efd020a5a3cc4d9ed61cbe1406

slapgrid: Ignore slapformat dump file in warning Running slapformat creates a `.slapos-resource` file in each partition. Running slapgrid emits a warning if a free partition dir is not empty. With this commit, slapgrid only emits a warning if a free partition contains entries other than the slapformat dump file.

view details

Xavier Thompson

commit sha 7244f1f03548329895b38e23c902cc7db1b8e62b

slap/standalone: Add slapformat configuration This enables calling `slapos node format` from the command line. The configuration is updated every time `StandaloneSlapOS.format()` is called so that subsequent calls to `slapos node format` produce the same output. In the future, `StandaloneSlapOS.format()` could be adapted to call `slapos node format` directly. See merge request nexedi/slapos.core!308

view details

push time in 2 days

created tagopenlawlibrary/pygls

tagv0.11.0

a pythonic generic language server

created time in 2 days

delete branch openlawlibrary/pygls

delete branch : release/v0.11.0

delete time in 2 days

push eventopenlawlibrary/pygls

danixeee

commit sha 1c731bc6fd00c2d0336d7190da370c30e60b74d4

Release v0.11.0 (#197) * Update versions * Update changelog

view details

push time in 2 days

PR merged openlawlibrary/pygls

Reviewers
Release v0.11.0 release

Description (e.g. "Related to ...", etc.)

Related to #196.

Code review checklist (for code reviewer to complete)

  • [ ] Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • [ ] Title summarizes what is changing
  • [ ] Commit messages are meaningful (see this for details)
  • [ ] Tests have been included and/or updated, as appropriate
  • [ ] Docstrings have been included and/or updated, as appropriate
  • [ ] Standalone docs have been updated accordingly
  • [ ] CONTRIBUTORS.md was updated, as appropriate
  • [ ] Changelog has been updated, as needed (see CHANGELOG.md)
+12 -3

0 comment

3 changed files

danixeee

pr closed time in 2 days

issue openedzopefoundation/Zope

Strange acquisition loops

Python 3(.6), master

The code below demonstrates an acquisition loop:

>>> from Products import Five
>>> from Zope2.App.zcml import load_config, load_string
>>> load_config("configure.zcml", Five)
>>> load_string("""
... <configure xmlns:browser="http://namespaces.zope.org/browser"
...  xmlns="http://namespaces.zope.org/zope"> 
...   <browser:view
...       name="permission_view"
...       for="*"
...       class="Products.Five.browser.tests.pages.PermissionView"
...       permission="zope2.Public"
...       />
... </configure>
... """)
>>> from OFS.Folder import Folder
>>> f = Folder()
>>> 
>>> from zope.publisher.browser import TestRequest
>>> from zope.component import getMultiAdapter
>>> from Acquisition import aq_acquire, aq_parent, aq_inner
>>> 
>>> R = TestRequest()
>>> view = getMultiAdapter((f, R), name=u'permission_view')
>>> o = view
>>> for i in range(10):
...   print(i, type(o))
...   p = aq_parent(aq_inner(o))
...   if p is None: break
...   o = p
... 
0 <class 'Products.Five.browser.metaconfigure.permission_view'>
1 <class 'Acquisition.ImplicitAcquisitionWrapper'>
2 <class 'Products.Five.browser.metaconfigure.permission_view'>
3 <class 'Acquisition.ImplicitAcquisitionWrapper'>
4 <class 'Products.Five.browser.metaconfigure.permission_view'>
5 <class 'Acquisition.ImplicitAcquisitionWrapper'>
6 <class 'Products.Five.browser.metaconfigure.permission_view'>
7 <class 'Acquisition.ImplicitAcquisitionWrapper'>
8 <class 'Products.Five.browser.metaconfigure.permission_view'>
9 <class 'Acquisition.ImplicitAcquisitionWrapper'>

The code comes from Products.Five.browser.tests:pages.txt. I have extracted it in order to analyze why the test hangs.

The problem is actually in Acquisition. However, I have not yet been able to reproduce it there.

Playing with Acquisition's Python version, the problem was solved with the following modified aq_parent definition:

def aq_parent(obj):
    # needs to be safe to call from __getattribute__ of a wrapper
    # and reasonably fast
    if isinstance(obj, _Wrapper):
        return object.__getattribute__(obj, '_container')
    # if not a wrapper, deal with the __parent__
    # Do not acquisition wrap access to `__parent__`
    #return getattr(obj, '__parent__', None)
    parent = getattr(obj, '__parent__', None)
    if isinstance(parent, _Wrapper) and parent.aq_parent is obj:
        parent = parent.aq_self
    return parent

With this change, the loop results in the expected:

0 <class 'ExtensionClass.permission_view'>
1 <class 'OFS.Folder.Folder'>

created time in 2 days

PR opened openlawlibrary/pygls

Reviewers
Release v0.11.0 release

Description (e.g. "Related to ...", etc.)

Related to #196.

Code review checklist (for code reviewer to complete)

  • [ ] Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • [ ] Title summarizes what is changing
  • [ ] Commit messages are meaningful (see this for details)
  • [ ] Tests have been included and/or updated, as appropriate
  • [ ] Docstrings have been included and/or updated, as appropriate
  • [ ] Standalone docs have been updated accordingly
  • [ ] CONTRIBUTORS.md was updated, as appropriate
  • [ ] Changelog has been updated, as needed (see CHANGELOG.md)
+12 -3

0 comment

3 changed files

pr created time in 2 days

create barnchopenlawlibrary/pygls

branch : release/v0.11.0

created branch time in 2 days

issue openedopenlawlibrary/pygls

Release v0.11.0

  • [ ] update versions
  • [ ] update CHANGELOG
  • [ ] tag/build release
  • [ ] upload to PyPI

created time in 2 days

release grafana/grafana

v8.0.3

released time in 2 days

issue closedopenlawlibrary/pygls

Completion provider to provide non-saved file contents

Hi, great work on the lib!

I am writing a VSC extension for our python framework and trying to implement autocomplete. The problem is trigger_characters are not enough for me as I would need to know more context. E.g. differentiate when the completion was triggered by q.client. or q.app. so that I could provide valid completion items ofc. I am able to get the triggering file contents, but it is not up to date as the file is dirty (not saved yet).

My question is if there is any way to get the file contents of a dirty file.

closed time in 2 days

mturoci

push eventSlapOS/slapos

Jérome Perrin

commit sha d4bb29f6da67452454bd0a8867a6880d83d3bdfd

software/erp5: use "intermediate" haproxy TLS config **** NOT FOR MERGE **** this is because seleniumserver has super old chrome, but we'll update the test browser instead

view details

push time in 2 days

push eventNexedi/erp5

Jérome Perrin

commit sha beb061d8b22f25ac398bac58ae81e4c80fd8988f

ERP5TypeFunctionalTestCase: take screenshot and dump the page on error This is not really for errors during the test itself, but for errors when ERP5TypeFunctionalTestCase manipulates browser to execute selenium test.

view details

push time in 2 days

push eventNexedi/erp5

Jérome Perrin

commit sha beb061d8b22f25ac398bac58ae81e4c80fd8988f

ERP5TypeFunctionalTestCase: take screenshot and dump the page on error This is not really for errors during the test itself, but for errors when ERP5TypeFunctionalTestCase manipulates browser to execute selenium test.

view details

push time in 2 days

push eventzopefoundation/Zope

drfho

commit sha d26a77be0469d35c178956dafe6ce272256e47c5

fixed header spacing of copyright page (#980) * fixed header spacing of (c) page * improved header typography

view details

push time in 2 days

delete branch zopefoundation/Zope

delete branch : zmi_copyright_page

delete time in 2 days

PR merged zopefoundation/Zope

fixed header spacing of copyright page

hi @dataflake , just a tiny css fix for the copyright page: on that page the header had some margins. Now it is "in line" and typography is more consistant:

c_page

Best regards f

+11 -1

0 comment

1 changed file

drfho

pr closed time in 2 days

pull request commentzopefoundation/website-zope.de

revised logo, adapted typography / figures

Looking good, but personally I don't know where it's hosted or who is maintaining it.

drfho

comment created time in 2 days

push eventNexedi/erp5

Jérome Perrin

commit sha b1318292f3a06815a308dfba6887a20325b6a279

ERP5TypeFunctionalTestCase: take screenshot and dump the page on error This is not really for errors during the test itself, but for errors when ERP5TypeFunctionalTestCase manipulates browser to execute selenium test.

view details

push time in 2 days