mirror of
https://abf.rosa.ru/djam/python38.git
synced 2025-02-23 15:22:50 +00:00
Updated to 3.4.1
This commit is contained in:
parent
653c588704
commit
9f2027e950
16 changed files with 395 additions and 489 deletions
4
.abf.yml
4
.abf.yml
|
@ -3,10 +3,12 @@ removed_sources:
|
||||||
Python-3.3.1.tar.xz: 393d7302c48bc911cd7faa7fa9b5fbcb9919bddc
|
Python-3.3.1.tar.xz: 393d7302c48bc911cd7faa7fa9b5fbcb9919bddc
|
||||||
Python-3.3.2.tar.xz: 87009d0c156c6e1354dfec5c98c328cae93950ad
|
Python-3.3.2.tar.xz: 87009d0c156c6e1354dfec5c98c328cae93950ad
|
||||||
Python-3.3.3.tar.xz: af4e75a34bd538c79b9871227c2e7f56569ac107
|
Python-3.3.3.tar.xz: af4e75a34bd538c79b9871227c2e7f56569ac107
|
||||||
|
Python-3.3.4.tar.xz: 2c9586eeb4b6e45e9ebc28372c0856c709d9a522
|
||||||
python-3.3.0-docs-html.tar.bz2: 5299b1523ede931767199a5b13388a5bf35351d5
|
python-3.3.0-docs-html.tar.bz2: 5299b1523ede931767199a5b13388a5bf35351d5
|
||||||
python-3.3.1-docs-html.tar.bz2: 55c3b3f3453346835b0df2b3b0ad7fe20833a7f7
|
python-3.3.1-docs-html.tar.bz2: 55c3b3f3453346835b0df2b3b0ad7fe20833a7f7
|
||||||
python-3.3.2-docs-html.tar.bz2: 514e1a0810fa9e6433f4bc64bdc0ad407d49ebc5
|
python-3.3.2-docs-html.tar.bz2: 514e1a0810fa9e6433f4bc64bdc0ad407d49ebc5
|
||||||
python-3.3.3-docs-html.tar.bz2: bcd1f17d3d32f59288eda50aa6432135394b5ab5
|
python-3.3.3-docs-html.tar.bz2: bcd1f17d3d32f59288eda50aa6432135394b5ab5
|
||||||
sources:
|
sources:
|
||||||
Python-3.3.4.tar.xz: 2c9586eeb4b6e45e9ebc28372c0856c709d9a522
|
Python-3.4.1.tar.xz: 143e098efe7ee7bec8a4904ec4b322f28a067a03
|
||||||
python-3.3.4-docs-html.tar.bz2: 6d54aa11f2aa51339c09358d4a10217ee905dae3
|
python-3.3.4-docs-html.tar.bz2: 6d54aa11f2aa51339c09358d4a10217ee905dae3
|
||||||
|
python-3.4.0-docs-html.tar.bz2: d6e8f45219353b128f002f3a7311ec4e08c0ca49
|
||||||
|
|
12
00153-fix-test_gdb-noise.patch
Normal file
12
00153-fix-test_gdb-noise.patch
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
--- Python-3.4.1/Lib/test/test_gdb.py.153~ 2014-06-12 16:33:44.342930073 +0200
|
||||||
|
+++ Python-3.4.1/Lib/test/test_gdb.py 2014-06-12 16:36:53.556564577 +0200
|
||||||
|
@@ -182,6 +182,9 @@ class DebuggerTests(unittest.TestCase):
|
||||||
|
# Issue #19753: missing symbols on System Z
|
||||||
|
'Missing separate debuginfo for ',
|
||||||
|
'Try: zypper install -C ',
|
||||||
|
+ 'warning: Unable to open',
|
||||||
|
+ 'Try: urpmi.update --ignore ',
|
||||||
|
+ 'Undefined set print command'
|
||||||
|
)
|
||||||
|
for line in errlines:
|
||||||
|
if not line.startswith(ignore_patterns):
|
51
00156-gdb-autoload-safepath.patch
Normal file
51
00156-gdb-autoload-safepath.patch
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
--- Python-3.4.1/Lib/test/test_gdb.py.p156~ 2014-06-12 16:38:31.472340461 +0200
|
||||||
|
+++ Python-3.4.1/Lib/test/test_gdb.py 2014-06-12 16:40:45.333666965 +0200
|
||||||
|
@@ -86,6 +86,19 @@ def gdb_has_frame_select():
|
||||||
|
|
||||||
|
HAS_PYUP_PYDOWN = gdb_has_frame_select()
|
||||||
|
|
||||||
|
+def gdb_has_autoload_safepath():
|
||||||
|
+ # Recent GDBs will only auto-load scripts from certain safe
|
||||||
|
+ # locations, so we will need to turn off this protection.
|
||||||
|
+ # However, if the GDB doesn't have it, then the following
|
||||||
|
+ # command will generate noise on stderr (rhbz#817072):
|
||||||
|
+ cmd = "--eval-command=set auto-load safe-path /"
|
||||||
|
+ p = subprocess.Popen(["gdb", "--batch", cmd],
|
||||||
|
+ stderr=subprocess.PIPE)
|
||||||
|
+ _, stderr = p.communicate()
|
||||||
|
+ return b'"on" or "off" expected.' not in stderr
|
||||||
|
+
|
||||||
|
+HAS_AUTOLOAD_SAFEPATH = gdb_has_autoload_safepath()
|
||||||
|
+
|
||||||
|
BREAKPOINT_FN='builtin_id'
|
||||||
|
|
||||||
|
class DebuggerTests(unittest.TestCase):
|
||||||
|
@@ -122,15 +135,28 @@ class DebuggerTests(unittest.TestCase):
|
||||||
|
commands = ['set breakpoint pending yes',
|
||||||
|
'break %s' % breakpoint,
|
||||||
|
'run']
|
||||||
|
+
|
||||||
|
+ if HAS_AUTOLOAD_SAFEPATH:
|
||||||
|
+ # Recent GDBs will only auto-load scripts from certain safe
|
||||||
|
+ # locations.
|
||||||
|
+ # Where necessary, turn off this protection to ensure that
|
||||||
|
+ # our -gdb.py script can be loaded - but not on earlier gdb builds
|
||||||
|
+ # as this would generate noise on stderr (rhbz#817072):
|
||||||
|
+ init_commands = ['set auto-load safe-path /']
|
||||||
|
+ else:
|
||||||
|
+ init_commands = []
|
||||||
|
+
|
||||||
|
if cmds_after_breakpoint:
|
||||||
|
commands += cmds_after_breakpoint
|
||||||
|
else:
|
||||||
|
commands += ['backtrace']
|
||||||
|
|
||||||
|
+ # print init_commands
|
||||||
|
# print commands
|
||||||
|
|
||||||
|
# Use "commands" to generate the arguments with which to invoke "gdb":
|
||||||
|
args = ["gdb", "--batch"]
|
||||||
|
+ args += ['--init-eval-command=%s' % cmd for cmd in init_commands]
|
||||||
|
args += ['--eval-command=%s' % cmd for cmd in commands]
|
||||||
|
args += ["--args",
|
||||||
|
sys.executable]
|
13
00173-workaround-ENOPROTOOPT-in-bind_port.patch
Normal file
13
00173-workaround-ENOPROTOOPT-in-bind_port.patch
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
diff -up Python-3.3.0/Lib/test/suppor/__init__.py.rhbz913732 Python-3.3.0/Lib/test/support/__init__.py
|
||||||
|
--- Python-3.3.0/Lib/test/support/__init__.py.rhbz913732 2013-03-04 16:25:53.885258476 -0500
|
||||||
|
+++ Python-3.3.0/Lib/test/support/__init__.py 2013-03-04 16:25:58.499258157 -0500
|
||||||
|
@@ -570,6 +570,7 @@
|
||||||
|
raise TestFailed("tests should never set the SO_REUSEADDR " \
|
||||||
|
"socket option on TCP/IP sockets!")
|
||||||
|
- if hasattr(socket, 'SO_REUSEPORT'):
|
||||||
|
+ if hasattr(socket, 'SO_REUSEPORT') \
|
||||||
|
+ and 'WITHIN_PYTHON_RPM_BUILD' not in os.environ: # rhbz#913732
|
||||||
|
try:
|
||||||
|
if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:
|
||||||
|
raise TestFailed("tests should never set the SO_REUSEPORT " \
|
||||||
|
diff -up Python-3.3.0/Lib/test/test_support.py.rhbz913732 Python-3.3.0/Lib/test/test_support.py
|
|
@ -0,0 +1,48 @@
|
||||||
|
--- a/Tools/gdb/libpython.py 2013-04-06 03:41:58.000000000 -0400
|
||||||
|
+++ b/Tools/gdb/libpython.py 2013-04-24 03:51:04.720540343 -0400
|
||||||
|
@@ -274,6 +274,9 @@
|
||||||
|
self.tp_name = tp_name
|
||||||
|
self.address = address
|
||||||
|
|
||||||
|
+ def __len__(self):
|
||||||
|
+ return len(repr(self))
|
||||||
|
+
|
||||||
|
def __repr__(self):
|
||||||
|
# For the NULL pointer, we have no way of knowing a type, so
|
||||||
|
# special-case it as per
|
||||||
|
@@ -881,6 +884,8 @@
|
||||||
|
filename = self.filename()
|
||||||
|
try:
|
||||||
|
f = open(os_fsencode(filename), 'r')
|
||||||
|
+ except TypeError: # filename is FakeRepr
|
||||||
|
+ return None
|
||||||
|
except IOError:
|
||||||
|
return None
|
||||||
|
with f:
|
||||||
|
@@ -1523,9 +1528,12 @@
|
||||||
|
|
||||||
|
def print_summary(self):
|
||||||
|
if self.is_evalframeex():
|
||||||
|
- pyop = self.get_pyop()
|
||||||
|
- if pyop:
|
||||||
|
+ try:
|
||||||
|
+ pyop = self.get_pyop()
|
||||||
|
line = pyop.get_truncated_repr(MAX_OUTPUT_LEN)
|
||||||
|
+ except:
|
||||||
|
+ pyop = None
|
||||||
|
+ if pyop:
|
||||||
|
write_unicode(sys.stdout, '#%i %s\n' % (self.get_index(), line))
|
||||||
|
if not pyop.is_optimized_out():
|
||||||
|
line = pyop.current_line()
|
||||||
|
@@ -1542,7 +1550,10 @@
|
||||||
|
|
||||||
|
def print_traceback(self):
|
||||||
|
if self.is_evalframeex():
|
||||||
|
- pyop = self.get_pyop()
|
||||||
|
+ try:
|
||||||
|
+ pyop = self.get_pyop()
|
||||||
|
+ except:
|
||||||
|
+ pyop = None
|
||||||
|
if pyop:
|
||||||
|
pyop.print_traceback()
|
||||||
|
if not pyop.is_optimized_out():
|
14
Python-nis-requires-tirpc.patch
Normal file
14
Python-nis-requires-tirpc.patch
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
--- Python-3.4.1/setup.py.omv~ 2014-06-12 17:30:45.911154584 +0200
|
||||||
|
+++ Python-3.4.1/setup.py 2014-06-12 17:31:29.622608116 +0200
|
||||||
|
@@ -1249,9 +1249,9 @@ class PyBuildExt(build_ext):
|
||||||
|
if (host_platform not in ['cygwin', 'qnx6'] and
|
||||||
|
find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None):
|
||||||
|
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
|
||||||
|
- libs = ['nsl']
|
||||||
|
+ libs = ['nsl','tirpc']
|
||||||
|
else:
|
||||||
|
- libs = []
|
||||||
|
+ libs = ['tirpc']
|
||||||
|
exts.append( Extension('nis', ['nismodule.c'],
|
||||||
|
libraries = libs) )
|
||||||
|
else:
|
11
Python-select-requires-libm.patch
Normal file
11
Python-select-requires-libm.patch
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
--- Python-3.4.1/setup.py.omv~ 2014-06-12 16:47:09.873859551 +0200
|
||||||
|
+++ Python-3.4.1/setup.py 2014-06-12 16:47:34.373553262 +0200
|
||||||
|
@@ -625,7 +625,7 @@ class PyBuildExt(build_ext):
|
||||||
|
missing.append('spwd')
|
||||||
|
|
||||||
|
# select(2); not on ancient System V
|
||||||
|
- exts.append( Extension('select', ['selectmodule.c']) )
|
||||||
|
+ exts.append( Extension('select', ['selectmodule.c'], libraries=['m']) )
|
||||||
|
|
||||||
|
# Fred Drake's interface to the Python parser
|
||||||
|
exts.append( Extension('parser', ['parsermodule.c']) )
|
12
pybytecompile.macros
Normal file
12
pybytecompile.macros
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# Note that the path could itself be a python file, or a directory
|
||||||
|
|
||||||
|
# Python's compile_all module only works on directories, and requires a max
|
||||||
|
# recursion depth
|
||||||
|
|
||||||
|
%py_byte_compile()\
|
||||||
|
python_binary="%1"\
|
||||||
|
bytecode_compilation_path="%2"\
|
||||||
|
find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\
|
||||||
|
\
|
||||||
|
find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\
|
||||||
|
%{nil}
|
|
@ -1,17 +0,0 @@
|
||||||
--- Python-3.3.0/Lib/distutils/sysconfig.py 2012-09-29 12:00:28.000000000 +0400
|
|
||||||
+++ Python-3.3.0-1/Lib/distutils/sysconfig.py 2013-03-28 17:53:13.945246411 +0400
|
|
||||||
@@ -107,7 +107,13 @@
|
|
||||||
incdir = os.path.join(get_config_var('srcdir'), 'Include')
|
|
||||||
return os.path.normpath(incdir)
|
|
||||||
python_dir = 'python' + get_python_version() + build_flags
|
|
||||||
- return os.path.join(prefix, "include", python_dir)
|
|
||||||
+ multiarch = ''
|
|
||||||
+ if plat_specific:
|
|
||||||
+ arch = os.uname()[4]
|
|
||||||
+ if arch.endswith('86'):
|
|
||||||
+ arch = 'i386'
|
|
||||||
+ multiarch = 'multiarch-%s-%s' % (arch, sys.platform)
|
|
||||||
+ return os.path.join(prefix, "include", multiarch, python_dir)
|
|
||||||
elif os.name == "nt":
|
|
||||||
return os.path.join(prefix, "include")
|
|
||||||
elif os.name == "os2":
|
|
|
@ -1,48 +0,0 @@
|
||||||
--- Python-3.3.0/Modules/Setup.dist.bero 2013-01-17 14:45:54.954074760 +0100
|
|
||||||
+++ Python-3.3.0/Modules/Setup.dist 2013-01-17 14:47:07.021245768 +0100
|
|
||||||
@@ -166,14 +166,14 @@ _symtable symtablemodule.c
|
|
||||||
#cmath cmathmodule.c _math.c # -lm # complex math library functions
|
|
||||||
#math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
|
|
||||||
#_struct _struct.c # binary structure packing/unpacking
|
|
||||||
-#time timemodule.c # -lm # time operations and variables
|
|
||||||
+time timemodule.c -lm # time operations and variables
|
|
||||||
#_weakref _weakref.c # basic weak reference support
|
|
||||||
#_testcapi _testcapimodule.c # Python C API test module
|
|
||||||
#_random _randommodule.c # Random number generator
|
|
||||||
#atexit atexitmodule.c # Register functions to be run at interpreter-shutdown
|
|
||||||
#_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
|
|
||||||
#_pickle _pickle.c # pickle accelerator
|
|
||||||
-#_datetime _datetimemodule.c # datetime accelerator
|
|
||||||
+_datetime _datetimemodule.c -lm # datetime accelerator
|
|
||||||
#_bisect _bisectmodule.c # Bisection algorithms
|
|
||||||
#_heapq _heapqmodule.c # Heap queue algorithm
|
|
||||||
|
|
||||||
@@ -216,7 +216,7 @@ _symtable symtablemodule.c
|
|
||||||
# Some more UNIX dependent modules -- off by default, since these
|
|
||||||
# are not supported by all UNIX systems:
|
|
||||||
|
|
||||||
-#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
|
|
||||||
+nis nismodule.c -ltirpc -lnsl # Sun yellow pages -- not everywhere
|
|
||||||
#termios termios.c # Steen Lumholt's termios module
|
|
||||||
#resource resource.c # Jeremy Hylton's rlimit interface
|
|
||||||
|
|
||||||
--- Python-3.3.0/setup.py.bero 2013-01-17 14:48:25.702340762 +0100
|
|
||||||
+++ Python-3.3.0/setup.py 2013-01-17 14:49:32.040577716 +0100
|
|
||||||
@@ -1901,7 +1901,7 @@ class PyBuildExt(build_ext):
|
|
||||||
undef_macros = []
|
|
||||||
if '--with-system-libmpdec' in sysconfig.get_config_var("CONFIG_ARGS"):
|
|
||||||
include_dirs = []
|
|
||||||
- libraries = ['mpdec']
|
|
||||||
+ libraries = ['mpdec', 'm']
|
|
||||||
sources = ['_decimal/_decimal.c']
|
|
||||||
depends = ['_decimal/docstrings.h']
|
|
||||||
else:
|
|
||||||
@@ -1910,7 +1910,7 @@ class PyBuildExt(build_ext):
|
|
||||||
'Modules',
|
|
||||||
'_decimal',
|
|
||||||
'libmpdec'))]
|
|
||||||
- libraries = []
|
|
||||||
+ libraries = ['m']
|
|
||||||
sources = [
|
|
||||||
'_decimal/_decimal.c',
|
|
||||||
'_decimal/libmpdec/basearith.c',
|
|
13
python-3.3.0b1-test-posix_fadvise.patch
Normal file
13
python-3.3.0b1-test-posix_fadvise.patch
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
Index: Python-3.3.0b1/Lib/test/test_posix.py
|
||||||
|
===================================================================
|
||||||
|
--- Python-3.3.0b1.orig/Lib/test/test_posix.py 2012-06-26 22:19:48.000000000 +0200
|
||||||
|
+++ Python-3.3.0b1/Lib/test/test_posix.py 2012-08-03 14:06:26.000000000 +0200
|
||||||
|
@@ -231,7 +231,7 @@
|
||||||
|
def test_posix_fadvise(self):
|
||||||
|
fd = os.open(support.TESTFN, os.O_RDONLY)
|
||||||
|
try:
|
||||||
|
- posix.posix_fadvise(fd, 0, 0, posix.POSIX_FADV_WILLNEED)
|
||||||
|
+ posix.posix_fadvise(fd, 0, 0, posix.POSIX_FADV_RANDOM)
|
||||||
|
finally:
|
||||||
|
os.close(fd)
|
||||||
|
|
|
@ -1,238 +0,0 @@
|
||||||
diff -Naur Python-3.3.3.orig/Lib/test/test_urllibnet.py Python-3.3.3/Lib/test/test_urllibnet.py
|
|
||||||
--- Python-3.3.3.orig/Lib/test/test_urllibnet.py 2014-01-16 05:23:06.563537167 -0500
|
|
||||||
+++ Python-3.3.3/Lib/test/test_urllibnet.py 2014-01-16 05:23:12.598537003 -0500
|
|
||||||
@@ -121,6 +121,10 @@
|
|
||||||
# fail with EAI_SYSTEM and ETIMEDOUT (seen on Ubuntu 13.04),
|
|
||||||
# i.e. Python's TimeoutError.
|
|
||||||
pass
|
|
||||||
+ except TimeoutError:
|
|
||||||
+ # Happens in chroots with bogus setups and "secured" build
|
|
||||||
+ # environments that just drop all traffic
|
|
||||||
+ self.skipTest("test_bad_address skipped due to timeout")
|
|
||||||
else:
|
|
||||||
# This happens with some overzealous DNS providers such as OpenDNS
|
|
||||||
self.skipTest("%r should not resolve for test to work" % bogus_domain)
|
|
||||||
diff -Naur Python-3.3.3.orig/Lib/test/test_urllibnet.py.orig Python-3.3.3/Lib/test/test_urllibnet.py.orig
|
|
||||||
--- Python-3.3.3.orig/Lib/test/test_urllibnet.py.orig 1969-12-31 19:00:00.000000000 -0500
|
|
||||||
+++ Python-3.3.3/Lib/test/test_urllibnet.py.orig 2013-11-17 02:22:49.000000000 -0500
|
|
||||||
@@ -0,0 +1,220 @@
|
|
||||||
+#!/usr/bin/env python3
|
|
||||||
+
|
|
||||||
+import unittest
|
|
||||||
+from test import support
|
|
||||||
+
|
|
||||||
+import contextlib
|
|
||||||
+import socket
|
|
||||||
+import urllib.request
|
|
||||||
+import sys
|
|
||||||
+import os
|
|
||||||
+import email.message
|
|
||||||
+import time
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+class URLTimeoutTest(unittest.TestCase):
|
|
||||||
+ # XXX this test doesn't seem to test anything useful.
|
|
||||||
+
|
|
||||||
+ TIMEOUT = 30.0
|
|
||||||
+
|
|
||||||
+ def setUp(self):
|
|
||||||
+ socket.setdefaulttimeout(self.TIMEOUT)
|
|
||||||
+
|
|
||||||
+ def tearDown(self):
|
|
||||||
+ socket.setdefaulttimeout(None)
|
|
||||||
+
|
|
||||||
+ def testURLread(self):
|
|
||||||
+ with support.transient_internet("www.python.org"):
|
|
||||||
+ f = urllib.request.urlopen("http://www.python.org/")
|
|
||||||
+ x = f.read()
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+class urlopenNetworkTests(unittest.TestCase):
|
|
||||||
+ """Tests urllib.reqest.urlopen using the network.
|
|
||||||
+
|
|
||||||
+ These tests are not exhaustive. Assuming that testing using files does a
|
|
||||||
+ good job overall of some of the basic interface features. There are no
|
|
||||||
+ tests exercising the optional 'data' and 'proxies' arguments. No tests
|
|
||||||
+ for transparent redirection have been written.
|
|
||||||
+
|
|
||||||
+ setUp is not used for always constructing a connection to
|
|
||||||
+ http://www.python.org/ since there a few tests that don't use that address
|
|
||||||
+ and making a connection is expensive enough to warrant minimizing unneeded
|
|
||||||
+ connections.
|
|
||||||
+
|
|
||||||
+ """
|
|
||||||
+
|
|
||||||
+ @contextlib.contextmanager
|
|
||||||
+ def urlopen(self, *args, **kwargs):
|
|
||||||
+ resource = args[0]
|
|
||||||
+ with support.transient_internet(resource):
|
|
||||||
+ r = urllib.request.urlopen(*args, **kwargs)
|
|
||||||
+ try:
|
|
||||||
+ yield r
|
|
||||||
+ finally:
|
|
||||||
+ r.close()
|
|
||||||
+
|
|
||||||
+ def test_basic(self):
|
|
||||||
+ # Simple test expected to pass.
|
|
||||||
+ with self.urlopen("http://www.python.org/") as open_url:
|
|
||||||
+ for attr in ("read", "readline", "readlines", "fileno", "close",
|
|
||||||
+ "info", "geturl"):
|
|
||||||
+ self.assertTrue(hasattr(open_url, attr), "object returned from "
|
|
||||||
+ "urlopen lacks the %s attribute" % attr)
|
|
||||||
+ self.assertTrue(open_url.read(), "calling 'read' failed")
|
|
||||||
+
|
|
||||||
+ def test_readlines(self):
|
|
||||||
+ # Test both readline and readlines.
|
|
||||||
+ with self.urlopen("http://www.python.org/") as open_url:
|
|
||||||
+ self.assertIsInstance(open_url.readline(), bytes,
|
|
||||||
+ "readline did not return a string")
|
|
||||||
+ self.assertIsInstance(open_url.readlines(), list,
|
|
||||||
+ "readlines did not return a list")
|
|
||||||
+
|
|
||||||
+ def test_info(self):
|
|
||||||
+ # Test 'info'.
|
|
||||||
+ with self.urlopen("http://www.python.org/") as open_url:
|
|
||||||
+ info_obj = open_url.info()
|
|
||||||
+ self.assertIsInstance(info_obj, email.message.Message,
|
|
||||||
+ "object returned by 'info' is not an "
|
|
||||||
+ "instance of email.message.Message")
|
|
||||||
+ self.assertEqual(info_obj.get_content_subtype(), "html")
|
|
||||||
+
|
|
||||||
+ def test_geturl(self):
|
|
||||||
+ # Make sure same URL as opened is returned by geturl.
|
|
||||||
+ URL = "http://www.python.org/"
|
|
||||||
+ with self.urlopen(URL) as open_url:
|
|
||||||
+ gotten_url = open_url.geturl()
|
|
||||||
+ self.assertEqual(gotten_url, URL)
|
|
||||||
+
|
|
||||||
+ def test_getcode(self):
|
|
||||||
+ # test getcode() with the fancy opener to get 404 error codes
|
|
||||||
+ URL = "http://www.python.org/XXXinvalidXXX"
|
|
||||||
+ with support.transient_internet(URL):
|
|
||||||
+ open_url = urllib.request.FancyURLopener().open(URL)
|
|
||||||
+ try:
|
|
||||||
+ code = open_url.getcode()
|
|
||||||
+ finally:
|
|
||||||
+ open_url.close()
|
|
||||||
+ self.assertEqual(code, 404)
|
|
||||||
+
|
|
||||||
+ def test_fileno(self):
|
|
||||||
+ if sys.platform in ('win32',):
|
|
||||||
+ # On Windows, socket handles are not file descriptors; this
|
|
||||||
+ # test can't pass on Windows.
|
|
||||||
+ return
|
|
||||||
+ # Make sure fd returned by fileno is valid.
|
|
||||||
+ with self.urlopen("http://www.python.org/", timeout=None) as open_url:
|
|
||||||
+ fd = open_url.fileno()
|
|
||||||
+ with os.fdopen(fd, encoding='utf-8') as f:
|
|
||||||
+ self.assertTrue(f.read(), "reading from file created using fd "
|
|
||||||
+ "returned by fileno failed")
|
|
||||||
+
|
|
||||||
+ def test_bad_address(self):
|
|
||||||
+ # Make sure proper exception is raised when connecting to a bogus
|
|
||||||
+ # address.
|
|
||||||
+ bogus_domain = "sadflkjsasf.i.nvali.d"
|
|
||||||
+ try:
|
|
||||||
+ socket.gethostbyname(bogus_domain)
|
|
||||||
+ except OSError:
|
|
||||||
+ # socket.gaierror is too narrow, since getaddrinfo() may also
|
|
||||||
+ # fail with EAI_SYSTEM and ETIMEDOUT (seen on Ubuntu 13.04),
|
|
||||||
+ # i.e. Python's TimeoutError.
|
|
||||||
+ pass
|
|
||||||
+ else:
|
|
||||||
+ # This happens with some overzealous DNS providers such as OpenDNS
|
|
||||||
+ self.skipTest("%r should not resolve for test to work" % bogus_domain)
|
|
||||||
+ self.assertRaises(IOError,
|
|
||||||
+ # SF patch 809915: In Sep 2003, VeriSign started
|
|
||||||
+ # highjacking invalid .com and .net addresses to
|
|
||||||
+ # boost traffic to their own site. This test
|
|
||||||
+ # started failing then. One hopes the .invalid
|
|
||||||
+ # domain will be spared to serve its defined
|
|
||||||
+ # purpose.
|
|
||||||
+ # urllib.urlopen, "http://www.sadflkjsasadf.com/")
|
|
||||||
+ urllib.request.urlopen,
|
|
||||||
+ "http://sadflkjsasf.i.nvali.d/")
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+class urlretrieveNetworkTests(unittest.TestCase):
|
|
||||||
+ """Tests urllib.request.urlretrieve using the network."""
|
|
||||||
+
|
|
||||||
+ @contextlib.contextmanager
|
|
||||||
+ def urlretrieve(self, *args, **kwargs):
|
|
||||||
+ resource = args[0]
|
|
||||||
+ with support.transient_internet(resource):
|
|
||||||
+ file_location, info = urllib.request.urlretrieve(*args, **kwargs)
|
|
||||||
+ try:
|
|
||||||
+ yield file_location, info
|
|
||||||
+ finally:
|
|
||||||
+ support.unlink(file_location)
|
|
||||||
+
|
|
||||||
+ def test_basic(self):
|
|
||||||
+ # Test basic functionality.
|
|
||||||
+ with self.urlretrieve("http://www.python.org/") as (file_location, info):
|
|
||||||
+ self.assertTrue(os.path.exists(file_location), "file location returned by"
|
|
||||||
+ " urlretrieve is not a valid path")
|
|
||||||
+ with open(file_location, encoding='utf-8') as f:
|
|
||||||
+ self.assertTrue(f.read(), "reading from the file location returned"
|
|
||||||
+ " by urlretrieve failed")
|
|
||||||
+
|
|
||||||
+ def test_specified_path(self):
|
|
||||||
+ # Make sure that specifying the location of the file to write to works.
|
|
||||||
+ with self.urlretrieve("http://www.python.org/",
|
|
||||||
+ support.TESTFN) as (file_location, info):
|
|
||||||
+ self.assertEqual(file_location, support.TESTFN)
|
|
||||||
+ self.assertTrue(os.path.exists(file_location))
|
|
||||||
+ with open(file_location, encoding='utf-8') as f:
|
|
||||||
+ self.assertTrue(f.read(), "reading from temporary file failed")
|
|
||||||
+
|
|
||||||
+ def test_header(self):
|
|
||||||
+ # Make sure header returned as 2nd value from urlretrieve is good.
|
|
||||||
+ with self.urlretrieve("http://www.python.org/") as (file_location, info):
|
|
||||||
+ self.assertIsInstance(info, email.message.Message,
|
|
||||||
+ "info is not an instance of email.message.Message")
|
|
||||||
+
|
|
||||||
+ logo = "http://www.python.org/community/logos/python-logo-master-v3-TM.png"
|
|
||||||
+
|
|
||||||
+ def test_data_header(self):
|
|
||||||
+ with self.urlretrieve(self.logo) as (file_location, fileheaders):
|
|
||||||
+ datevalue = fileheaders.get('Date')
|
|
||||||
+ dateformat = '%a, %d %b %Y %H:%M:%S GMT'
|
|
||||||
+ try:
|
|
||||||
+ time.strptime(datevalue, dateformat)
|
|
||||||
+ except ValueError:
|
|
||||||
+ self.fail('Date value not in %r format', dateformat)
|
|
||||||
+
|
|
||||||
+ def test_reporthook(self):
|
|
||||||
+ records = []
|
|
||||||
+ def recording_reporthook(blocks, block_size, total_size):
|
|
||||||
+ records.append((blocks, block_size, total_size))
|
|
||||||
+
|
|
||||||
+ with self.urlretrieve(self.logo, reporthook=recording_reporthook) as (
|
|
||||||
+ file_location, fileheaders):
|
|
||||||
+ expected_size = int(fileheaders['Content-Length'])
|
|
||||||
+
|
|
||||||
+ records_repr = repr(records) # For use in error messages.
|
|
||||||
+ self.assertGreater(len(records), 1, msg="There should always be two "
|
|
||||||
+ "calls; the first one before the transfer starts.")
|
|
||||||
+ self.assertEqual(records[0][0], 0)
|
|
||||||
+ self.assertGreater(records[0][1], 0,
|
|
||||||
+ msg="block size can't be 0 in %s" % records_repr)
|
|
||||||
+ self.assertEqual(records[0][2], expected_size)
|
|
||||||
+ self.assertEqual(records[-1][2], expected_size)
|
|
||||||
+
|
|
||||||
+ block_sizes = {block_size for _, block_size, _ in records}
|
|
||||||
+ self.assertEqual({records[0][1]}, block_sizes,
|
|
||||||
+ msg="block sizes in %s must be equal" % records_repr)
|
|
||||||
+ self.assertGreaterEqual(records[-1][0]*records[0][1], expected_size,
|
|
||||||
+ msg="number of blocks * block size must be"
|
|
||||||
+ " >= total size in %s" % records_repr)
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+def test_main():
|
|
||||||
+ support.requires('network')
|
|
||||||
+ support.run_unittest(URLTimeoutTest,
|
|
||||||
+ urlopenNetworkTests,
|
|
||||||
+ urlretrieveNetworkTests)
|
|
||||||
+
|
|
||||||
+if __name__ == "__main__":
|
|
||||||
+ test_main()
|
|
|
@ -1,93 +1,90 @@
|
||||||
--- Python-3.3.0/Makefile.pre.in.lib64 2012-09-29 16:00:41.000000000 +0800
|
--- Python-3.4.1/Lib/distutils/command/install.py.lib64 2014-05-19 07:19:37.000000000 +0200
|
||||||
+++ Python-3.3.0/Makefile.pre.in 2012-09-30 00:08:10.000000000 +0800
|
+++ Python-3.4.1/Lib/distutils/command/install.py 2014-06-12 16:30:38.864248876 +0200
|
||||||
@@ -108,7 +108,7 @@
|
@@ -45,14 +45,14 @@ else:
|
||||||
MANDIR= @mandir@
|
INSTALL_SCHEMES = {
|
||||||
INCLUDEDIR= @includedir@
|
'unix_prefix': {
|
||||||
CONFINCLUDEDIR= $(exec_prefix)/include
|
'purelib': '$base/lib/python$py_version_short/site-packages',
|
||||||
-SCRIPTDIR= $(prefix)/lib
|
- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
|
||||||
+SCRIPTDIR= $(prefix)/lib64
|
+ 'platlib': '$platbase/lib64/python$py_version_short/site-packages',
|
||||||
ABIFLAGS= @ABIFLAGS@
|
'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
|
||||||
|
'scripts': '$base/bin',
|
||||||
|
'data' : '$base',
|
||||||
|
},
|
||||||
|
'unix_home': {
|
||||||
|
'purelib': '$base/lib/python',
|
||||||
|
- 'platlib': '$base/lib/python',
|
||||||
|
+ 'platlib': '$base/lib64/python',
|
||||||
|
'headers': '$base/include/python/$dist_name',
|
||||||
|
'scripts': '$base/bin',
|
||||||
|
'data' : '$base',
|
||||||
|
--- Python-3.4.1/Lib/distutils/sysconfig.py.lib64 2014-05-19 07:19:38.000000000 +0200
|
||||||
|
+++ Python-3.4.1/Lib/distutils/sysconfig.py 2014-06-12 16:30:38.864248876 +0200
|
||||||
|
@@ -141,8 +141,12 @@ def get_python_lib(plat_specific=0, stan
|
||||||
|
prefix = plat_specific and EXEC_PREFIX or PREFIX
|
||||||
|
|
||||||
# Detailed destination directories
|
if os.name == "posix":
|
||||||
--- Python-3.3.0/setup.py.lib64 2012-09-30 00:08:10.000000000 +0800
|
+ if plat_specific or standard_lib:
|
||||||
+++ Python-3.3.0/setup.py 2012-09-30 00:11:11.000000000 +0800
|
+ lib = "lib64"
|
||||||
@@ -395,7 +395,7 @@
|
+ else:
|
||||||
|
+ lib = "lib"
|
||||||
if multiarch_path_component != '':
|
libpython = os.path.join(prefix,
|
||||||
add_dir_to_list(self.compiler.library_dirs,
|
- "lib", "python" + get_python_version())
|
||||||
- '/usr/lib/' + multiarch_path_component)
|
+ lib, "python" + get_python_version())
|
||||||
+ '/usr/lib64/' + multiarch_path_component)
|
if standard_lib:
|
||||||
add_dir_to_list(self.compiler.include_dirs,
|
return libpython
|
||||||
'/usr/include/' + multiarch_path_component)
|
|
||||||
return
|
|
||||||
@@ -729,11 +729,11 @@
|
|
||||||
elif curses_library:
|
|
||||||
readline_libs.append(curses_library)
|
|
||||||
elif self.compiler.find_library_file(lib_dirs +
|
|
||||||
- ['/usr/lib/termcap'],
|
|
||||||
+ ['/usr/lib64/termcap'],
|
|
||||||
'termcap'):
|
|
||||||
readline_libs.append('termcap')
|
|
||||||
exts.append( Extension('readline', ['readline.c'],
|
|
||||||
- library_dirs=['/usr/lib/termcap'],
|
|
||||||
+ library_dirs=['/usr/lib64/termcap'],
|
|
||||||
extra_link_args=readline_extra_link_args,
|
|
||||||
libraries=readline_libs) )
|
|
||||||
else:
|
else:
|
||||||
@@ -770,8 +770,8 @@
|
--- Python-3.4.1/Lib/site.py.lib64 2014-06-12 16:30:38.864248876 +0200
|
||||||
if krb5_h:
|
+++ Python-3.4.1/Lib/site.py 2014-06-12 16:32:54.348555089 +0200
|
||||||
ssl_incs += krb5_h
|
@@ -304,12 +304,16 @@ def getsitepackages(prefixes=None):
|
||||||
ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
|
seen.add(prefix)
|
||||||
- ['/usr/local/ssl/lib',
|
|
||||||
- '/usr/contrib/ssl/lib/'
|
|
||||||
+ ['/usr/local/ssl/lib64',
|
|
||||||
+ '/usr/contrib/ssl/lib64/'
|
|
||||||
] )
|
|
||||||
|
|
||||||
if (ssl_incs is not None and
|
if os.sep == '/':
|
||||||
--- Python-3.3.0/Modules/getpath.c.lib64 2012-09-29 16:00:45.000000000 +0800
|
+ sitepackages.append(os.path.join(prefix, "lib64",
|
||||||
+++ Python-3.3.0/Modules/getpath.c 2012-09-30 00:08:10.000000000 +0800
|
+ "python" + sys.version[:3],
|
||||||
@@ -122,8 +122,8 @@
|
+ "site-packages"))
|
||||||
#endif
|
sitepackages.append(os.path.join(prefix, "lib",
|
||||||
|
"python" + sys.version[:3],
|
||||||
|
"site-packages"))
|
||||||
|
sitepackages.append(os.path.join(prefix, "lib", "site-python"))
|
||||||
|
else:
|
||||||
|
sitepackages.append(prefix)
|
||||||
|
+ sitepackages.append(os.path.join(prefix, "lib64", "site-packages"))
|
||||||
|
sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
|
||||||
|
if sys.platform == "darwin":
|
||||||
|
# for framework builds *only* we add the standard Apple
|
||||||
|
--- Python-3.4.1/Lib/sysconfig.py.lib64 2014-05-19 07:19:38.000000000 +0200
|
||||||
|
+++ Python-3.4.1/Lib/sysconfig.py 2014-06-12 16:30:38.865248863 +0200
|
||||||
|
@@ -20,10 +20,10 @@ __all__ = [
|
||||||
|
|
||||||
#ifndef PYTHONPATH
|
_INSTALL_SCHEMES = {
|
||||||
-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
|
'posix_prefix': {
|
||||||
- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
|
- 'stdlib': '{installed_base}/lib/python{py_version_short}',
|
||||||
+#define PYTHONPATH PREFIX "/lib64/python" VERSION ":" \
|
- 'platstdlib': '{platbase}/lib/python{py_version_short}',
|
||||||
+ EXEC_PREFIX "/lib64/python" VERSION "/lib-dynload"
|
+ 'stdlib': '{installed_base}/lib64/python{py_version_short}',
|
||||||
#endif
|
+ 'platstdlib': '{platbase}/lib64/python{py_version_short}',
|
||||||
|
'purelib': '{base}/lib/python{py_version_short}/site-packages',
|
||||||
#ifndef LANDMARK
|
- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
|
||||||
@@ -135,7 +135,7 @@
|
+ 'platlib': '{platbase}/lib64/python{py_version_short}/site-packages',
|
||||||
static wchar_t progpath[MAXPATHLEN+1];
|
'include':
|
||||||
static wchar_t *module_search_path = NULL;
|
'{installed_base}/include/python{py_version_short}{abiflags}',
|
||||||
static int module_search_path_malloced = 0;
|
'platinclude':
|
||||||
-static wchar_t *lib_python = L"lib/python" VERSION;
|
@@ -61,10 +61,10 @@ _INSTALL_SCHEMES = {
|
||||||
+static wchar_t *lib_python = L"lib64/python" VERSION;
|
'data': '{userbase}',
|
||||||
|
},
|
||||||
static void
|
'posix_user': {
|
||||||
reduce(wchar_t *dir)
|
- 'stdlib': '{userbase}/lib/python{py_version_short}',
|
||||||
@@ -677,7 +677,7 @@
|
- 'platstdlib': '{userbase}/lib/python{py_version_short}',
|
||||||
}
|
+ 'stdlib': '{userbase}/lib64/python{py_version_short}',
|
||||||
else
|
+ 'platstdlib': '{userbase}/lib64/python{py_version_short}',
|
||||||
wcsncpy(zip_path, _prefix, MAXPATHLEN);
|
'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
|
||||||
- joinpath(zip_path, L"lib/python00.zip");
|
- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
|
||||||
+ joinpath(zip_path, L"lib64/python00.zip");
|
+ 'platlib': '{userbase}/lib64/python{py_version_short}/site-packages',
|
||||||
bufsz = wcslen(zip_path); /* Replace "00" with version */
|
'include': '{userbase}/include/python{py_version_short}',
|
||||||
zip_path[bufsz - 6] = VERSION[0];
|
'scripts': '{userbase}/bin',
|
||||||
zip_path[bufsz - 5] = VERSION[2];
|
'data': '{userbase}',
|
||||||
@@ -687,7 +687,7 @@
|
--- Python-3.4.1/Lib/test/test_site.py.lib64 2014-05-19 07:19:38.000000000 +0200
|
||||||
fprintf(stderr,
|
+++ Python-3.4.1/Lib/test/test_site.py 2014-06-12 16:30:38.864248876 +0200
|
||||||
"Could not find platform dependent libraries <exec_prefix>\n");
|
@@ -243,12 +243,15 @@ class HelperFunctionsTests(unittest.Test
|
||||||
wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN);
|
|
||||||
- joinpath(exec_prefix, L"lib/lib-dynload");
|
|
||||||
+ joinpath(exec_prefix, L"lib64/lib-dynload");
|
|
||||||
}
|
|
||||||
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
|
|
||||||
|
|
||||||
--- Python-3.3.0/Lib/test/test_site.py.lib64 2012-09-29 16:00:38.000000000 +0800
|
|
||||||
+++ Python-3.3.0/Lib/test/test_site.py 2012-09-30 00:08:10.000000000 +0800
|
|
||||||
@@ -239,12 +239,15 @@
|
|
||||||
self.assertEqual(dirs[2], wanted)
|
self.assertEqual(dirs[2], wanted)
|
||||||
elif os.sep == '/':
|
elif os.sep == '/':
|
||||||
# OS X non-framwework builds, Linux, FreeBSD, etc
|
# OS X non-framwework builds, Linux, FreeBSD, etc
|
||||||
|
@ -106,87 +103,90 @@
|
||||||
else:
|
else:
|
||||||
# other platforms
|
# other platforms
|
||||||
self.assertEqual(len(dirs), 2)
|
self.assertEqual(len(dirs), 2)
|
||||||
--- Python-3.3.0/Lib/site.py.lib64 2012-09-29 16:00:31.000000000 +0800
|
--- Python-3.4.1/Makefile.pre.in.lib64 2014-05-19 07:19:39.000000000 +0200
|
||||||
+++ Python-3.3.0/Lib/site.py 2012-09-30 00:08:10.000000000 +0800
|
+++ Python-3.4.1/Makefile.pre.in 2014-06-12 16:30:38.864248876 +0200
|
||||||
@@ -303,12 +303,16 @@
|
@@ -115,7 +115,7 @@ LIBDIR= @libdir@
|
||||||
if sys.platform in ('os2emx', 'riscos'):
|
MANDIR= @mandir@
|
||||||
sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
|
INCLUDEDIR= @includedir@
|
||||||
elif os.sep == '/':
|
CONFINCLUDEDIR= $(exec_prefix)/include
|
||||||
+ sitepackages.append(os.path.join(prefix, "lib64",
|
-SCRIPTDIR= $(prefix)/lib
|
||||||
+ "python" + sys.version[:3],
|
+SCRIPTDIR= $(prefix)/lib64
|
||||||
+ "site-packages"))
|
ABIFLAGS= @ABIFLAGS@
|
||||||
sitepackages.append(os.path.join(prefix, "lib",
|
|
||||||
"python" + sys.version[:3],
|
|
||||||
"site-packages"))
|
|
||||||
sitepackages.append(os.path.join(prefix, "lib", "site-python"))
|
|
||||||
else:
|
|
||||||
sitepackages.append(prefix)
|
|
||||||
+ sitepackages.append(os.path.join(prefix, "lib64", "site-packages"))
|
|
||||||
sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
|
|
||||||
if sys.platform == "darwin":
|
|
||||||
# for framework builds *only* we add the standard Apple
|
|
||||||
--- Python-3.3.0/Lib/distutils/command/install.py.lib64 2012-09-29 16:00:27.000000000 +0800
|
|
||||||
+++ Python-3.3.0/Lib/distutils/command/install.py 2012-09-30 00:08:10.000000000 +0800
|
|
||||||
@@ -45,14 +45,14 @@
|
|
||||||
INSTALL_SCHEMES = {
|
|
||||||
'unix_prefix': {
|
|
||||||
'purelib': '$base/lib/python$py_version_short/site-packages',
|
|
||||||
- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
|
|
||||||
+ 'platlib': '$platbase/lib64/python$py_version_short/site-packages',
|
|
||||||
'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
|
|
||||||
'scripts': '$base/bin',
|
|
||||||
'data' : '$base',
|
|
||||||
},
|
|
||||||
'unix_home': {
|
|
||||||
'purelib': '$base/lib/python',
|
|
||||||
- 'platlib': '$base/lib/python',
|
|
||||||
+ 'platlib': '$base/lib64/python',
|
|
||||||
'headers': '$base/include/python/$dist_name',
|
|
||||||
'scripts': '$base/bin',
|
|
||||||
'data' : '$base',
|
|
||||||
--- Python-3.3.0/Lib/distutils/sysconfig.py.lib64 2012-09-29 16:00:28.000000000 +0800
|
|
||||||
+++ Python-3.3.0/Lib/distutils/sysconfig.py 2012-09-30 00:08:10.000000000 +0800
|
|
||||||
@@ -139,8 +139,12 @@
|
|
||||||
prefix = plat_specific and EXEC_PREFIX or PREFIX
|
|
||||||
|
|
||||||
if os.name == "posix":
|
# Detailed destination directories
|
||||||
+ if plat_specific or standard_lib:
|
--- Python-3.4.1/Modules/getpath.c.lib64 2014-05-19 07:19:39.000000000 +0200
|
||||||
+ lib = "lib64"
|
+++ Python-3.4.1/Modules/getpath.c 2014-06-12 16:31:35.644539024 +0200
|
||||||
+ else:
|
@@ -118,8 +118,8 @@
|
||||||
+ lib = "lib"
|
#endif
|
||||||
libpython = os.path.join(prefix,
|
|
||||||
- "lib", "python" + get_python_version())
|
|
||||||
+ lib, "python" + get_python_version())
|
|
||||||
if standard_lib:
|
|
||||||
return libpython
|
|
||||||
else:
|
|
||||||
--- Python-3.3.0/Lib/sysconfig.py.lib64 2012-09-29 16:00:31.000000000 +0800
|
|
||||||
+++ Python-3.3.0/Lib/sysconfig.py 2012-09-30 00:09:50.000000000 +0800
|
|
||||||
@@ -21,10 +21,10 @@
|
|
||||||
|
|
||||||
_INSTALL_SCHEMES = {
|
#ifndef PYTHONPATH
|
||||||
'posix_prefix': {
|
-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
|
||||||
- 'stdlib': '{installed_base}/lib/python{py_version_short}',
|
- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
|
||||||
- 'platstdlib': '{platbase}/lib/python{py_version_short}',
|
+#define PYTHONPATH PREFIX "/lib64/python" VERSION ":" \
|
||||||
+ 'stdlib': '{installed_base}/lib64/python{py_version_short}',
|
+ EXEC_PREFIX "/lib64/python" VERSION "/lib-dynload"
|
||||||
+ 'platstdlib': '{platbase}/lib64/python{py_version_short}',
|
#endif
|
||||||
'purelib': '{base}/lib/python{py_version_short}/site-packages',
|
|
||||||
- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
|
#ifndef LANDMARK
|
||||||
+ 'platlib': '{platbase}/lib64/python{py_version_short}/site-packages',
|
@@ -494,7 +494,7 @@ calculate_path(void)
|
||||||
'include':
|
_pythonpath = _Py_char2wchar(PYTHONPATH, NULL);
|
||||||
'{installed_base}/include/python{py_version_short}{abiflags}',
|
_prefix = _Py_char2wchar(PREFIX, NULL);
|
||||||
'platinclude':
|
_exec_prefix = _Py_char2wchar(EXEC_PREFIX, NULL);
|
||||||
@@ -81,10 +81,10 @@
|
- lib_python = _Py_char2wchar("lib/python" VERSION, NULL);
|
||||||
'data': '{userbase}',
|
+ lib_python = _Py_char2wchar("lib64/python" VERSION, NULL);
|
||||||
},
|
|
||||||
'posix_user': {
|
if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
|
||||||
- 'stdlib': '{userbase}/lib/python{py_version_short}',
|
Py_FatalError(
|
||||||
- 'platstdlib': '{userbase}/lib/python{py_version_short}',
|
@@ -683,7 +683,7 @@ calculate_path(void)
|
||||||
+ 'stdlib': '{userbase}/lib64/python{py_version_short}',
|
}
|
||||||
+ 'platstdlib': '{userbase}/lib64/python{py_version_short}',
|
else
|
||||||
'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
|
wcsncpy(zip_path, _prefix, MAXPATHLEN);
|
||||||
- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
|
- joinpath(zip_path, L"lib/python00.zip");
|
||||||
+ 'platlib': '{userbase}/lib64/python{py_version_short}/site-packages',
|
+ joinpath(zip_path, L"lib64/python00.zip");
|
||||||
'include': '{userbase}/include/python{py_version_short}',
|
bufsz = wcslen(zip_path); /* Replace "00" with version */
|
||||||
'scripts': '{userbase}/bin',
|
zip_path[bufsz - 6] = VERSION[0];
|
||||||
'data': '{userbase}',
|
zip_path[bufsz - 5] = VERSION[2];
|
||||||
|
@@ -695,7 +695,7 @@ calculate_path(void)
|
||||||
|
fprintf(stderr,
|
||||||
|
"Could not find platform dependent libraries <exec_prefix>\n");
|
||||||
|
wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN);
|
||||||
|
- joinpath(exec_prefix, L"lib/lib-dynload");
|
||||||
|
+ joinpath(exec_prefix, L"lib64/lib-dynload");
|
||||||
|
}
|
||||||
|
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
|
||||||
|
|
||||||
|
--- Python-3.4.1/setup.py.lib64 2014-06-12 16:30:38.863248888 +0200
|
||||||
|
+++ Python-3.4.1/setup.py 2014-06-12 16:30:38.864248876 +0200
|
||||||
|
@@ -381,7 +381,7 @@ class PyBuildExt(build_ext):
|
||||||
|
|
||||||
|
if multiarch_path_component != '':
|
||||||
|
add_dir_to_list(self.compiler.library_dirs,
|
||||||
|
- '/usr/lib/' + multiarch_path_component)
|
||||||
|
+ '/usr/lib64/' + multiarch_path_component)
|
||||||
|
add_dir_to_list(self.compiler.include_dirs,
|
||||||
|
'/usr/include/' + multiarch_path_component)
|
||||||
|
return
|
||||||
|
@@ -722,11 +722,11 @@ class PyBuildExt(build_ext):
|
||||||
|
elif curses_library:
|
||||||
|
readline_libs.append(curses_library)
|
||||||
|
elif self.compiler.find_library_file(lib_dirs +
|
||||||
|
- ['/usr/lib/termcap'],
|
||||||
|
+ ['/usr/lib64/termcap'],
|
||||||
|
'termcap'):
|
||||||
|
readline_libs.append('termcap')
|
||||||
|
exts.append( Extension('readline', ['readline.c'],
|
||||||
|
- library_dirs=['/usr/lib/termcap'],
|
||||||
|
+ library_dirs=['/usr/lib64/termcap'],
|
||||||
|
extra_link_args=readline_extra_link_args,
|
||||||
|
libraries=readline_libs) )
|
||||||
|
else:
|
||||||
|
@@ -763,8 +763,8 @@ class PyBuildExt(build_ext):
|
||||||
|
if krb5_h:
|
||||||
|
ssl_incs += krb5_h
|
||||||
|
ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
|
||||||
|
- ['/usr/local/ssl/lib',
|
||||||
|
- '/usr/contrib/ssl/lib/'
|
||||||
|
+ ['/usr/local/ssl/lib64',
|
||||||
|
+ '/usr/contrib/ssl/lib64/'
|
||||||
|
] )
|
||||||
|
|
||||||
|
if (ssl_incs is not None and
|
||||||
|
|
|
@ -8,3 +8,4 @@
|
||||||
%py3_platsitedir %python3_sitearch
|
%py3_platsitedir %python3_sitearch
|
||||||
%py3_puresitedir %python3_sitelib
|
%py3_puresitedir %python3_sitelib
|
||||||
%py3_incdir %(%{__python3} -c 'from distutils.sysconfig import get_python_inc; print(get_python_inc())' 2>/dev/null || echo PYTHON-INCLUDEDIR-NOT-FOUND)
|
%py3_incdir %(%{__python3} -c 'from distutils.sysconfig import get_python_inc; print(get_python_inc())' 2>/dev/null || echo PYTHON-INCLUDEDIR-NOT-FOUND)
|
||||||
|
%py3dir %{_builddir}/python3-%{name}-%{version}-%{release}
|
||||||
|
|
|
@ -4,4 +4,4 @@ addFilter("E: non-executable-script")
|
||||||
|
|
||||||
# Not an actual problem, the packager tag is added by the build system anyway
|
# Not an actual problem, the packager tag is added by the build system anyway
|
||||||
addFilter("E: no-packager-tag")
|
addFilter("E: no-packager-tag")
|
||||||
|
addFilter("E: devel-file-in-non-devel-package")
|
||||||
|
|
64
python3.spec
64
python3.spec
|
@ -1,5 +1,5 @@
|
||||||
%define docver 3.3.4
|
%define docver 3.4.0
|
||||||
%define dirver 3.3
|
%define dirver 3.4
|
||||||
%define familyver 3
|
%define familyver 3
|
||||||
|
|
||||||
%define lib_major %{dirver}
|
%define lib_major %{dirver}
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
%endif
|
%endif
|
||||||
Summary: An interpreted, interactive object-oriented programming language
|
Summary: An interpreted, interactive object-oriented programming language
|
||||||
Name: python3
|
Name: python3
|
||||||
Version: 3.3.4
|
Version: 3.4.1
|
||||||
Release: 1
|
Release: 1
|
||||||
License: Modified CNRI Open Source License
|
License: Modified CNRI Open Source License
|
||||||
Group: Development/Python
|
Group: Development/Python
|
||||||
|
@ -22,16 +22,25 @@ Group: Development/Python
|
||||||
Source: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
|
Source: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
|
||||||
Source1: http://www.python.org/ftp/python/doc/%{docver}/python-%{docver}-docs-html.tar.bz2
|
Source1: http://www.python.org/ftp/python/doc/%{docver}/python-%{docver}-docs-html.tar.bz2
|
||||||
Source2: python3.macros
|
Source2: python3.macros
|
||||||
|
Source3: pybytecompile.macros
|
||||||
Source100: %{name}.rpmlintrc
|
Source100: %{name}.rpmlintrc
|
||||||
#Source4: python-mode-1.0.tar.bz2
|
|
||||||
Source5: bdist_rpm5.py
|
Source5: bdist_rpm5.py
|
||||||
|
|
||||||
Patch0: python-3.3.0-module-linkage.patch
|
Patch0: python-3.3.0-module-linkage.patch
|
||||||
Patch1: python3-3.3.0-fdr-lib64.patch
|
Patch1: python3-3.3.0-fdr-lib64.patch
|
||||||
Patch2: python3-3.2.3-fdr-lib64-fix-for-test_install.patch
|
Patch2: python3-3.2.3-fdr-lib64-fix-for-test_install.patch
|
||||||
#Patch3: python-3.3.0-module-dependencies.patch
|
Patch3: Python-select-requires-libm.patch
|
||||||
Patch4: python-3.3.3-fix-urllibnet-test.patch
|
Patch4: python-3.3.0b1-test-posix_fadvise.patch
|
||||||
Patch5: python-3.3.0-distutils-multiarch.patch
|
Patch5: Python-nis-requires-tirpc.patch
|
||||||
|
|
||||||
|
Patch153: 00153-fix-test_gdb-noise.patch
|
||||||
|
Patch156: 00156-gdb-autoload-safepath.patch
|
||||||
|
# 00173 #
|
||||||
|
# Workaround for ENOPROTOOPT seen in bs within
|
||||||
|
# test.test_support.bind_port()
|
||||||
|
# from Fedora (rhbz#913732)
|
||||||
|
Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch
|
||||||
|
Patch179: 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch
|
||||||
|
|
||||||
URL: http://www.python.org/
|
URL: http://www.python.org/
|
||||||
Conflicts: tkinter3 < %{version}
|
Conflicts: tkinter3 < %{version}
|
||||||
|
@ -148,16 +157,19 @@ Various applications written using tkinter
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -qn Python-%{version}
|
%setup -qn Python-%{version}
|
||||||
%patch0 -p0 -b .link
|
%patch0 -p0 -b .link~
|
||||||
%patch5 -p1
|
|
||||||
|
|
||||||
%if "%{_lib}" == "lib64"
|
%if "%{_lib}" == "lib64"
|
||||||
%patch1 -p1 -b .lib64
|
%patch1 -p1 -b .lib64~
|
||||||
%patch2 -p1
|
%patch2 -p1 -b .p2~
|
||||||
%endif
|
%endif
|
||||||
|
%patch3 -p1 -b .lm~
|
||||||
#patch3 -p1 -b .modlink~
|
%patch4 -p1 -b .p4~
|
||||||
%patch4 -p1 -b .urllibtest~
|
%patch5 -p1 -b .tirpc~
|
||||||
|
%patch153 -p1 -b .p153~
|
||||||
|
%patch156 -p1 -b .p156~
|
||||||
|
%patch173 -p1 -b .p173~
|
||||||
|
%patch179 -p1 -b .p179~
|
||||||
|
|
||||||
# docs
|
# docs
|
||||||
mkdir html
|
mkdir html
|
||||||
|
@ -341,6 +353,7 @@ install -m644 %{SOURCE5} -D %{buildroot}%{_libdir}/python%{dirver}/distutils/com
|
||||||
%{_includedir}/python*/pyconfig.h
|
%{_includedir}/python*/pyconfig.h
|
||||||
%{multiarch_includedir}/python*/pyconfig.h
|
%{multiarch_includedir}/python*/pyconfig.h
|
||||||
|
|
||||||
|
%dir %{_libdir}/python*/config-*
|
||||||
%{_libdir}/python*/config*/Makefile
|
%{_libdir}/python*/config*/Makefile
|
||||||
%exclude %{_libdir}/python*/site-packages/pynche
|
%exclude %{_libdir}/python*/site-packages/pynche
|
||||||
%exclude %{_libdir}/python*/lib-dynload/_tkinter.*.so
|
%exclude %{_libdir}/python*/lib-dynload/_tkinter.*.so
|
||||||
|
@ -350,6 +363,7 @@ install -m644 %{SOURCE5} -D %{buildroot}%{_libdir}/python%{dirver}/distutils/com
|
||||||
%{_libdir}/python*/LICENSE.txt
|
%{_libdir}/python*/LICENSE.txt
|
||||||
%{_libdir}/python%{dirver}/*.py
|
%{_libdir}/python%{dirver}/*.py
|
||||||
%{_libdir}/python%{dirver}/__pycache__
|
%{_libdir}/python%{dirver}/__pycache__
|
||||||
|
%{_libdir}/python%{dirver}/asyncio
|
||||||
%{_libdir}/python%{dirver}/collections
|
%{_libdir}/python%{dirver}/collections
|
||||||
%{_libdir}/python%{dirver}/concurrent
|
%{_libdir}/python%{dirver}/concurrent
|
||||||
%{_libdir}/python%{dirver}/ctypes
|
%{_libdir}/python%{dirver}/ctypes
|
||||||
|
@ -358,6 +372,7 @@ install -m644 %{SOURCE5} -D %{buildroot}%{_libdir}/python%{dirver}/distutils/com
|
||||||
%{_libdir}/python%{dirver}/distutils
|
%{_libdir}/python%{dirver}/distutils
|
||||||
%{_libdir}/python%{dirver}/email
|
%{_libdir}/python%{dirver}/email
|
||||||
%{_libdir}/python%{dirver}/encodings
|
%{_libdir}/python%{dirver}/encodings
|
||||||
|
%{_libdir}/python%{dirver}/ensurepip
|
||||||
%{_libdir}/python%{dirver}/html
|
%{_libdir}/python%{dirver}/html
|
||||||
%{_libdir}/python%{dirver}/http
|
%{_libdir}/python%{dirver}/http
|
||||||
%{_libdir}/python%{dirver}/importlib
|
%{_libdir}/python%{dirver}/importlib
|
||||||
|
@ -379,8 +394,8 @@ install -m644 %{SOURCE5} -D %{buildroot}%{_libdir}/python%{dirver}/distutils/com
|
||||||
%{_libdir}/python%{dirver}/xmlrpc
|
%{_libdir}/python%{dirver}/xmlrpc
|
||||||
%{_bindir}/pydoc3*
|
%{_bindir}/pydoc3*
|
||||||
%{_bindir}/python3*
|
%{_bindir}/python3*
|
||||||
%_bindir/pyvenv
|
%{_bindir}/pyvenv
|
||||||
%_bindir/pyvenv-%dirver
|
%{_bindir}/pyvenv-%{dirver}
|
||||||
%{_bindir}/2to3-%{dirver}
|
%{_bindir}/2to3-%{dirver}
|
||||||
%exclude %{_bindir}/python*config
|
%exclude %{_bindir}/python*config
|
||||||
#%{_datadir}/emacs/site-lisp/*
|
#%{_datadir}/emacs/site-lisp/*
|
||||||
|
@ -388,6 +403,23 @@ install -m644 %{SOURCE5} -D %{buildroot}%{_libdir}/python%{dirver}/distutils/com
|
||||||
%if %{with valgrind}
|
%if %{with valgrind}
|
||||||
%{_libdir}/valgrind/valgrind-python3.supp
|
%{_libdir}/valgrind/valgrind-python3.supp
|
||||||
%endif
|
%endif
|
||||||
|
# pip bits
|
||||||
|
%if "%{_libdir}" != "%{_prefix}/lib"
|
||||||
|
# In the %{_libdir} == %{_prefix}/lib case, those are caught by
|
||||||
|
# globs above.
|
||||||
|
%dir %{_prefix}/lib/python%{dirver}
|
||||||
|
%dir %{_prefix}/lib/python%{dirver}/site-packages
|
||||||
|
%{_prefix}/lib/python%{dirver}/site-packages/__pycache__
|
||||||
|
%{_prefix}/lib/python%{dirver}/site-packages/pkg_resources.py
|
||||||
|
%{_prefix}/lib/python%{dirver}/site-packages/easy_install.py
|
||||||
|
%{_prefix}/lib/python%{dirver}/site-packages/pip
|
||||||
|
%{_prefix}/lib/python%{dirver}/site-packages/setuptools*
|
||||||
|
%{_prefix}/lib/python%{dirver}/site-packages/_markerlib
|
||||||
|
%{_prefix}/lib/python%{dirver}/site-packages/pip-*.dist-info
|
||||||
|
%endif
|
||||||
|
%{_bindir}/easy_install-%{dirver}
|
||||||
|
%{_bindir}/pip3
|
||||||
|
%{_bindir}/pip%{dirver}
|
||||||
|
|
||||||
%files -n %{lib_name}
|
%files -n %{lib_name}
|
||||||
%{_libdir}/libpython*.so.1*
|
%{_libdir}/libpython*.so.1*
|
||||||
|
|
Loading…
Add table
Reference in a new issue