[Pulp-dev] pulp-client on RHEL6 (python 2.6) uses python 2.7 syntax

Andreas.Piesk at voeb-zvd.de Andreas.Piesk at voeb-zvd.de
Thu Apr 23 20:47:04 UTC 2020


Hello list,

# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.10 (Santiago)

# rpm -qf /usr/lib/python2.6/site-packages/pulp/client/extensions/core.py
python-pulp-client-lib-2.21.1-1.el6.noarch

# pulp-consumer -v rpm repos
+----------------------------------------------------------------------+
                              Repositories
+----------------------------------------------------------------------+

2020-04-23 22:41:59,545 - ERROR - Client-side exception occurred
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pulp/client/extensions/core.py", 
line 476, in run
    exit_code = Cli.run(self, args)
  File "/usr/lib/python2.6/site-packages/okaara/cli.py", line 974, in run
    exit_code = command_or_section.execute(self.prompt, remaining_args)
  File 
"/usr/lib/python2.6/site-packages/pulp/client/extensions/extensions.py", 
line 210, in execute
    return self.method(*arg_list, **clean_kwargs)
  File 
"/usr/lib/python2.6/site-packages/pulp/client/commands/repo/query.py", 
line 44, in run
    self.prompt.render_document_list(repo_list, order=order)
  File "/usr/lib/python2.6/site-packages/pulp/client/extensions/core.py", 
line 373, in render_document_list
    line = line.decode('ascii', errors='ignore')
TypeError: decode() takes no keyword arguments
An unexpected error has occurred.More information may be found using the 
-vv
flag.

The fix i use (decode() keyword arguments were implemented in 2.7 i 
think):

--- /usr/lib/python2.6/site-packages/pulp/client/extensions/core.py.org 
2020-04-23 22:27:26.634292989 +0200
+++ /usr/lib/python2.6/site-packages/pulp/client/extensions/core.py 
2020-04-23 22:27:33.731370771 +0200
@@ -370,7 +370,7 @@
                 long_value_indent = max_key_length + spaces_between_cols 
+ indent
                 line = self.wrap(line, 
remaining_line_indent=long_value_indent)
                 # get rid of anything that isn't an ascii character
-                line = line.decode('ascii', errors='ignore')
+                line = line.decode('ascii', 'ignore')
                 self.write(line, tag=TAG_DOCUMENT, skip_wrap=True)
 
             # Only add a space if we're at the highest level of the 
rendering


Best Regards,
-ap
____________________________________________________

Andreas Piesk
Teamleiter Zentrale Applikationen
Informationstechnologie, Kartenprocessing und E-Payment

VÖB-ZVD Processing GmbH
Alemannenstraße 1, 53175 Bonn, Deutschland
Postfach 260132, 53153 Bonn, Deutschland
Tel +49 (0)228 9377-535
Fax +49 (0)228 9377-597
andreas.piesk at voeb-zvd.de

Besuchen Sie uns unter: www.voeb-zvd.de

Ein Unternehmen der Deutsche Bank Gruppe

---
Die Europäische Kommission hat unter http://ec.europa.eu/consumers/odr/ 
eine Europäische Online-Streitbeilegungsplattform (OS-Plattform) 
errichtet. Verbraucher können die OS-Plattform für die außergerichtliche 
Beilegung von Streitigkeiten aus Online-Verträgen mit in der EU 
niedergelassenen Unternehmen nutzen.

Informationen (einschließlich Pflichtangaben) zu einzelnen, innerhalb der 
EU tätigen Gesellschaften und Zweigniederlassungen des Konzerns Deutsche 
Bank finden Sie unter https://www.deutsche-bank.de/Pflichtangaben. Diese 
E-Mail enthält vertrauliche und/ oder rechtlich geschützte Informationen. 
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich 
erhalten haben, informieren Sie bitte sofort den Absender und vernichten 
Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe 
dieser E-Mail ist nicht gestattet.

The European Commission has established a European online dispute 
resolution platform (OS platform) under http://ec.europa.eu/consumers/odr/
. Consumers may use the OS platform to resolve disputes arising from 
online contracts with providers established in the EU.

Please refer to https://www.db.com/disclosures for information (including 
mandatory corporate particulars) on selected Deutsche Bank branches and 
group companies registered or incorporated in the European Union. This 
e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and delete this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is 
strictly forbidden.





More information about the Pulp-dev mailing list