Thread View
j: Next unread message
k: Previous unread message
j a: Jump to all threads
j l: Jump to MailingList overview
http://hg.python.org/peps/rev/d0de5805cbab
changeset: 5537:d0de5805cbab
user: Alex Gaynor <alex.gaynor(a)gmail.com>
date: Sun Aug 31 16:57:21 2014 -0700
summary:
PEP 476: Better document the warning mechanism discussed on python-dev
files:
pep-0476.txt | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/pep-0476.txt b/pep-0476.txt
--- a/pep-0476.txt
+++ b/pep-0476.txt
@@ -115,6 +115,15 @@
following this PEP will be modified to emit a warning in cases that would raise
an Exception in Python 3.5.
+Warnings
+--------
+
+To support this warning, in 3.4.next a new ``verify_mode`` is introduced
+``CERT_WARN``, which is equivilant to ``CERT_NONE``, except in cases that would
+fail as ``CERT_REQUIRED`` or fail the hostname check emits a warning. In
+3.4.next the ``httplib`` module will set this as the ``verify_mode`` if the
+default context is used.
+
Other protocols
===============
--
Repository URL: http://hg.python.org/peps
http://hg.python.org/cpython/rev/640c575ab3e1
changeset: 92290:640c575ab3e1
parent: 92284:2b2da4ae86b4
parent: 92289:75a5cc4ef31c
user: Jason R. Coombs <jaraco(a)jaraco.com>
date: Sun Aug 31 18:02:18 2014 -0400
summary:
Merge with 3.4; Closes #22315
files:
Lib/distutils/dir_util.py | 3 +--
Lib/distutils/tests/test_dir_util.py | 13 +++++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/Lib/distutils/dir_util.py b/Lib/distutils/dir_util.py
--- a/Lib/distutils/dir_util.py
+++ b/Lib/distutils/dir_util.py
@@ -125,12 +125,11 @@
try:
names = os.listdir(src)
except OSError as e:
- (errno, errstr) = e
if dry_run:
names = []
else:
raise DistutilsFileError(
- "error listing files in '%s': %s" % (src, errstr))
+ "error listing files in '%s': %s" % (src, e.strerror))
if not dry_run:
mkpath(dst, verbose=verbose)
diff --git a/Lib/distutils/tests/test_dir_util.py b/Lib/distutils/tests/test_dir_util.py
--- a/Lib/distutils/tests/test_dir_util.py
+++ b/Lib/distutils/tests/test_dir_util.py
@@ -3,7 +3,9 @@
import os
import stat
import sys
+from unittest.mock import patch
+from distutils import dir_util, errors
from distutils.dir_util import (mkpath, remove_tree, create_tree, copy_tree,
ensure_relative)
@@ -11,6 +13,7 @@
from distutils.tests import support
from test.support import run_unittest
+
class DirUtilTestCase(support.TempdirManager, unittest.TestCase):
def _log(self, msg, *args):
@@ -119,6 +122,16 @@
self.assertEqual(ensure_relative('c:\\home\\foo'), 'c:home\\foo')
self.assertEqual(ensure_relative('home\\foo'), 'home\\foo')
+ @patch('os.listdir', side_effect=OSError())
+ def test_copy_tree_exception_in_listdir(self, listdir):
+ """
+ An exception in listdir should raise a DistutilsFileError
+ """
+ with self.assertRaises(errors.DistutilsFileError):
+ src = self.tempdirs[-1]
+ dir_util.copy_tree(src, None)
+
+
def test_suite():
return unittest.makeSuite(DirUtilTestCase)
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/75a5cc4ef31c
changeset: 92289:75a5cc4ef31c
branch: 3.4
user: Jason R. Coombs <jaraco(a)jaraco.com>
date: Sun Aug 31 17:42:20 2014 -0400
summary:
#22315: Use advertised API for OSError
files:
Lib/distutils/dir_util.py | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/Lib/distutils/dir_util.py b/Lib/distutils/dir_util.py
--- a/Lib/distutils/dir_util.py
+++ b/Lib/distutils/dir_util.py
@@ -125,12 +125,11 @@
try:
names = os.listdir(src)
except OSError as e:
- (errno, errstr) = e
if dry_run:
names = []
else:
raise DistutilsFileError(
- "error listing files in '%s': %s" % (src, errstr))
+ "error listing files in '%s': %s" % (src, e.strerror))
if not dry_run:
mkpath(dst, verbose=verbose)
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/ddb0f90620b7
changeset: 92288:ddb0f90620b7
branch: 3.4
user: Jason R. Coombs <jaraco(a)jaraco.com>
date: Sun Aug 31 17:51:22 2014 -0400
summary:
#22315: Use an existent directory for 'src' to trigger appropriate behavior.
files:
Lib/distutils/tests/test_dir_util.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Lib/distutils/tests/test_dir_util.py b/Lib/distutils/tests/test_dir_util.py
--- a/Lib/distutils/tests/test_dir_util.py
+++ b/Lib/distutils/tests/test_dir_util.py
@@ -128,7 +128,8 @@
An exception in listdir should raise a DistutilsFileError
"""
with self.assertRaises(errors.DistutilsFileError):
- dir_util.copy_tree(self.target, None)
+ src = self.tempdirs[-1]
+ dir_util.copy_tree(src, None)
def test_suite():
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/3402813338db
changeset: 92287:3402813338db
branch: 3.4
user: Jason R. Coombs <jaraco(a)jaraco.com>
date: Sun Aug 31 17:37:35 2014 -0400
summary:
#22315: Provide an actual directory during test invocation.
files:
Lib/distutils/tests/test_dir_util.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Lib/distutils/tests/test_dir_util.py b/Lib/distutils/tests/test_dir_util.py
--- a/Lib/distutils/tests/test_dir_util.py
+++ b/Lib/distutils/tests/test_dir_util.py
@@ -128,7 +128,7 @@
An exception in listdir should raise a DistutilsFileError
"""
with self.assertRaises(errors.DistutilsFileError):
- dir_util.copy_tree('src', None)
+ dir_util.copy_tree(self.target, None)
def test_suite():
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/300cd36eb25c
changeset: 92286:300cd36eb25c
branch: 3.4
user: Jason R. Coombs <jaraco(a)jaraco.com>
date: Sun Aug 31 17:31:32 2014 -0400
summary:
#22315: Use technique outlined in test_file_util
files:
Lib/distutils/tests/test_dir_util.py | 27 ++-------------
1 files changed, 5 insertions(+), 22 deletions(-)
diff --git a/Lib/distutils/tests/test_dir_util.py b/Lib/distutils/tests/test_dir_util.py
--- a/Lib/distutils/tests/test_dir_util.py
+++ b/Lib/distutils/tests/test_dir_util.py
@@ -3,7 +3,7 @@
import os
import stat
import sys
-import contextlib
+from unittest.mock import patch
from distutils import dir_util, errors
from distutils.dir_util import (mkpath, remove_tree, create_tree, copy_tree,
@@ -14,19 +14,6 @@
from test.support import run_unittest
-(a)contextlib.context_manager
-def patch_obj(obj, attr, replacement):
- """
- A poor man's mock.patch.object
- """
- orig = getattr(obj, attr)
- try:
- setattr(obj, attr, replacement)
- yield
- finally:
- setattr(obj, attr, orig)
-
-
class DirUtilTestCase(support.TempdirManager, unittest.TestCase):
def _log(self, msg, *args):
@@ -135,17 +122,13 @@
self.assertEqual(ensure_relative('c:\\home\\foo'), 'c:home\\foo')
self.assertEqual(ensure_relative('home\\foo'), 'home\\foo')
- def test_copy_tree_exception_in_listdir(self):
+ @patch('os.listdir', side_effect=OSError())
+ def test_copy_tree_exception_in_listdir(self, listdir):
"""
An exception in listdir should raise a DistutilsFileError
"""
- def new_listdir(path):
- raise OSError()
- # simulate a transient network error or other failure invoking listdir
- with patch_obj(os, 'listdir', new_listdir):
- args = 'src', None
- exc = errors.DistutilsFileError
- self.assertRaises(exc, dir_util.copy_tree, *args)
+ with self.assertRaises(errors.DistutilsFileError):
+ dir_util.copy_tree('src', None)
def test_suite():
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/7304b9b95438
changeset: 92285:7304b9b95438
branch: 3.4
parent: 92283:c3cecf8e7497
user: Jason R. Coombs <jaraco(a)jaraco.com>
date: Sun Aug 31 15:02:42 2014 -0400
summary:
#22315: Add test to capture the failure.
files:
Lib/distutils/tests/test_dir_util.py | 29 ++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/Lib/distutils/tests/test_dir_util.py b/Lib/distutils/tests/test_dir_util.py
--- a/Lib/distutils/tests/test_dir_util.py
+++ b/Lib/distutils/tests/test_dir_util.py
@@ -3,7 +3,9 @@
import os
import stat
import sys
+import contextlib
+from distutils import dir_util, errors
from distutils.dir_util import (mkpath, remove_tree, create_tree, copy_tree,
ensure_relative)
@@ -11,6 +13,20 @@
from distutils.tests import support
from test.support import run_unittest
+
+(a)contextlib.context_manager
+def patch_obj(obj, attr, replacement):
+ """
+ A poor man's mock.patch.object
+ """
+ orig = getattr(obj, attr)
+ try:
+ setattr(obj, attr, replacement)
+ yield
+ finally:
+ setattr(obj, attr, orig)
+
+
class DirUtilTestCase(support.TempdirManager, unittest.TestCase):
def _log(self, msg, *args):
@@ -119,6 +135,19 @@
self.assertEqual(ensure_relative('c:\\home\\foo'), 'c:home\\foo')
self.assertEqual(ensure_relative('home\\foo'), 'home\\foo')
+ def test_copy_tree_exception_in_listdir(self):
+ """
+ An exception in listdir should raise a DistutilsFileError
+ """
+ def new_listdir(path):
+ raise OSError()
+ # simulate a transient network error or other failure invoking listdir
+ with patch_obj(os, 'listdir', new_listdir):
+ args = 'src', None
+ exc = errors.DistutilsFileError
+ self.assertRaises(exc, dir_util.copy_tree, *args)
+
+
def test_suite():
return unittest.makeSuite(DirUtilTestCase)
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/2b2da4ae86b4
changeset: 92284:2b2da4ae86b4
parent: 92280:28cbbe2ce104
parent: 92283:c3cecf8e7497
user: Benjamin Peterson <benjamin(a)python.org>
date: Sun Aug 31 17:22:27 2014 -0400
summary:
merge 3.4
files:
Lib/distutils/tests/test_dir_util.py | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/Lib/distutils/tests/test_dir_util.py b/Lib/distutils/tests/test_dir_util.py
--- a/Lib/distutils/tests/test_dir_util.py
+++ b/Lib/distutils/tests/test_dir_util.py
@@ -2,7 +2,6 @@
import unittest
import os
import stat
-import shutil
import sys
from distutils.dir_util import (mkpath, remove_tree, create_tree, copy_tree,
@@ -52,7 +51,7 @@
self.assertEqual(self._logs, wanted)
@unittest.skipIf(sys.platform.startswith('win'),
- "This test is only appropriate for POSIX-like systems.")
+ "This test is only appropriate for POSIX-like systems.")
def test_mkpath_with_custom_mode(self):
# Get and set the current umask value for testing mode bits.
umask = os.umask(0o002)
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/c3cecf8e7497
changeset: 92283:c3cecf8e7497
branch: 3.4
user: Jason R. Coombs <jaraco(a)jaraco.com>
date: Sun Aug 31 15:00:47 2014 -0400
summary:
Correct indent
files:
Lib/distutils/tests/test_dir_util.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Lib/distutils/tests/test_dir_util.py b/Lib/distutils/tests/test_dir_util.py
--- a/Lib/distutils/tests/test_dir_util.py
+++ b/Lib/distutils/tests/test_dir_util.py
@@ -51,7 +51,7 @@
self.assertEqual(self._logs, wanted)
@unittest.skipIf(sys.platform.startswith('win'),
- "This test is only appropriate for POSIX-like systems.")
+ "This test is only appropriate for POSIX-like systems.")
def test_mkpath_with_custom_mode(self):
# Get and set the current umask value for testing mode bits.
umask = os.umask(0o002)
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/afeafb8fcaf1
changeset: 92282:afeafb8fcaf1
branch: 3.4
parent: 92279:ad67f66a5f3c
user: Jason R. Coombs <jaraco(a)jaraco.com>
date: Sun Aug 31 13:43:02 2014 -0400
summary:
Remove unused import
files:
Lib/distutils/tests/test_dir_util.py | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/Lib/distutils/tests/test_dir_util.py b/Lib/distutils/tests/test_dir_util.py
--- a/Lib/distutils/tests/test_dir_util.py
+++ b/Lib/distutils/tests/test_dir_util.py
@@ -2,7 +2,6 @@
import unittest
import os
import stat
-import shutil
import sys
from distutils.dir_util import (mkpath, remove_tree, create_tree, copy_tree,
--
Repository URL: http://hg.python.org/cpython