New issue 2402: TypeError: object.__new__(_MemcacheClient) is not safe, use _MemcacheClient.__new__() https://bitbucket.org/pypy/pypy/issues/2402/typeerror-object__new__-_memcacheclient-is
Peter Wang: Hi, I am running tempest or an OpenStack gate testing, and getting this error: TypeError: object.__new__(_MemcacheClient) is not safe, use _MemcacheClient.__new__() while running under PyPy2. The error is coming from this file: site-packages/oslo_cache/_memcache_pool.py which is attached. However, same code works under CPython2.7. This may or may not be a PyPy bug, but would someone give me some suggestions on how to fix it? Tried to google around, and it seems related to class/object contructor, and how object is being instantiated, and passing global variables. But I don't understand how this works under CPython2.7. thanks, peter 7910 2016-09-14 21:21:56.470 | 2016-09-14 14:21:56.468 26064 CRITICAL keystone [-] TypeError: object.__new__(_MemcacheClient) is not safe, use _MemcacheClient.__new__() 7911 2016-09-14 21:21:56.470 | 2016-09-14 14:21:56.468 26064 TRACE keystone Traceback (most recent call last): 7912 2016-09-14 21:21:56.470 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/usr/local/bin/keystone-manage", line 10, in <module> 7913 2016-09-14 21:21:56.470 | 2016-09-14 14:21:56.468 26064 TRACE keystone sys.exit(main()) 7914 2016-09-14 21:21:56.470 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/stack/keystone/keystone/cmd/manage.py", line 44, in main 7915 2016-09-14 21:21:56.470 | 2016-09-14 14:21:56.468 26064 TRACE keystone cli.main(argv=sys.argv, config_files=config_files) 7916 2016-09-14 21:21:56.470 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/stack/keystone/keystone/cmd/cli.py", line 1254, in main 7917 2016-09-14 21:21:56.470 | 2016-09-14 14:21:56.468 26064 TRACE keystone CONF.command.cmd_class.main() 7918 2016-09-14 21:21:56.470 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/stack/keystone/keystone/cmd/cli.py", line 363, in main 7919 2016-09-14 21:21:56.470 | 2016-09-14 14:21:56.468 26064 TRACE keystone klass.do_bootstrap() 7920 2016-09-14 21:21:56.470 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/stack/keystone/keystone/cmd/cli.py", line 189, in do_bootstrap 7921 2016-09-14 21:21:56.470 | 2016-09-14 14:21:56.468 26064 TRACE keystone domain=default_domain) 7922 2016-09-14 21:21:56.470 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/stack/keystone/keystone/common/manager.py", line 124, in wrapped 7923 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone __ret_val = __f(*args, **kwargs) 7924 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/stack/keystone/keystone/resource/core.py", line 759, in create_domain 7925 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone domain_id, project_from_domain, initiator) 7926 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/stack/keystone/keystone/common/manager.py", line 124, in wrapped 7927 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone __ret_val = __f(*args, **kwargs) 7928 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/stack/keystone/keystone/resource/core.py", line 230, in create_project 7929 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone self.get_project.set(ret, self, project_id) 7930 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/pypy/site-packages/dogpile/cache/region.py", line 1228, in set_ 7931 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone self.set(key, value) 7932 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/pypy/site-packages/dogpile/cache/region.py", line 972, in set 7933 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone key = self.key_mangler(key) 7934 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/stack/keystone/keystone/common/cache/core.py", line 87, in key_mangler 7935 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone key = '%s:%s' % (key, invalidation_manager.region_id) 7936 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/stack/keystone/keystone/common/cache/core.py", line 45, in region_id 7937 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone self._region_key, self._generate_new_id, expiration_time=-1) 7938 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/pypy/site-packages/dogpile/cache/region.py", line 825, in get_or_create 7939 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone async_creator) as value: 7940 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/pypy/site-packages/dogpile/lock.py", line 154, in __enter__ 7941 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone return self._enter() 7942 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/pypy/site-packages/dogpile/lock.py", line 87, in _enter 7943 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone value = value_fn() 7944 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/pypy/site-packages/dogpile/cache/region.py", line 780, in get_value 7945 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone value = self.backend.get(key) 7946 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/pypy/site-packages/dogpile/cache/backends/memcached.py", line 161, in get 7947 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone value = self.client.get(key) 7948 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/pypy/lib_pypy/_functools.py", line 42, in __call__ 7949 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone return self._func(*(self._args + fargs), **fkeywords) 7950 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/pypy/site-packages/oslo_cache/backends/memcache_pool.py", line 35, in _run_method 7951 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone with self.client_pool.acquire() as client: 7952 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/pypy/lib-python/2.7/contextlib.py", line 17, in __enter__ 7953 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone return self.gen.next() 7954 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/pypy/site-packages/oslo_cache/_memcache_pool.py", line 128, in acquire 7955 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone conn = self.get(timeout=self._connection_get_timeout) 7956 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/pypy/lib-python/2.7/Queue.py", line 178, in get 7957 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone item = self._get() 7958 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/pypy/site-packages/oslo_cache/_memcache_pool.py", line 215, in _get 7959 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone conn = ConnectionPool._get(self) 7960 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/pypy/site-packages/oslo_cache/_memcache_pool.py", line 166, in _get 7961 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone conn = self._create_connection() 7962 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone File "/opt/pypy/site-packages/oslo_cache/_memcache_pool.py", line 207, in _create_connection 7963 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone return _MemcacheClient(self.urls, **self._arguments) 7964 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone TypeError: object.__new__(_MemcacheClient) is not safe, use _MemcacheClient.__new__() 7965 2016-09-14 21:21:56.471 | 2016-09-14 14:21:56.468 26064 TRACE keystone _______________________________________________ pypy-issue mailing list pypy-issue@python.org https://mail.python.org/mailman/listinfo/pypy-issue