Skip to content

Commit 87f8cc8

Browse files
committed
- update corresponding nuget packages and build settings
1 parent 2e71402 commit 87f8cc8

File tree

270 files changed

+5619
-9882
lines changed

Some content is hidden

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

270 files changed

+5619
-9882
lines changed

PythonLib/extra/distutils/ccompiler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,9 @@ def has_function(self, funcname, includes=None, include_dirs=None,
748748
for incl in includes:
749749
f.write("""#include "%s"\n""" % incl)
750750
f.write("""\
751-
main (int argc, char **argv) {
751+
int main (int argc, char **argv) {
752752
%s();
753+
return 0;
753754
}
754755
""" % funcname)
755756
finally:

PythonLib/extra/distutils/command/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def finalize_options(self):
114114
self.build_scripts = os.path.join(self.build_base,
115115
'scripts-' + sys.version[0:3])
116116

117-
if self.executable is None:
117+
if self.executable is None and sys.executable:
118118
self.executable = os.path.normpath(sys.executable)
119119

120120
def run(self):

PythonLib/extra/distutils/command/check.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ def check_restructuredtext(self):
124124

125125
def _check_rst_data(self, data):
126126
"""Returns warnings when the provided data doesn't compile."""
127-
source_path = StringIO()
127+
# the include and csv_table directives need this to be a path
128+
source_path = self.distribution.script_name or 'setup.py'
128129
parser = Parser()
129130
settings = frontend.OptionParser(components=(Parser,)).get_default_values()
130131
settings.tab_width = 4

PythonLib/extra/distutils/sysconfig.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@
2525
# Path to the base directory of the project. On Windows the binary may
2626
# live in project/PCBuild9. If we're dealing with an x64 Windows build,
2727
# it'll live in project/PCbuild/amd64.
28-
project_base = os.path.dirname(os.path.abspath(sys.executable))
28+
if sys.executable:
29+
project_base = os.path.dirname(os.path.abspath(sys.executable))
30+
else:
31+
# sys.executable can be empty if argv[0] has been changed and Python is
32+
# unable to retrieve the real program name
33+
project_base = os.getcwd()
2934
if os.name == "nt" and "pcbuild" in project_base[-8:].lower():
3035
project_base = os.path.abspath(os.path.join(project_base, os.path.pardir))
3136
# PC/VS7.1
@@ -79,7 +84,12 @@ def get_python_inc(plat_specific=0, prefix=None):
7984

8085
if os.name == "posix":
8186
if python_build:
82-
buildir = os.path.dirname(sys.executable)
87+
if sys.executable:
88+
buildir = os.path.dirname(sys.executable)
89+
else:
90+
# sys.executable can be empty if argv[0] has been changed
91+
# and Python is unable to retrieve the real program name
92+
buildir = os.getcwd()
8393
if plat_specific:
8494
# python.h is located in the buildir
8595
inc_dir = buildir
@@ -171,8 +181,8 @@ def customize_compiler(compiler):
171181
_osx_support.customize_compiler(_config_vars)
172182
_config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
173183

174-
(cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \
175-
get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
184+
(cc, cxx, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \
185+
get_config_vars('CC', 'CXX', 'CFLAGS',
176186
'CCSHARED', 'LDSHARED', 'SO', 'AR',
177187
'ARFLAGS')
178188

@@ -196,7 +206,7 @@ def customize_compiler(compiler):
196206
if 'LDFLAGS' in os.environ:
197207
ldshared = ldshared + ' ' + os.environ['LDFLAGS']
198208
if 'CFLAGS' in os.environ:
199-
cflags = opt + ' ' + os.environ['CFLAGS']
209+
cflags = cflags + ' ' + os.environ['CFLAGS']
200210
ldshared = ldshared + ' ' + os.environ['CFLAGS']
201211
if 'CPPFLAGS' in os.environ:
202212
cpp = cpp + ' ' + os.environ['CPPFLAGS']

PythonLib/extra/lib2to3/refactor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
# Python imports
1717
import os
18+
import pkgutil
1819
import sys
1920
import logging
2021
import operator
@@ -33,13 +34,12 @@
3334
def get_all_fix_names(fixer_pkg, remove_prefix=True):
3435
"""Return a sorted list of all available fix names in the given package."""
3536
pkg = __import__(fixer_pkg, [], [], ["*"])
36-
fixer_dir = os.path.dirname(pkg.__file__)
3737
fix_names = []
38-
for name in sorted(os.listdir(fixer_dir)):
39-
if name.startswith("fix_") and name.endswith(".py"):
38+
for finder, name, ispkg in pkgutil.iter_modules(pkg.__path__):
39+
if name.startswith("fix_"):
4040
if remove_prefix:
4141
name = name[4:]
42-
fix_names.append(name[:-3])
42+
fix_names.append(name)
4343
return fix_names
4444

4545

PythonLib/extra_dll/_bsddb.pyd

0 Bytes
Binary file not shown.

PythonLib/extra_dll_x64/_bsddb.pyd

0 Bytes
Binary file not shown.

PythonLib/full/DocXMLRPCServer.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@
2020
CGIXMLRPCRequestHandler,
2121
resolve_dotted_attribute)
2222

23+
24+
def _html_escape_quote(s):
25+
s = s.replace("&", "&") # Must be done first!
26+
s = s.replace("<", "&lt;")
27+
s = s.replace(">", "&gt;")
28+
s = s.replace('"', "&quot;")
29+
s = s.replace('\'', "&#x27;")
30+
return s
31+
32+
2333
class ServerHTMLDoc(pydoc.HTMLDoc):
2434
"""Class used to generate pydoc HTML document for a server"""
2535

@@ -210,7 +220,8 @@ def generate_html_documentation(self):
210220
methods
211221
)
212222

213-
return documenter.page(self.server_title, documentation)
223+
title = _html_escape_quote(self.server_title)
224+
return documenter.page(title, documentation)
214225

215226
class DocXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
216227
"""XML-RPC and documentation request handler class.

PythonLib/full/cookielib.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ def set_ok_path(self, cookie, request):
984984
req_path = request_path(request)
985985
if ((cookie.version > 0 or
986986
(cookie.version == 0 and self.strict_ns_set_path)) and
987-
not req_path.startswith(cookie.path)):
987+
not self.path_return_ok(cookie.path, request)):
988988
_debug(" path attribute %s is not a prefix of request "
989989
"path %s", cookie.path, req_path)
990990
return False
@@ -1139,6 +1139,11 @@ def return_ok_domain(self, cookie, request):
11391139
req_host, erhn = eff_request_host(request)
11401140
domain = cookie.domain
11411141

1142+
if domain and not domain.startswith("."):
1143+
dotdomain = "." + domain
1144+
else:
1145+
dotdomain = domain
1146+
11421147
# strict check of non-domain cookies: Mozilla does this, MSIE5 doesn't
11431148
if (cookie.version == 0 and
11441149
(self.strict_ns_domain & self.DomainStrictNonDomain) and
@@ -1151,7 +1156,7 @@ def return_ok_domain(self, cookie, request):
11511156
_debug(" effective request-host name %s does not domain-match "
11521157
"RFC 2965 cookie domain %s", erhn, domain)
11531158
return False
1154-
if cookie.version == 0 and not ("."+erhn).endswith(domain):
1159+
if cookie.version == 0 and not ("."+erhn).endswith(dotdomain):
11551160
_debug(" request-host %s does not match Netscape cookie domain "
11561161
"%s", req_host, domain)
11571162
return False
@@ -1165,7 +1170,11 @@ def domain_return_ok(self, domain, request):
11651170
req_host = "."+req_host
11661171
if not erhn.startswith("."):
11671172
erhn = "."+erhn
1168-
if not (req_host.endswith(domain) or erhn.endswith(domain)):
1173+
if domain and not domain.startswith("."):
1174+
dotdomain = "." + domain
1175+
else:
1176+
dotdomain = domain
1177+
if not (req_host.endswith(dotdomain) or erhn.endswith(dotdomain)):
11691178
#_debug(" request domain %s does not match cookie domain %s",
11701179
# req_host, domain)
11711180
return False
@@ -1182,11 +1191,15 @@ def domain_return_ok(self, domain, request):
11821191
def path_return_ok(self, path, request):
11831192
_debug("- checking cookie path=%s", path)
11841193
req_path = request_path(request)
1185-
if not req_path.startswith(path):
1186-
_debug(" %s does not path-match %s", req_path, path)
1187-
return False
1188-
return True
1194+
pathlen = len(path)
1195+
if req_path == path:
1196+
return True
1197+
elif (req_path.startswith(path) and
1198+
(path.endswith("/") or req_path[pathlen:pathlen+1] == "/")):
1199+
return True
11891200

1201+
_debug(" %s does not path-match %s", req_path, path)
1202+
return False
11901203

11911204
def vals_sorted_by_key(adict):
11921205
keys = adict.keys()

PythonLib/full/email/_parseaddr.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,12 @@ def getaddrspec(self):
336336
aslist.append('@')
337337
self.pos += 1
338338
self.gotonext()
339-
return EMPTYSTRING.join(aslist) + self.getdomain()
339+
domain = self.getdomain()
340+
if not domain:
341+
# Invalid domain, return an empty address instead of returning a
342+
# local part to denote failed parsing.
343+
return EMPTYSTRING
344+
return EMPTYSTRING.join(aslist) + domain
340345

341346
def getdomain(self):
342347
"""Get the complete domain name from an address."""
@@ -351,6 +356,10 @@ def getdomain(self):
351356
elif self.field[self.pos] == '.':
352357
self.pos += 1
353358
sdlist.append('.')
359+
elif self.field[self.pos] == '@':
360+
# bpo-34155: Don't parse domains with two `@` like
361+
# `[email protected]@important.com`.
362+
return EMPTYSTRING
354363
elif self.field[self.pos] in self.atomends:
355364
break
356365
else:

0 commit comments

Comments
 (0)