[issue30628] why venv install old pip?

2017-06-14 Thread Curtis Doty

Curtis Doty added the comment:

diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index 716129d139..757e8de4e7 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -243,6 +243,9 @@ class EnvBuilder:
 cmd = [context.env_exe, '-Im', 'ensurepip', '--upgrade',
 '--default-pip']
 subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+cmd= [context.env_exe, '-Im', 'pip', 'install', '--upgrade',
+'pip', 'setuptools']
+subprocess.check_output(cmd, stderr=subprocess.STDOUT)
 
 def setup_scripts(self, context):
 """

Crude, but effective. Food for thought?

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30628>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30628] why venv install old pip?

2017-06-10 Thread Curtis Doty

Curtis Doty added the comment:

$ pip3.6 list
pip (9.0.1)
setuptools (32.2.0)
wheel (0.29.0)

$ pip3.6 install --upgrade pip setuptools wheel
$ pip3.6 list
pip (9.0.1)
setuptools (36.0.1)
wheel (0.29.0)

$ python3 -m venv foo
$ source foo/bin/activate
(foo) $ pip list
pip (9.0.1)
setuptools (28.8.0)

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30628>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30628] why venv install old pip?

2017-06-10 Thread Curtis Doty

New submission from Curtis Doty:

I've already updated system setuptools 36.0.1 with `pip3 install --upgrade pip 
setuptools wheel` but when I create a new enviro with `python3 -m venv foo` it 
will have an old/outdated setuptools 28.8.0 from embedded ensurepip.

Why? I think it should install the already-updated one!

--
components: Library (Lib)
messages: 295678
nosy: GreenKey
priority: normal
severity: normal
status: open
title: why venv install old pip?
type: behavior
versions: Python 3.6

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30628>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20896] test_ssl.test_get_server_certificate() should use PROTOCOL_SSLv23, not PROTOCOL_SSLv3

2014-03-16 Thread Curtis Doty

Changes by Curtis Doty cur...@greenkey.net:


--
nosy: +GreenKey

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20896
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20939] test_geturl of test_urllibnet fails with 'https://www.python.org/' != 'http://www.python.org/'

2014-03-16 Thread Curtis Doty

Changes by Curtis Doty cur...@greenkey.net:


--
nosy: +GreenKey

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20939
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19685] open() fails to autodetect utf-8 if LANG=C

2013-11-22 Thread Curtis Doty

New submission from Curtis Doty:

I first stumbled across this bug attempting to install use pip's cool editable 
mode:

$ pip install -e git+git://github.com/appliedsec/pygeoip.git#egg=pygeoip
Obtaining pygeoip from git+git://github.com/appliedsec/pygeoip.git#egg=pygeoip
  Cloning git://github.com/appliedsec/pygeoip.git to ./src/pygeoip
  Running setup.py egg_info for package pygeoip
Traceback (most recent call last):
  File string, line 16, in module
  File /home/curtis/python/3.3.3/lib/python3.3/encodings/ascii.py, line 
26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1098: 
ordinal not in range(128)
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

  File string, line 16, in module

  File /home/curtis/python/3.3.3/lib/python3.3/encodings/ascii.py, line 26, 
in decode

return codecs.ascii_decode(input, self.errors)[0]

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1098: 
ordinal not in range(128)


Cleaning up...
Command python setup.py egg_info failed with error code 1 in 
/home/curtis/python/2013-11-20/src/pygeoip
Storing complete log in /home/curtis/.pip/pip.log


It turns out this is related to a local LANG=C environment. If I set 
LANG=en_US.UTF-8, the problem goes away. But it seems pip/python3 open() should 
be more intelligently handling this.

Worse, the file in this case 
https://github.com/appliedsec/pygeoip/blob/master/setup.py already has a source 
code decorator *declaring* it as utf-8.

Ugly workaround patch is to force pip to always use 8-bit encoding on setup.py:

--- pip.orig/req.py 2013-11-19 15:53:49.0 -0800
+++ pip/req.py  2013-11-20 16:37:23.642656132 -0800
@@ -281,7 +281,7 @@ def replacement_run(self):
 writer(self, ep.name, os.path.join(self.egg_info,ep.name))
 self.find_sources()
 egg_info.egg_info.run = replacement_run
-exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))
+exec(compile(open(__file__,encoding='utf_8').read().replace('\\r\\n', '\\n'), 
__file__, 'exec'))
 
 
 def egg_info_data(self, filename):
@@ -687,7 +687,7 @@ exec(compile(open(__file__).read().repla
 ## FIXME: should we do --install-headers here too?
 call_subprocess(
 [sys.executable, '-c',
- import setuptools; __file__=%r; 
exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 
'exec')) % self.setup_py]
+ import setuptools; __file__=%r; 
exec(compile(open(__file__,encoding='utf_8').read().replace('\\r\\n', '\\n'), 
__file__, 'exec')) % self.setup_py]
 + list(global_options) + ['develop', '--no-deps'] + 
list(install_options),
 
 cwd=self.source_dir, filter_stdout=self._filter_install,


But that only treats the symptom. Root cause appears to be in python3 as 
demonstrated by this simple script:

wrong-codec.py:
#! /bin/env python3
from urllib.request import urlretrieve
urlretrieve('https://raw.github.com/appliedsec/pygeoip/master/setup.py', 
filename='setup.py')

# if LANC=C then locale.py:getpreferredencoding()-'ANSI_X3.4-1968'
foo= open('setup.py')

# bang! ascii_decode() cannot handle the unicode
bar= foo.read()


This does not occur in python2. Is this bug in pip or python3?

--
components: Unicode
messages: 203673
nosy: GreenKey, ezio.melotti, haypo
priority: normal
severity: normal
status: open
title: open() fails to autodetect utf-8 if LANG=C
type: crash
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19685
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com