Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf33126b

Browse files
Merge branch 'python:main' into fix-issue-using-ipmodule
2 parents48c565f +1c0a9c5 commitf33126b

13 files changed

+43
-13
lines changed

‎Doc/library/asyncio-eventloop.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,7 @@ Server objects are created by :meth:`loop.create_server`,
15711571
:meth:`loop.create_unix_server`,:func:`start_server`,
15721572
and:func:`start_unix_server` functions.
15731573

1574-
Do not instantiate the class directly.
1574+
Do not instantiate the:class:`Server`class directly.
15751575

15761576
..class::Server
15771577

@@ -1662,7 +1662,8 @@ Do not instantiate the class directly.
16621662

16631663
..attribute::sockets
16641664

1665-
List of:class:`socket.socket` objects the server is listening on.
1665+
List of socket-like objects, ``asyncio.trsock.TransportSocket``, which
1666+
the server is listening on.
16661667

16671668
..versionchanged::3.7
16681669
Prior to Python 3.7 ``Server.sockets`` used to return an

‎Lib/ensurepip/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
__all__= ["version","bootstrap"]
1212
_PACKAGE_NAMES= ('pip',)
13-
_PIP_VERSION="23.1.1"
13+
_PIP_VERSION="23.1.2"
1414
_PROJECTS= [
1515
("pip",_PIP_VERSION,"py3"),
1616
]

‎Lib/locale.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ def getpreferredencoding(do_setlocale=True):
962962
'c.ascii':'C',
963963
'c.en':'C',
964964
'c.iso88591':'en_US.ISO8859-1',
965-
'c.utf8':'en_US.UTF-8',
965+
'c.utf8':'C.UTF-8',
966966
'c_c':'C',
967967
'c_c.c':'C',
968968
'ca':'ca_ES.ISO8859-1',

‎Lib/pdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def namespace(self):
154154

155155
@property
156156
defcode(self):
157-
withio.open(self)asfp:
157+
withio.open_code(self)asfp:
158158
returnf"exec(compile({fp.read()!r},{self!r}, 'exec'))"
159159

160160

‎Lib/test/test_dis.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,6 +1935,14 @@ def test_findlabels(self):
19351935

19361936
self.assertEqual(sorted(labels),sorted(jumps))
19371937

1938+
deftest_findlinestarts(self):
1939+
deffunc():
1940+
pass
1941+
1942+
code=func.__code__
1943+
offsets= [linestart[0]forlinestartindis.findlinestarts(code)]
1944+
self.assertEqual(offsets, [0,2])
1945+
19381946

19391947
classTestDisTraceback(DisTestBase):
19401948
defsetUp(self)->None:

‎Lib/test/test_pdb.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2396,6 +2396,12 @@ def _create_fake_frozen_module():
23962396
# verify that pdb found the source of the "frozen" function
23972397
self.assertIn('x = "Sentinel string for gh-93696"',stdout,"Sentinel statement not found")
23982398

2399+
deftest_non_utf8_encoding(self):
2400+
script_dir=os.path.join(os.path.dirname(__file__),'encoded_modules')
2401+
forfilenameinos.listdir(script_dir):
2402+
iffilename.endswith(".py"):
2403+
self._run_pdb([os.path.join(script_dir,filename)],'q')
2404+
23992405
classChecklineTests(unittest.TestCase):
24002406
defsetUp(self):
24012407
linecache.clearcache()# Pdb.checkline() uses linecache.getline()

‎Lib/test/test_urllib2.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -524,16 +524,17 @@ def http_open(self, req):
524524
returnMockResponse(200,"OK",msg,"",req.get_full_url())
525525

526526

527-
classMockHTTPSHandler(urllib.request.HTTPSHandler):
528-
# Useful for testing the Proxy-Authorization request by verifying the
529-
# properties of httpcon
527+
ifhasattr(http.client,'HTTPSConnection'):
528+
classMockHTTPSHandler(urllib.request.HTTPSHandler):
529+
# Useful for testing the Proxy-Authorization request by verifying the
530+
# properties of httpcon
530531

531-
def__init__(self,debuglevel=None,context=None,check_hostname=None):
532-
super(MockHTTPSHandler,self).__init__(debuglevel,context,check_hostname)
533-
self.httpconn=MockHTTPClass()
532+
def__init__(self,debuglevel=None,context=None,check_hostname=None):
533+
super(MockHTTPSHandler,self).__init__(debuglevel,context,check_hostname)
534+
self.httpconn=MockHTTPClass()
534535

535-
defhttps_open(self,req):
536-
returnself.do_open(self.httpconn,req)
536+
defhttps_open(self,req):
537+
returnself.do_open(self.httpconn,req)
537538

538539

539540
classMockHTTPHandlerCheckAuth(urllib.request.BaseHandler):
@@ -1075,6 +1076,7 @@ def test_http_handler_local_debuglevel(self):
10751076
o.open("http://www.example.com")
10761077
self.assertEqual(h._debuglevel,5)
10771078

1079+
@unittest.skipUnless(hasattr(http.client,'HTTPSConnection'),'HTTPSConnection required for HTTPS tests.')
10781080
deftest_https_handler_global_debuglevel(self):
10791081
withmock.patch.object(http.client.HTTPSConnection,'debuglevel',7):
10801082
o=OpenerDirector()
@@ -1083,6 +1085,7 @@ def test_https_handler_global_debuglevel(self):
10831085
o.open("https://www.example.com")
10841086
self.assertEqual(h._debuglevel,7)
10851087

1088+
@unittest.skipUnless(hasattr(http.client,'HTTPSConnection'),'HTTPSConnection required for HTTPS tests.')
10861089
deftest_https_handler_local_debuglevel(self):
10871090
o=OpenerDirector()
10881091
h=MockHTTPSHandler(debuglevel=4)
@@ -1456,6 +1459,7 @@ def test_proxy_https(self):
14561459
self.assertEqual([(handlers[0],"https_open")],
14571460
[tup[0:2]fortupino.calls])
14581461

1462+
@unittest.skipUnless(hasattr(http.client,'HTTPSConnection'),'HTTPSConnection required for HTTPS tests.')
14591463
deftest_proxy_https_proxy_authorization(self):
14601464
o=OpenerDirector()
14611465
ph=urllib.request.ProxyHandler(dict(https='proxy.example.com:3128'))

‎Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ Dave Chambers
299299
Pascal Chambon
300300
Nicholas Chammas
301301
Ofey Chan
302+
Juhi Chandalia
302303
John Chandler
303304
Hye-Shik Chang
304305
Jeffrey Chang
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed a bug where:mod:`pdb` crashes when reading source file with different encoding by replacing:func:`io.open` with:func:`io.open_code`. The new method would also call into the hook set by:func:`PyFile_SetOpenCodeHook`.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The C.UTF-8 locale is no longer converted to en_US.UTF-8, enabling the use
2+
of UTF-8 encoding on systems which have no locales installed.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update the bundled copy of pip to version 23.1.2.

‎Tools/build/deepfreeze.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ def generate_unicode(self, name: str, s: str) -> str:
175175
returnf"&_Py_STR({strings[s]})"
176176
ifsinidentifiers:
177177
returnf"&_Py_ID({s})"
178+
iflen(s)==1:
179+
c=ord(s)
180+
ifc<128:
181+
returnf"(PyObject *)&_Py_SINGLETON(strings).ascii[{c}]"
182+
elifc<256:
183+
returnf"(PyObject *)&_Py_SINGLETON(strings).latin1[{c-128}]"
178184
ifre.match(r'\A[A-Za-z0-9_]+\Z',s):
179185
name=f"const_str_{s}"
180186
kind,ascii=analyze_character_width(s)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp