List of commits:
Subject Hash Author Date (UTC)
bpo-29763: Use unittest cleanup in test_site (GH-841) b94d7fd4efa877d649cea9c8125c8869ffe0c32d Zachary Ware 2017-04-01 05:18:23
Link to the devguide's PR guidelines (GH-932) 1e5766ff436cea8871042d3b3be571e04b4058f9 Brett Cannon 2017-03-31 21:19:04
bpo-29953: Fix memory leaks in the replace() method of datetime and time (#927) 314d6fca36a4eaa0541218431d14804fadec6488 Serhiy Storchaka 2017-03-31 19:48:16
Fix spurious MemoryError introduced by PR #886. (#930) 06bb4873d6a9ac303701d08a851d6cd9a51e02a3 T. Wouters 2017-03-31 17:10:19
bpo-29941: Assert fixes (#886) a00c3fd12d421e41b769debd7df717d17b0deed5 T. Wouters 2017-03-31 16:14:41
suppress compiler warnings in _ctypes_test (#902) 164d30eb1e66575dafee6af4fca4cbf52c7fbe6a Benjamin Peterson 2017-03-31 11:05:25
bpo-29952: Use usual terminology of dict (GH-917) cdcac039fb447f2ab04efcacbe663751bb2cb4ec cocoatomo 2017-03-31 05:48:49
Remove catching OSError in ftphandler test. Only URLError is raised in urllib.request module. (#918) ed3dd1c02af6872bd0748f7b9a5dadb89f7b830f Senthil Kumaran 2017-03-31 05:43:05
bpo-29928: Add f-string to the Glossary (GH-864) 33db068dac7686e37736f7ecf8abb2aee0345cf2 Mariatta 2017-03-30 19:12:18
bpo-29946: Fix "sqrtpi defined but not used" (#908) 7a26464c6496c29244072fdd80f9b92c68174742 Louie Lu 2017-03-30 17:05:10
bpo-29942: Fix the use of recursion in itertools.chain.from_iterable. (#889) 5466d4af5fe76ec0a5fbc8a05675287d9e8e9d14 T. Wouters 2017-03-30 16:58:35
bpo-10030: Sped up reading encrypted ZIP files by 2 times. (#550) 06e522521c06671b4559eecf9e2a185c2d62c141 Serhiy Storchaka 2017-03-30 16:09:08
bpo-29935: Fixed error messages in the index() method of tuple, list and deque (#887) d4edfc9abffca965e76ebc5957a92031a4d6c4d4 Serhiy Storchaka 2017-03-30 15:29:23
bpo-29204: Emit warnings for already deprecated ElementTree features. (#773) 762ec97ea68a1126b8855996c61fa8239dc9fff7 Serhiy Storchaka 2017-03-30 15:12:06
bpo-29887: Test normalization now fails if download fails (#905) 722a3af092b94983aa26f5e591fb1b45e2c2a0ff Victor Stinner 2017-03-30 15:06:53
bpo-20548: Use specific asserts in warnings and exceptions tests (#788) f15c4d374a07c576c0e8349b16604f6dbad0b953 Serhiy Storchaka 2017-03-30 15:05:08
bpo-29913: deprecate compare_networks() in documentation (GH-865) 16f852345bcdec1bbb15e5363fad6b33bf960912 s-sanjay 2017-03-30 07:44:29
bpo-29918: Add missed "const" modifiers in C API documentation. (#846) 84b8e92e463bd6a5174bd3e5a6543580f6319c57 Serhiy Storchaka 2017-03-30 07:01:03
bpo-27863: Fixed multiple crashes in ElementTree. (#765) 576def096ec7b64814e038f03290031f172886c3 Serhiy Storchaka 2017-03-30 06:47:31
bpo-29816: Shift operation now has less opportunity to raise OverflowError. (#680) 918403cfc3304d27e80fb792357f40bb3ba69c4e Serhiy Storchaka 2017-03-30 06:47:07
Commit b94d7fd4efa877d649cea9c8125c8869ffe0c32d - bpo-29763: Use unittest cleanup in test_site (GH-841)
Author: Zachary Ware
Author date (UTC): 2017-04-01 05:18
Committer name: GitHub
Committer date (UTC): 2017-04-01 05:18
Parent(s): 1e5766ff436cea8871042d3b3be571e04b4058f9
Signer:
Signing key:
Signing status: N
Tree: ea18082fa73f5cc2e6d286ff42f0a66fa8dc16c9
File Lines added Lines deleted
Lib/test/test_site.py 34 45
File Lib/test/test_site.py changed (mode: 100644) (index 342ec9e43d..78d59e290d)
... ... import urllib.error
17 17 import shutil import shutil
18 18 import subprocess import subprocess
19 19 import sysconfig import sysconfig
20 import tempfile
20 21 from copy import copy from copy import copy
21 22
22 23 # These tests are not particularly useful if Python was invoked with -S. # These tests are not particularly useful if Python was invoked with -S.
 
... ... class StartupImportTests(unittest.TestCase):
489 490 'import site, sys; site.enablerlcompleter(); sys.exit(hasattr(sys, "__interactivehook__"))']).wait() 'import site, sys; site.enablerlcompleter(); sys.exit(hasattr(sys, "__interactivehook__"))']).wait()
490 491 self.assertTrue(r, "'__interactivehook__' not added by enablerlcompleter()") self.assertTrue(r, "'__interactivehook__' not added by enablerlcompleter()")
491 492
492 @classmethod
493
494 @unittest.skipUnless(sys.platform == 'win32', "only supported on Windows")
495 class _pthFileTests(unittest.TestCase):
496
493 497 def _create_underpth_exe(self, lines): def _create_underpth_exe(self, lines):
494 exe_file = os.path.join(os.getenv('TEMP'), os.path.split(sys.executable)[1])
498 self.temp_dir = tempfile.TemporaryDirectory()
499 self.addCleanup(self.temp_dir.cleanup)
500 exe_file = os.path.join(
501 self.temp_dir.name,
502 os.path.split(sys.executable)[1],
503 )
495 504 shutil.copy(sys.executable, exe_file) shutil.copy(sys.executable, exe_file)
496 505
497 506 _pth_file = os.path.splitext(exe_file)[0] + '._pth' _pth_file = os.path.splitext(exe_file)[0] + '._pth'
498 try:
499 with open(_pth_file, 'w') as f:
500 for line in lines:
501 print(line, file=f)
502 return exe_file
503 except:
504 test.support.unlink(_pth_file)
505 test.support.unlink(exe_file)
506 raise
507
508 @classmethod
509 def _cleanup_underpth_exe(self, exe_file):
510 _pth_file = os.path.splitext(exe_file)[0] + '._pth'
511 test.support.unlink(_pth_file)
512 test.support.unlink(exe_file)
507 with open(_pth_file, 'w') as f:
508 for line in lines:
509 print(line, file=f)
510 return exe_file
513 511
514 @classmethod
515 512 def _calc_sys_path_for_underpth_nosite(self, sys_prefix, lines): def _calc_sys_path_for_underpth_nosite(self, sys_prefix, lines):
516 513 sys_path = [] sys_path = []
517 514 for line in lines: for line in lines:
 
... ... class StartupImportTests(unittest.TestCase):
521 518 sys_path.append(abs_path) sys_path.append(abs_path)
522 519 return sys_path return sys_path
523 520
524 @unittest.skipUnless(sys.platform == 'win32', "only supported on Windows")
525 521 def test_underpth_nosite_file(self): def test_underpth_nosite_file(self):
526 522 libpath = os.path.dirname(os.path.dirname(encodings.__file__)) libpath = os.path.dirname(os.path.dirname(encodings.__file__))
527 523 exe_prefix = os.path.dirname(sys.executable) exe_prefix = os.path.dirname(sys.executable)
 
... ... class StartupImportTests(unittest.TestCase):
536 532 os.path.dirname(exe_file), os.path.dirname(exe_file),
537 533 pth_lines) pth_lines)
538 534
539 try:
540 env = os.environ.copy()
541 env['PYTHONPATH'] = 'from-env'
542 env['PATH'] = '{};{}'.format(exe_prefix, os.getenv('PATH'))
543 rc = subprocess.call([exe_file, '-c',
544 'import sys; sys.exit(sys.flags.no_site and '
545 'len(sys.path) > 200 and '
546 'sys.path == %r)' % sys_path,
547 ], env=env)
548 finally:
549 self._cleanup_underpth_exe(exe_file)
535 env = os.environ.copy()
536 env['PYTHONPATH'] = 'from-env'
537 env['PATH'] = '{};{}'.format(exe_prefix, os.getenv('PATH'))
538 rc = subprocess.call([exe_file, '-c',
539 'import sys; sys.exit(sys.flags.no_site and '
540 'len(sys.path) > 200 and '
541 'sys.path == %r)' % sys_path,
542 ], env=env)
550 543 self.assertTrue(rc, "sys.path is incorrect") self.assertTrue(rc, "sys.path is incorrect")
551 544
552 @unittest.skipUnless(sys.platform == 'win32', "only supported on Windows")
553 545 def test_underpth_file(self): def test_underpth_file(self):
554 546 libpath = os.path.dirname(os.path.dirname(encodings.__file__)) libpath = os.path.dirname(os.path.dirname(encodings.__file__))
555 547 exe_prefix = os.path.dirname(sys.executable) exe_prefix = os.path.dirname(sys.executable)
 
... ... class StartupImportTests(unittest.TestCase):
561 553 'import site' 'import site'
562 554 ]) ])
563 555 sys_prefix = os.path.dirname(exe_file) sys_prefix = os.path.dirname(exe_file)
564 try:
565 env = os.environ.copy()
566 env['PYTHONPATH'] = 'from-env'
567 env['PATH'] = '{};{}'.format(exe_prefix, os.getenv('PATH'))
568 rc = subprocess.call([exe_file, '-c',
569 'import sys; sys.exit(not sys.flags.no_site and '
570 '%r in sys.path and %r in sys.path and %r not in sys.path and '
571 'all("\\r" not in p and "\\n" not in p for p in sys.path))' % (
572 os.path.join(sys_prefix, 'fake-path-name'),
573 libpath,
574 os.path.join(sys_prefix, 'from-env'),
575 )], env=env)
576 finally:
577 self._cleanup_underpth_exe(exe_file)
556 env = os.environ.copy()
557 env['PYTHONPATH'] = 'from-env'
558 env['PATH'] = '{};{}'.format(exe_prefix, os.getenv('PATH'))
559 rc = subprocess.call([exe_file, '-c',
560 'import sys; sys.exit(not sys.flags.no_site and '
561 '%r in sys.path and %r in sys.path and %r not in sys.path and '
562 'all("\\r" not in p and "\\n" not in p for p in sys.path))' % (
563 os.path.join(sys_prefix, 'fake-path-name'),
564 libpath,
565 os.path.join(sys_prefix, 'from-env'),
566 )], env=env)
578 567 self.assertTrue(rc, "sys.path is incorrect") self.assertTrue(rc, "sys.path is incorrect")
579 568
580 569
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/benf_wspdigital/cpython

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/benf_wspdigital/cpython

Clone this repository using git:
git clone git://git.rocketgit.com/user/benf_wspdigital/cpython

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main