Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
141
Merge Requests
141
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
121616b4
Commit
121616b4
authored
Mar 07, 2024
by
Kazuhiko Shiozaki
Committed by
Arnaud Fontaine
Jul 05, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patch: update memcache_client patch based on python-memcached-1.58.
parent
5c865da0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
21 deletions
+17
-21
product/ERP5Type/patches/memcache_client.py
product/ERP5Type/patches/memcache_client.py
+17
-21
No files found.
product/ERP5Type/patches/memcache_client.py
View file @
121616b4
# -*- coding: utf-8 -*-
# Code based on python-memcached-1.5
3
# Code based on python-memcached-1.5
8
try
:
from
memcache
import
_Host
,
Client
,
_Error
except
ImportError
:
...
...
@@ -15,9 +15,11 @@ else:
pass
Client
.
MemcachedConnectionError
=
_ConnectionDeadError
import
six
import
socket
def
_get
(
self
,
cmd
,
key
):
if
getattr
(
self
,
'do_check_key'
,
True
):
key
=
self
.
_encode_key
(
key
)
if
self
.
do_check_key
:
self
.
check_key
(
key
)
server
,
key
=
self
.
_get_server
(
key
)
if
not
server
:
...
...
@@ -29,25 +31,22 @@ else:
self
.
_statlog
(
cmd
)
try
:
server
.
send_cmd
(
"%s %s"
%
(
cmd
,
key
))
cmd_bytes
=
cmd
.
encode
(
'utf-8'
)
if
six
.
PY3
else
cmd
fullcmd
=
b''
.
join
((
cmd_bytes
,
b' '
,
key
))
server
.
send_cmd
(
fullcmd
)
rkey
=
flags
=
rlen
=
cas_id
=
None
if
cmd
==
'gets'
:
try
:
rkey
,
flags
,
rlen
,
cas_id
,
=
self
.
_expect_cas_value
(
server
,
raise_exception
=
True
)
except
TypeError
:
# BBB
rkey
,
flags
,
rlen
,
cas_id
,
=
self
.
_expect_cas_value
(
server
)
rkey
,
flags
,
rlen
,
cas_id
,
=
self
.
_expect_cas_value
(
server
,
raise_exception
=
True
)
if
rkey
and
self
.
cache_cas
:
self
.
cas_ids
[
rkey
]
=
cas_id
else
:
try
:
rkey
,
flags
,
rlen
,
=
self
.
_expectvalue
(
server
,
raise_exception
=
True
)
except
TypeError
:
# BBB
rkey
,
flags
,
rlen
,
=
self
.
_expectvalue
(
server
)
rkey
,
flags
,
rlen
,
=
self
.
_expectvalue
(
server
,
raise_exception
=
True
)
if
not
rkey
:
# (patch)
# return None
...
...
@@ -55,13 +54,10 @@ else:
try
:
value
=
self
.
_recv_value
(
server
,
flags
,
rlen
)
finally
:
try
:
server
.
expect
(
"END"
,
raise_exception
=
True
)
except
TypeError
:
# BBB
server
.
expect
(
"END"
)
server
.
expect
(
b"END"
,
raise_exception
=
True
)
except
(
_Error
,
socket
.
error
)
as
msg
:
if
isinstance
(
msg
,
tuple
):
msg
=
msg
[
1
]
if
isinstance
(
msg
,
tuple
):
msg
=
msg
[
1
]
server
.
mark_dead
(
msg
)
# (patch)
# return None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment