Hello community,
here is the log from the commit of package python-pass_python_keyring for
openSUSE:Factory checked in at 2018-09-11 17:18:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pass_python_keyring (Old)
and /work/SRC/openSUSE:Factory/.python-pass_python_keyring.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pass_python_keyring"
Tue Sep 11 17:18:17 2018 rev:4 rq:634492 version:1.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-pass_python_keyring/python-pass_python_keyring.changes
2018-08-12 20:56:39.605624190 +0200
+++
/work/SRC/openSUSE:Factory/.python-pass_python_keyring.new/python-pass_python_keyring.changes
2018-09-11 17:18:18.195317537 +0200
@@ -1,0 +2,6 @@
+Mon Aug 20 23:41:25 UTC 2018 - [email protected]
+
+- Add python3.patch to fix TypeError on python3
+ https://github.com/notandy/pass_python_keyring/pull/6
+
+-------------------------------------------------------------------
New:
----
python3.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pass_python_keyring.spec ++++++
--- /var/tmp/diff_new_pack.kVXCdu/_old 2018-09-11 17:18:20.591313864 +0200
+++ /var/tmp/diff_new_pack.kVXCdu/_new 2018-09-11 17:18:20.599313852 +0200
@@ -29,6 +29,7 @@
URL: http://github.com/notandy/pass_python_keyring
Source:
http://github.com/notandy/%{mod_name}/archive/v%{version}.tar.gz
Source1: keyringrc.cfg
+Patch0: python3.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@@ -44,6 +45,7 @@
%prep
%setup -q -n %{mod_name}-%{version}
+%patch0 -p1
install -m0644 %{SOURCE1} .
%build
++++++ python3.patch ++++++
>From 0b49c548db332b6ffe14b7122a6e29bc3c94209f Mon Sep 17 00:00:00 2001
From: Theo Chatzimichos <[email protected]>
Date: Sun, 5 Aug 2018 13:51:02 +0200
Subject: [PATCH 1/2] remove whitespace
---
pass.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pass.py b/pass.py
index 21dc517..bdc4442 100755
--- a/pass.py
+++ b/pass.py
@@ -11,7 +11,7 @@
class Keyring(KeyringBackend):
"""Pass Keyring"""
- def supported(self):
+ def supported(self):
return 0
def get_password(self, service, username):
@@ -32,6 +32,6 @@ def set_password(self, service, username, password):
def delete_password(self, service, username):
proc = Popen(['pass', 'rm', '--force', '/'.join([service,username])])
- proc.wait()
+ proc.wait()
if(proc.returncode != 0):
raise PasswordDeleteError("Password not found")
>From 08c90c10d78ba80bd6b92586fda5487bf2ad5cc2 Mon Sep 17 00:00:00 2001
From: Theo Chatzimichos <[email protected]>
Date: Sun, 5 Aug 2018 14:04:31 +0200
Subject: [PATCH 2/2] fix python3 TypeError on get_password
the password that is returned in the get_password method is not a
string, so when called a TypeError is raised:
`TypeError: a bytes-like object is required, not 'str'`
By decoding it to utf-8 it works on python3, without breaking
compatibility on python2
---
pass.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pass.py b/pass.py
index bdc4442..96e2cd8 100755
--- a/pass.py
+++ b/pass.py
@@ -20,7 +20,7 @@ def get_password(self, service, username):
password, _ = proc.communicate()
proc.wait()
if(proc.returncode == 0):
- return password.rstrip('\n')
+ return password.decode('utf-8').rstrip('\n')
else:
return None