From 6256b3058204d61ca43bb0e3833e4e95441b63cc Mon Sep 17 00:00:00 2001 From: Jeff Quast Date: Sun, 7 Oct 2018 23:40:47 -0700 Subject: [PATCH 1/2] this might help.. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should prevent the following error, ``` $ pip --version pip 18.1 from /Users/jq/.pyenv/versions/3.6.5/envs/jupyter/lib/python3.6/site-packages/pip (python 3.6) $ pip install colout Collecting colout Downloading https://files.pythonhosted.org/packages/3d/ba/3ef31c0df3ace69271cc8b1af6b529f24de66ff42c0d99a8d18aa980a307/colout-0.5.tar.gz (47kB) 100% |████████████████████████████████| 51kB 970kB/s Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/private/var/folders/0x/y8s2qlk558596kyqdhv3nwv40000gn/T/pip-install-gixoekff/colout/setup.py", line 25, in long_description=open('README.md').read(), FileNotFoundError: [Errno 2] No such file or directory: 'README.md' ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/0x/y8s2qlk558596kyqdhv3nwv40000gn/T/pip-install-gixoekff/colout/ ``` --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a79d0cf..33e99b4 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ setup( name='colout', version='0.6', description='Color Up Arbitrary Command Output.', - long_description=open('README.md').read(), + long_description=open(os.path.join(os.path.dirname(__file__), 'README.md')).read(), author='nojhan', author_email='nojhan@nojhan.net', url='http://nojhan.github.com/colout/', From dab5555503b07fe3e1f730a2bdebd97f4b535c8c Mon Sep 17 00:00:00 2001 From: linkmauve Date: Thu, 19 Dec 2019 00:51:29 +0100 Subject: [PATCH 2/2] Update colout.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Python 2 will retire in thirteen days (see https://pythonclock.org/), there is no reason to keep obsolete checks in the code any longer. --- colout/colout.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/colout/colout.py b/colout/colout.py index 29ca071..b346d0e 100755 --- a/colout/colout.py +++ b/colout/colout.py @@ -30,8 +30,6 @@ signal.signal( signal.SIGPIPE, signal.SIG_DFL ) # Global variable(s) ############################################################################### -PY2 = sys.version_info.major == 2 - context = {} debug = False @@ -757,9 +755,6 @@ def write(colored, stream = sys.stdout): """ Write "colored" on sys.stdout, then flush. """ - if PY2: # If Python 2.x: force unicode - if isinstance(colored, unicode): - colored = colored.encode('utf-8') try: stream.write(colored) stream.flush()