Bug 1263923

Summary: Getting UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1001 due to obsolete python setuptools version in OpenShift Online
Product: Red Hat Software Collections Reporter: Kenjiro Nakayama <knakayam>
Component: python-setuptoolsAssignee: Python Maintainers <python-maint>
Status: CLOSED EOL QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: python33CC: aos-bugs, jgoulding, jokerman, kanderso, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-31 14:58:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kenjiro Nakayama 2015-09-17 05:54:25 UTC
Description of problem:
---

Some packages (like PyJWT,djangorestframework-xml) getting UnicodeDecodeError during the installation due to the obsolete setuptools versoin.

Additional info:
---
We can avoid this issue after setuptools update by hand. However we need to build the gear by jenkins, so still need setuptools update.

Reproduce steps:
---
Step-1. Create python-3.3 application

$ rhc app-create helloworld python-3.3

Step-2. Modify setup.py like below

$ cd helloworld/
$ vi setup.py
~~~
from setuptools import setup

packages = [
'djangorestframework-jwt==1.7.2',
'djangorestframework-xml==1.0.1',
]

setup(name='helloworld',
version='1.0',
description='OpenShift App',
author='Your Name',
author_email='example',
url='http://www.python.org/sigs/distutils-sig/',
install_requires=packages,
)
~~~~

Step-3. git push

$ git commit -am "test"
$ git push

Step-4. You can see the error like below

~~~
remote: install_requires=packages,
remote: File "/opt/rh/python33/root/usr/lib64/python3.3/distutils/core.py", line 148, in setup
remote: dist.run_commands()
remote: File "/opt/rh/python33/root/usr/lib64/python3.3/distutils/dist.py", line 929, in run_commands
remote: self.run_command(cmd)
remote: File "/opt/rh/python33/root/usr/lib64/python3.3/distutils/dist.py", line 948, in run_command
remote: cmd_obj.run()
remote: File "/opt/rh/python33/root/usr/lib/python3.3/site-packages/setuptools/command/develop.py", line 27, in run
remote: self.install_for_development()
remote: File "/opt/rh/python33/root/usr/lib/python3.3/site-packages/setuptools/command/develop.py", line 129, in install_for_development
remote: self.process_distribution(None, self.dist, not self.no_deps)
remote: File "/opt/rh/python33/root/usr/lib/python3.3/site-packages/setuptools/command/easy_install.py", line 706, in process_distribution
remote: [requirement], self.local_index, self.easy_install
remote: File "/opt/rh/python33/root/usr/lib/python3.3/site-packages/pkg_resources.py", line 618, in resolve
remote: dist = best[req.key] = env.best_match(req, self, installer)
remote: File "/opt/rh/python33/root/usr/lib/python3.3/site-packages/pkg_resources.py", line 862, in best_match
remote: return self.obtain(req, installer) # try and download/install
remote: File "/opt/rh/python33/root/usr/lib/python3.3/site-packages/pkg_resources.py", line 874, in obtain
remote: return installer(requirement)
remote: File "/opt/rh/python33/root/usr/lib/python3.3/site-packages/setuptools/command/easy_install.py", line 623, in easy_install
remote: return self.install_item(spec, dist.location, tmpdir, deps)
remote: File "/opt/rh/python33/root/usr/lib/python3.3/site-packages/setuptools/command/easy_install.py", line 653, in install_item
remote: dists = self.install_eggs(spec, download, tmpdir)
remote: File "/opt/rh/python33/root/usr/lib/python3.3/site-packages/setuptools/command/easy_install.py", line 849, in install_eggs
remote: return self.build_and_install(setup_script, setup_base)
remote: File "/opt/rh/python33/root/usr/lib/python3.3/site-packages/setuptools/command/easy_install.py", line 1130, in build_and_install
remote: self.run_setup(setup_script, setup_base, args)
remote: File "/opt/rh/python33/root/usr/lib/python3.3/site-packages/setuptools/command/easy_install.py", line 1115, in run_setup
remote: run_setup(setup_script, args)
remote: File "/opt/rh/python33/root/usr/lib/python3.3/site-packages/setuptools/sandbox.py", line 69, in run_setup
remote: lambda: execfile(
remote: File "/opt/rh/python33/root/usr/lib/python3.3/site-packages/setuptools/sandbox.py", line 120, in run
remote: return func()
remote: File "/opt/rh/python33/root/usr/lib/python3.3/site-packages/setuptools/sandbox.py", line 71, in <lambda>
remote: {'__file__':setup_script, '__name__':'__main__'}
remote: File "/opt/rh/python33/root/usr/lib/python3.3/site-packages/setuptools/compat.py", line 89, in execfile
remote: source = f.read()
remote: File "/opt/rh/python33/root/usr/lib64/python3.3/encodings/ascii.py", line 26, in decode
remote: return codecs.ascii_decode(input, self.errors)[0]
remote: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 357: ordinal not in range(128)
~~~

Comment 3 Andy Grimm 2015-09-18 18:29:30 UTC
OpenShift Online simply pulls this package from SCL, so if there is an issue with setuptools, it belongs with the SCL team.

Comment 4 Andy Grimm 2015-09-18 19:19:45 UTC
FWIW, this issue happens when the locale is unset in an OpenShift gear, and locale.getpreferredencoding is returning ANSI_X3.4-1968.  A user can work around this simply with:  rhc setenv LANG=en_US.UTF-8

Comment 7 Joe Orton 2016-10-12 12:31:00 UTC
Red Hat does not currently plan to provide any further changes to this collection in a Red Hat Software Collections update release.

This software collection is nearing the retirement date (October 2016) after which customers are encouraged either to upgrade to a later release or continue on as self-supported without official Red Hat Support.

Please contact Red Hat Support if you have further questions, or refer to the support lifecycle page for more information. https://access.redhat.com/support/policy/updates/rhscl/

Comment 8 Joe Orton 2017-03-31 14:58:36 UTC
In accordance with the Red Hat Software Collections Product Life Cycle, the support period for this collection has ended.

New bug fix, enhancement, and security errata updates, as well as technical support services will no longer be made available for this collection.

Customers are encouraged to upgrade to a later release.

Please contact Red Hat Support if you have further questions, or refer to the support lifecycle page for more information. https://access.redhat.com/support/policy/updates/rhscl/