Compare commits
10 Commits
b16e0549e9
...
72babb1bd9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72babb1bd9 | ||
|
|
8d86b29ef2 | ||
|
|
ab3ed7f83d | ||
|
|
daedce90ad | ||
|
|
57b0e3b402 | ||
|
|
da98c8d497 | ||
|
|
1ef96da9d5 | ||
|
|
3f1ce62e68 | ||
|
|
55c5b812e4 | ||
|
|
8378947cbc |
@ -0,0 +1,57 @@
|
||||
From f5e4d4f39cee3d3489242387409af0de917fb84c Mon Sep 17 00:00:00 2001
|
||||
From: Sean Reifschneider <sean@realgo.com>
|
||||
Date: Sat, 15 Apr 2023 14:45:18 -0600
|
||||
Subject: [PATCH] Decoding in slab funcs, replacing "1" with "True" in while.
|
||||
|
||||
The slab functions needed a decode (as noted in
|
||||
https://github.com/linsomniac/python-memcached/pull/175), adapted that
|
||||
patch. Also converted "while 1" to "while True" while I was in there.
|
||||
---
|
||||
memcache.py | 14 +++++++++-----
|
||||
1 file changed, 9 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/memcache.py b/memcache.py
|
||||
index 8c38e56..1aa9987 100644
|
||||
--- a/memcache.py
|
||||
+++ b/memcache.py
|
||||
@@ -323,11 +323,13 @@ class Client(threading.local):
|
||||
serverData = {}
|
||||
data.append((name, serverData))
|
||||
readline = s.readline
|
||||
- while 1:
|
||||
+ while True:
|
||||
line = readline()
|
||||
- if not line or line.decode('ascii').strip() == 'END':
|
||||
+ if line:
|
||||
+ line = line.decode('ascii')
|
||||
+ if not line or line.strip() == 'END':
|
||||
break
|
||||
- stats = line.decode('ascii').split(' ', 2)
|
||||
+ stats = line.split(' ', 2)
|
||||
serverData[stats[1]] = stats[2]
|
||||
|
||||
return data
|
||||
@@ -347,8 +349,10 @@ class Client(threading.local):
|
||||
data.append((name, serverData))
|
||||
s.send_cmd('stats slabs')
|
||||
readline = s.readline
|
||||
- while 1:
|
||||
+ while True:
|
||||
line = readline()
|
||||
+ if line:
|
||||
+ line = line.decode('ascii')
|
||||
if not line or line.strip() == 'END':
|
||||
break
|
||||
item = line.split(' ', 2)
|
||||
@@ -378,7 +382,7 @@ class Client(threading.local):
|
||||
data.append((name, serverData))
|
||||
s.send_cmd('stats items')
|
||||
readline = s.readline
|
||||
- while 1:
|
||||
+ while True:
|
||||
line = readline()
|
||||
if not line or line.strip() == 'END':
|
||||
break
|
||||
--
|
||||
2.43.0
|
||||
|
||||
Binary file not shown.
BIN
python-memcached-1.59.tar.gz
Normal file
BIN
python-memcached-1.59.tar.gz
Normal file
Binary file not shown.
@ -1,20 +1,19 @@
|
||||
Name: python-memcached
|
||||
Version: 1.58
|
||||
Release: 1
|
||||
Version: 1.59
|
||||
Release: 3
|
||||
Summary: A Python memcached client library
|
||||
License: Python
|
||||
URL: https://github.com/linsomniac/python-memcached
|
||||
Source0: https://files.pythonhosted.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
|
||||
BuildArch: noarch
|
||||
|
||||
Patch0: backport-Decoding-in-slab-funcs-replacing-1-with-True-in-while.patch
|
||||
|
||||
%bcond_without python2
|
||||
%bcond_without python3
|
||||
%bcond_without check
|
||||
|
||||
|
||||
%{?with_python2:BuildRequires: python2-devel,python2-setuptools,python2-six,python2-nose}
|
||||
%{?with_python3:BuildRequires: python3-devel,python3-setuptools,python3-six,python3-nose}
|
||||
%{?with_python3:BuildRequires: python3-devel,python3-setuptools,python3-six}
|
||||
|
||||
# Required for running test suite
|
||||
%if %{with check}
|
||||
@ -30,23 +29,6 @@ for more information.
|
||||
%{desc}
|
||||
|
||||
|
||||
|
||||
%if %{with python2}
|
||||
%package -n python2-memcached
|
||||
Summary: %{summary}
|
||||
%{?python_provide:%python_provide python2-memcached}
|
||||
|
||||
%description -n python2-memcached
|
||||
%{desc}
|
||||
|
||||
|
||||
%files -n python2-memcached
|
||||
%doc ChangeLog README.md
|
||||
%attr(755,root,root) %{python2_sitelib}/memcache.py
|
||||
%{python2_sitelib}/memcache.py[co]
|
||||
%{python2_sitelib}/python_memcached-%{version}-py*.egg-info/
|
||||
%endif # python2
|
||||
|
||||
%package -n python3-memcached
|
||||
Summary: %{summary}
|
||||
%{?python_provide:%python_provide python3-memcached}
|
||||
@ -62,32 +44,30 @@ Summary: %{summary}
|
||||
%{python3_sitelib}/python_memcached-%{version}-py*.egg-info/
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version}
|
||||
%autosetup -n %{name}-%{version} -p1
|
||||
|
||||
|
||||
%build
|
||||
%py2_build
|
||||
%py3_build
|
||||
|
||||
|
||||
%install
|
||||
%if %{with python2}
|
||||
%py2_install
|
||||
%endif
|
||||
%py3_install
|
||||
|
||||
|
||||
%check
|
||||
pidfile=$(mktemp)
|
||||
memcached -d -P $pidfile
|
||||
|
||||
%if %{with python2}
|
||||
%{__python2} -m nose
|
||||
%endif
|
||||
%{__python3} -m nose
|
||||
|
||||
kill $(cat $pidfile)
|
||||
|
||||
%changelog
|
||||
* Fri May 10 2024 xiejing <xiejing@kylinos.cn> - 1.59-3
|
||||
- Decoding in slab funcs, replacing "1" with "True" in while
|
||||
|
||||
* Mon Jan 10 2022 yanglongkang <yanglongkang@huawei.com> - 1.59-2
|
||||
- delete python-nose Buildrequires
|
||||
|
||||
* Thu Jul 15 2021 huangtianhua <huangtianhua@huawei.com> 1.59-1
|
||||
- Upgrade to 1.59 to support OpenStack-W
|
||||
|
||||
* Fri Oct 30 2020 yanglongkang <yanglongkang@huawei.com> - 1.58.2
|
||||
- remove python2 dependency
|
||||
|
||||
* Wed Feb 12 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.58.1
|
||||
- Package init
|
||||
|
||||
4
python-memcached.yaml
Normal file
4
python-memcached.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
version_control: github
|
||||
src_repo: linsomniac/python-memcached
|
||||
tag_prefix: release-
|
||||
seperator: .
|
||||
Loading…
x
Reference in New Issue
Block a user