Skip to content

Commit 8785683

Browse files
author
Sean McVeigh
committed
import internal 3.2.2 tree from deckard
1 parent e9d474a commit 8785683

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1607
-146
lines changed

Python-3/Include/Python.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,19 @@ PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
165165
#define PyDoc_STR(str) ""
166166
#endif
167167

168+
#ifdef __QNXNTO__
169+
/* For each fopen() with valid descriptor
170+
we force full buffer mode FBF with 16kb. man 'setvbuf' for more info.
171+
You can override the build by setting SET_BUFFER_IO(fp) to nothing
172+
We have max 1024 FD descriptors and an idle PIM setup has around 125.
173+
174+
MIN: 125 * 16kb = 2000k <<< quick test shows roughly 123 FD's for PIM on idle.
175+
50%: 512 * 16kb = 8192k <<< If we hit 512 files open
176+
MAX: 1023 * 16kb = 16368k <<< if we hit 1023 files open 1024 is physical limit
177+
*/
178+
179+
#define SET_BUFFER_IO(fp) \
180+
if(fp) setvbuf(fp,NULL,_IOFBF,16384)
181+
#endif
182+
168183
#endif /* !Py_PYTHON_H */

Python-3/Lib/distutils/spawn.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0):
2828
Raise DistutilsExecError if running the program fails in any way; just
2929
return on success.
3030
"""
31-
if os.name == 'posix':
31+
if sys.platform == 'qnx6':
32+
_spawn_qnx(cmd, search_path, dry_run=dry_run)
33+
elif os.name == 'posix':
3234
_spawn_posix(cmd, search_path, dry_run=dry_run)
3335
elif os.name == 'nt':
3436
_spawn_nt(cmd, search_path, dry_run=dry_run)
@@ -94,6 +96,23 @@ def _spawn_os2(cmd, search_path=1, verbose=0, dry_run=0):
9496
raise DistutilsExecError(
9597
"command '%s' failed with exit status %d" % (cmd[0], rc))
9698

99+
def _spawn_qnx(cmd, search_path=1, verbose=0, dry_run=0):
100+
log.info(' '.join(cmd))
101+
if dry_run:
102+
return
103+
try:
104+
if search_path:
105+
rc = os.spawnvp(os.P_WAIT, cmd[0], cmd)
106+
else:
107+
rc = os.spawnv(os.P_WAIT, cmd[0], cmd)
108+
except OSError as exc:
109+
raise DistutilsExecError(
110+
"command '%s' failed: %s" % (cmd[0], exc.args[-1]))
111+
if rc != 0:
112+
msg = "command '%s' failed with exit status %d" % (cmd[0], rc)
113+
log.debug(msg)
114+
raise DistutilsExecError(msg)
115+
97116
if sys.platform == 'darwin':
98117
from distutils import sysconfig
99118
_cfg_target = None

Python-3/Lib/distutils/tests/Setup.sample

100644100755
File mode changed.

Python-3/Lib/distutils/tests/test_extension.py

100644100755
File mode changed.

Python-3/Lib/html/parser.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
r'\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*'
3131
r'(\'[^\']*\'|"[^"]*"|[^\s"\'=<>`]*))?')
3232
attrfind_tolerant = re.compile(
33-
r'\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*'
33+
r',?\s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*'
3434
r'(\'[^\']*\'|"[^"]*"|[^>\s]*))?')
3535
locatestarttagend = re.compile(r"""
3636
<[a-zA-Z][-.a-zA-Z0-9:_]* # tag name
@@ -277,12 +277,11 @@ def parse_starttag(self, i):
277277
assert match, 'unexpected call to parse_starttag()'
278278
k = match.end()
279279
self.lasttag = tag = rawdata[i+1:k].lower()
280-
281280
while k < endpos:
282281
if self.strict:
283282
m = attrfind.match(rawdata, k)
284283
else:
285-
m = attrfind_tolerant.search(rawdata, k)
284+
m = attrfind_tolerant.match(rawdata, k)
286285
if not m:
287286
break
288287
attrname, rest, attrvalue = m.group(1, 2, 3)

Python-3/Lib/http/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
906906
"""
907907

908908
# Determine platform specifics
909-
have_fork = hasattr(os, 'fork')
909+
have_fork = hasattr(os, 'fork') and sys.platform != 'qnx6'
910910

911911
# Make rfile unbuffered -- we need to read one line and then pass
912912
# the rest to a subprocess, so we can't use buffered input.

Python-3/Lib/plat-qnx6/regen

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#! /bin/sh
2+
set -v
3+
h2py -i '(u_long)' /usr/include/netinet/in.h
4+

Python-3/Lib/site.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
PREFIXES = [sys.prefix, sys.exec_prefix]
6262
# Enable per user site-packages directory
6363
# set it to False to disable the feature or True to force the feature
64-
ENABLE_USER_SITE = None
64+
ENABLE_USER_SITE = False
6565

6666
# for distutils.commands.install
6767
# These values are initialized by the getuserbase() and getusersitepackages()

Python-3/Lib/smtplib.py

100644100755
File mode changed.

Python-3/Lib/ssl.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, OPENSSL_VERSION
6363
from _ssl import _SSLContext, SSLError
6464
from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
65-
from _ssl import OP_ALL, OP_NO_SSLv2, OP_NO_SSLv3, OP_NO_TLSv1
65+
from _ssl import OP_ALL, OP_NO_SSLv2, OP_NO_SSLv3, OP_NO_TLSv1, OP_NO_TLSv1_1
6666
from _ssl import RAND_status, RAND_egd, RAND_add
6767
from _ssl import (
6868
SSL_ERROR_ZERO_RETURN,
@@ -311,6 +311,13 @@ def getpeercert(self, binary_form=False):
311311
self._checkClosed()
312312
return self._sslobj.peer_certificate(binary_form)
313313

314+
def getpeercertchain(self, binary_form=False):
315+
"""Returns the certificate chain provided by the other end
316+
of the SSL channel."""
317+
318+
self._checkClosed()
319+
return self._sslobj.peer_cert_chain(binary_form)
320+
314321
def cipher(self):
315322
self._checkClosed()
316323
if not self._sslobj:

0 commit comments

Comments
 (0)