登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
AI 队友
登录
注册
2025 Gitee 年度开源项目评选投票进行中,快为你的心仪项目助力!
代码拉取完成,页面将自动刷新
仓库状态说明
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
8
Star
2
Fork
89
src-openEuler
/
python3
关闭
代码
Issues
5
Pull Requests
0
Wiki
统计
流水线
服务
JavaDoc
PHPDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
【软件升级】openEuler 22.03 LTS版本python3软件升级至3.9.9
已完成
#I4L3JG
开源软件变更管理
桐小哥
创建于
2021-12-04 15:45
| 差异分析报告 | | | | | :----------- | ----------------------------------------------------- | -------- | ------------------ | | 版本变更原因 | | 变更后版本 |3.9.9 | | 差异分类 | 差异项 | 差异说明 | 影响评估与适配方案 | | 特性变化 | 新增特性/删除特性/变更特性实现 |1、对于浮点数据,优化了floor(), ceil(),trunc()<br> 2、移除sys.getcheckinterval()、sys.setcheckinterval(),使用sys.getswitchinterval()、sys.setswitchinterval()代替<br> 3、优化解码 ASCII字符串,``b"foo".decode()``快了约15%<br> 4、如果sys.argv[0]是通过命令行指定的1个文件名,sys.argv[0]将返回绝对路径<br> 5、venv模块添加--upgrade-deps选项<br> 6、移除mac_centeuro编码<br> 7、pydoc可以解析https链接<br> 8、os.sendfile的out、in参数改名为out_fd、in_fd<br> 9、向subprocess添加umask支持;Popen类的构造方法新增默认参数umask=-1,_execute_child方法新增关键字参数unused_umask<br> 10、弃用_tkinter.TkappType的split()方法<br> 11、更新pow函数的参数,使其有意义,原来pow(x, y, z=None, /),修改为pow(base, exp, mod=None)<br> 12、Lib/http/server.py模块SimpleHTTPRequestHandler的构造函数directory参数允许传入类路径对象<br> 13、ast模块添加__main__函数,可以通过命令行调用ast模块传参数执行<br> 14、ast模块dump函数添加命名关键字参数indent,允许生成一个多行缩进输出<br> 15、http模块添加新的状态码:451,对应宏UNAVAILABLE_FOR_LEGAL_REASONS<br> 16、移除threading.Thread.isAlive()<br> 17、调用 logging.getLogger('root') 时返回根记录器,而以前它返回一个名为 'root' 的非root记录器<br> 18、弃用parser模块<br> 19、当allow_abbrev=False时,停止参数解析-vv<br> 20、添加UDPLITE 支持<br> 21、移除弃用的方法HTMLParser.unescape<br> 22、移除aifc, sunau,wave模块openfp()方法<br> 23、弃用math.factorial()方法<br> 24、移除_dummy_thread和dummy_threading模块<br> 25、pathlib.Path类的rename和replace方法添加返回值<br> 26、弃用xml.etree.ElementTree.Element.copy()方法<br> 27、删除xml.etree.cElementTree模块,删除Element.getchildren()、 Element.getiterator()、ElementTree.getiterator()方法<br> 28、删除plistlib模块在python3.4中弃用的API,包括Data类,"readPlist", "writePlist", "readPlistFromBytes", "writePlistToBytes"方法,_PlistParser、_BinaryPlistParser的构造方法中移除关键字参数use_builtin_types,load和loads方法中移除默认参数use_builtin_types=True<br> 29、subprocess模块的Popen类的构造函数中新增默认参数user=None, group=None, extra_groups=None;_execute_child方法中新增关键字参数gid, gids, uid<br> 30、弃用smtpd.MailmanProxy类,从python3.11开始将会被删除<br> 31、将线程堆栈大小设置为 8 Mb,以便在 android 平台上进行调试。<br> 32、移除PyFPE_START_PROTECT、PyFPE_END_PROTECT<br> 33、对于浮点对象,实现了__floor__和 __ceil__<br> 34、当int + int 和 int - int的结果在python小整数范围内([-5,256]),将不会返回一个新的int对象<br> 35、``os.PathLike``, ``pathlib.Path``类实现``__class_getitem__``<br> 36、asyncio对象(Future, Task, Queue)实现``__class_getitem__``<br> 37、array.array:移除tostring()、fromstring(),他们是tobytes()、frombytes()的别名<br> 38、向json.tool添加--no-ensure-ascii选项以禁用转义非 ascii 字符<br> 39、当所有权重为零时,random.choices() 现在会引发 ValueError。<br> 40、当 unpickling 失败时,抛出异常变更<br> 41、对ast添加-i、--indent (indentation level)、--no-type-comments选项<br> 42、在关闭的 zipfile.ZipExtFile 上调用以下内容时引发 ValueError:read, readable, seek, seekable, tell.<br> 43、functools模块添加TopologicalSorter,实现拓扑图排序<br> 44、添加gc.is_finalized函数以检查对象是否被回收<br> 45、从json.loads中移除encoding选项,它从Python 3.1开始就被弃用<br> 46、移除bz2.BZ2File类构造函数中的默认参数buffering=_sentinel,并且compresslevel参数变成keyword-only参数<br> 47、移除了nntplib.NNTP类xpath()、xgtitle()方法,从Python 3.3开始弃用,现在删除<br> 48、弃用binhex4、hexbin4标准库<br> 49、下面函数被弃用:func:`~binascii.b2a_hqx`, `~binascii.a2b_hqx`、`~binascii.rlecode_hqx`, `~binascii.rledecode_hqx`<br> 50、移除base64.encodestring()、base64.decodestring(),其别名已在python3.1中弃用<br> 51、移除fractions.gcd(),其在py3.5中被弃用;可以使用math.gcd代替<br> 52、smtplib.SMTP构造函数添加默认参数timeout=socket._GLOBAL_DEFAULT_TIMEOUT<br> 53、RefactoringTool添加exec_function选项<br> 54、poplib现在拒绝timeout = 0;如果他们的构造函数中timeout = 0,poplib.POP3、poplib.POP3_SSL将抛出异常ValueError<br> 55、ftplib.FTP/FTP_TLS现在拒绝timeout = 0<br> 56、smtp.SMTP/SMTP_SSL现在拒绝timeout = 0<br> 57、nntplib.NNTP/NNTP_SSL现在拒绝timeout = 0<br> 58、epoll.unregister()不再忽略EBADF错误<br> 59、ast.literal_eval()现在支持通过'set()'创建空的集合对象<br> 60、IMAP4、IMAP4_SSL构造函数新增默认参数timeout=None<br> 61、locale:删除格式化货币的尾随空格<br> 62、pstats.Stats添加get_profile_dict()方法,此方法返回 StatsProfile 的一个实例<br> 63、fcntl, msvcrt, os, resource, shutil, signal,syslog,pty等多个模块添加审计事件( auditing events)功能<br> 64、扩展 math.gcd() 和 math.lcm() 以处理多个参数,兼容以前的版本<br> 65、io.BufferedReader()实例是truncate()将报错UnsupportedOperation,当它调用一个只读的io.BufferedReader()对象的时候<br> 66、distutils库弃用bdist_msi命令,可使用wheel库的bdist_wheel命令替代<br> 67、移除uuid.getnode方法的无用参数getters<br> 68、Executor.shutdown()方法新增默认参数cancel_futures=False<br> 69、asyncio.locks中移除旧风格的上下文管理器,在py3.7中已弃用<br> 70、`inspect.Signature.parameters`、`inspect.BoundArguments.arguments`的类型由OrderedDicts修改成dict<br> 71、ipaddress模块添加对scoped IPv6地址的支持<br> 72、uuid._netstat_getnode()拒绝(跳过)长度17的IPv6地址(ex: 'fe80::5054:ff:fe9')<br> 73、``ast.Suite``, ``ast.Param``, ``ast.AugLoad`` and ``ast.AugStore``被移除<br> 74、添加一个开关,以实现当 -E或-I使用时忽略PYTHONCASEOK<br> 75、移除``ast.Suite``<br> 76、http.HTTPStatus类新增``103 EARLY_HINTS``和``425 TOO_EARLY``http状态码<br> 77、http.HTTPStatus类新增``418 IM_A_TEAPOT``http状态码<br> 78、提高 bytes.hex() 的性能。<br> 79、提高range(), list() ,dict()的性能<br> 80、random.sample()放弃对set对象的支持<br> 81、statistics.NormalDist()新增zscore()方法去计算(x - mean) / stdev<br> 82、random.getrandbits()方法现在接受输入0<br> 83、添加 random.randbytes() 函数和 random.Random.randbytes()方法以生成随机字节。<br> 84、移除弃用的方法symtable.SymbolTable.has_exec<br> 85、typing.NamedTuple移除属性_field_types<br> 86、从concurrent.futures.ThreadPoolExecutor、concurrent.futures.ProcessPoolExecutor删除了daemon线程<br> 87、time模块添加CLOCK_TAI常量<br> 88、shlex.split()第一个参数s不支持``None``<br> 89、移除Tools/scripts/checkpyc.py<br> 90、`date.isocalendar()`返回值类型变更,原先返回一个简单的元组(year, week, weekday),现在返回的是一个namedtuple对象([查看提交](https://github.com/python/cpython/commit/1b97b9b0ad9a2ff8eb5c8f2e2e7c2aec1d13a330))<br> 91、uuid模块不再使用ctypes加载libuuid或者rpcrt4.dll`([查看提交](https://github.com/python/cpython/commit/d6b727e2c947240804b8e434b305ba2890122550))<br> 92、对abc模块应用PEP 573([查看提交](https://github.com/python/cpython/commit/77c614624b6bf2145bef69830d0f499d8b55ec0c))<br> 93、改进源代码中无效字符的语法错误,比如错误信息不再包含误导性的“in identifier”([查看提交](https://github.com/python/cpython/commit/74ea6b5a7501fb393cd567fb21998d0bfeeb267c))<br> 94、添加--experimental-isolated-subinterpreters构建选项,使用这个选项时,将强制使用 libc malloc() 内存分配器([查看提交](https://github.com/python/cpython/commit/c5fa364f4ea836f25dd07cfb328152d40a568371))<br> 95、添加对 CAN_J1939 套接字的支持([查看提交](https://github.com/python/cpython/commit/360371f79c48f15bbcee7aeecacf97a899913b25))<br> 96、concurrent.futures模块Process.shutdown(wait=True),当队列不为空且等待时,将关闭队列([查看提交](https://github.com/python/cpython/commit/1a275013d1ecc2e3778d64fda86174b2f13d6969))<br> 97、添加multiprocessing.SimpleQueue.close()方法,用于关闭队列,释放资源([查看提交](https://github.com/python/cpython/commit/9adccc1384568f4d46e37f698cb3e3a4f6ca0252))<br> 98、difflib.SequenceMatched.find_longest_match方法的四个参数新增默认值为0([查看提交](https://github.com/python/cpython/commit/3209cbd99b6d65aa18b3beb124fac9c792b8993d))<br> 99、添加random.randbytes()函数和random.Random.randbytes()函数,用于生成随机字节([查看提交](https://github.com/python/cpython/commit/9f5fe7910f4a1bf5a425837d4915e332b945eb7b))<br> 100、删除nntplib._NNTPBase类,将其内容合并至nntplib.NNTP类([查看提交](https://github.com/python/cpython/commit/aa92a7cf210c98ad94229f282221136d846942db))<br> 101、弃用random.shuffle()方法的random参数([查看提交](https://github.com/python/cpython/commit/190fac99c58232f3e0b34891872b91e50ea2f057))<br> 102、random.sample()添加默认参数counts(counts=None)([查看提交](https://github.com/python/cpython/commit/81a5fc38e81b424869f4710f48e9371dfa2d3b77))<br> 103、重构typing._GenericAlias([查看提交](https://github.com/python/cpython/commit/c1c7d8ead9eb214a6149a43e31a3213c52448877))<br> 104、修复拼写shake128为shake_128([查看提交](https://github.com/python/cpython/commit/62ecd8a8f908282726d2f019c93efa1cf2e9e784))<br> 105、hashlib模块现在可以使用SHA3、SHAKE (OpenSSL 1.1.1+)([查看提交](https://github.com/python/cpython/commit/d5b3f6b7f9fc74438009af63f1de01bd77be9385))<br> 106、添加--without-builtin-hashlib-hashes、--with-builtin-hashlib-hashes=sha3,blake1选项以禁用或有选择地启用内置哈希模块([查看提交](https://github.com/python/cpython/commit/9b60e55db2897acc30d6b9ef1dbc49674eed40c7))<br> 107、将HMAC密钥长度限制为INT_MAX ([查看提交](https://github.com/python/cpython/commit/aca4670ad695d4b01c7880fe3d0af817421945bd))<br> 108、hmac.HMAC类的digest_con、inner、outer属性将被弃用([查看提交](https://github.com/python/cpython/commit/837f9e42e3a1ad03b340661afe85e67d2719334f))<br> 109、公开了OpenSSL的HMAC API([查看提交](https://github.com/python/cpython/commit/54f2898fe7e4ca1f239e96284af3cc5b34d2ae02))<br> 110、修复ast模块_ABC类构造函数中的关键字冲突处理问题,_ABC是Num、Str等多个类的元类([查看提交](https://github.com/python/cpython/commit/c73914a562580ae72048876cb42ed8e76e2c83f9))<br> 111、更新了 PurePath.relative_to() 的错误消息和文档,以更好地反映函数行为。([查看提交](https://github.com/python/cpython/commit/448325369ff73011d34d6c3a493014fe3ead8843))<br> 112、当ast.parse传递的``feature_version``小于``(3, 8)``时,不会解析其中的f-string([查看提交](https://github.com/python/cpython/commit/c116c94ff119485761460f1033cdee425bed0310))<br> 113、弃用symbol模块([查看提交](https://github.com/python/cpython/commit/cf88871d6a9c12e7b7e5f4d65abc2ec6e2fe952e))<br> 114、添加Lib/graphlib.py库,实现拓扑排序算法([查看提交](https://bugs.python.org/issue17005))<br> 115、在新的 PEG 解析器中支持“-d”调试标志([查看提交](https://github.com/python/cpython/commit/82da2c3eb4d69b55d9e300ab5d9c1d22bd09b9cd))<br> 116、允许通过环境变量PYTHONPLATLIBDIR覆盖sys.platlibdir([查看提交](https://github.com/python/cpython/commit/8f023a2f664f902a3d0b7a6f64d63afc0d1c15ae))<br> 117、当验证True、False、None在 ast.Name节点中使用的自定义 AST 常量时,抛出异常ValueError([查看提交](https://github.com/python/cpython/commit/83a9ba442662c2a030b45955f3dd24ff4b24bb61))<br> 118、IDLE:始终对标准IO流(“stdin”、“stdout”和“stderr”)使用 UTF-8编码(修改前可能是'ascii'等编码)([查看提交](https://github.com/python/cpython/commit/2515a28230b1a011205f30263da6b01c6bd167a3))<br> 119、删除旧的不推荐使用的ElementTree功能([查看提交](https://github.com/python/cpython/commit/f02ea6225bc3b71bd5fe66224d199a6e3e23b14d))<br> 120、弃用C函数PyNode_Compile([查看提交](https://github.com/python/cpython/commit/8ae5e8ec8147e6434454e66953c25848b848711a))<br> 121、修复了statistics模块中标准差和方差函数忽略mu和xbar的问题([查看提交](https://github.com/python/cpython/commit/d71ab4f73887a6e2b380ddbbfe35b600d236fd4a))<br> 122、删除了弃用方法asyncio.Task.current_task和asyncio.Task.all_tasks([查看提交](https://github.com/python/cpython/commit/df59293bf0d815fe37743025d639a63a78e0c771))<br> 123、修复了非ascii文件写入后不关闭直接读取失败报错的问题([查看提交](https://github.com/python/cpython/commit/c916c48afc02c26a50843c7b381a2b567bb72e46))<br> 124、删除了typing.Generic类的__new__方法([查看提交](https://github.com/python/cpython/commit/5a1384935ee8996a5bd240dd29f9b5e356cfc467))<br> 125、修复了pathlib.Path.resolve() 在解析根目录中的相对路径时返回带有双斜杠的路径的问题,这与非根目录中 Path.resolve() 的行为不同,高版本保持行为一致([查看提交](https://github.com/python/cpython/commit/211e4c6e9c1ab60bb2577dda6587fbec79f679b2))<br> 126、当对等方在TLS协商期间关闭连接时,ssl.wrap_socket()将引发ssl.SSLEOFError而不是OSError([查看提交](https://github.com/python/cpython/commit/495bd035662fda29639f9d52bb6baebea31d72fa))<br> 127、将方法 asyncio.AbstractEventLoop.run_in_executor更改为不是async 方法([查看提交](https://github.com/python/cpython/commit/d6bdf6d52f0400df1bd1dce24aaad9514015c755))<br> 128、pdb whatis 命令正确地将实例方法报告为“Method”而不是“Function”。([查看提交](https://github.com/python/cpython/commit/7361451b97a30de0e758094ac83a1fb1f01ed5bb))<br> 129、修复Enum多重继承问题,现在不允许多重继承Enums([查看提交](https://github.com/python/cpython/commit/3064dbf5df1021e85b507366a7ea448c8895efe7))<br> | 升级变更较大,升级后用户需要基本高版本适配修改代码 | | | | | | | 配置文件 | 新增/变更/删除配置项 | | | | | | | | | ABI差异 | 新增/变更/删除API | 1、libpython3.7m.so.1.0升级为libpython3.9.so.1.0.<br> 2、pyconfig-64.h中删除#define HAVE_BROKEN_NICE 1<br> #define HAVE_GETTIMEOFDAY 1<br> #define HAVE_PUTENV 1<br> #define HAVE_UNSETENV 1<br> #define HAVE_VFORK 1<br> #define TANH_PRESERVES_ZERO_SIGN 1<br> 新增:<br> #define HAVE_COPY_FILE_RANGE 1<br> #define HAVE_EXPLICIT_BZERO 1<br> #define HAVE_GETGRGID_R 1等多个宏定义.<br> 3、asyncio库变更如下:<br>(1)新增\_\_main\_\_.py、exceptions.py、staggered.py、threads.py、trsock.py模块;<br> (2)base_events.py模块新增_interleave_addrinfos方法;BaseEventLoop类新增_check_default_executor、shutdown_default_executor、_do_shutdown、_connect_sock方法;\_\_del\_\_方法新增默认参数_warn=warnings.warn。<br> (3)base_futures.py模块删除InvalidStateError类(继承自concurrent.futures._base.Error,子类中无其他定义),删除Error = concurrent.futures._base.Error、CancelledError = concurrent.futures.CancelledError、TimeoutError = concurrent.futures.TimeoutError。<br> (4)base_subprocess.py模块BaseSubprocessTransport类的\_\_del\_\_方法新增默认参数_warn=warnings.warn。<br> (5)events.py模块删除SendfileNotAvailableError类(继承自RuntimeError类,子类中无其他定义);TimerHandle类删除\_\_ne\_\_方法,新增shutdown_default_executor方法,create_task方法新增参数命名关键字参数name=None,run_in_executor方法去掉了前面的async。<br> (6)futures.py模块删除了CancelledError = base_futures.CancelledError、InvalidStateError = base_futures.InvalidStateError、TimeoutError = base_futures.TimeoutError,新增_convert_future_exc方法;Future类新增\_\_class_getitem\_\_、_make_cancelled_error方法,cancel方法新增默认参数msg=None.<br> (7)locks.py模块删除_ContextManager类;_ContextManagerMixin类中删除\_\_enter\_\_、\_\_exit\_\_、\_\_iter\_\_、\_\_acquire_ctx、\_\_await\_\_方法;<br> (8)proactor_events.py模块新增_set_socket_extra方法;_ProactorBasePipeTransport类的\_\_del\_\_方法新增默认参数_warn=warnings.warn;新增_ProactorDatagramTransport类。<br> (9)runners.py模块run方法的debug参数默认值由False变为None;<br> (10)selector_events.py模块BaseSelectorEventLoop类新增_sock_read_done方法;_sock_recv、_sock_recv_into、_sock_accept方法删除关键字参数registered_fd;_sock_sendall方法删除关键字参数registered_fd, data,新增关键字参数view, pos;_sock_connect_done方法变为_sock_write_done方法,且新增默认参数handle=None;_SelectorTransport类的\_\_del\_\_方法新增默认参数_warn=warnings.warn。<br> (11)sslproto.py模块的_SSLProtocolTransport类的\_\_del\_\_方法新增默认参数_warn=warnings.warn。<br> (12)streams.py模块删除IncompleteReadError、LimitOverrunError类;StreamReaderProtocol类新增_stream_reader、_get_close_waiter。<br> (13)tasks.py模块新增_set_task_name方法,create_task方法新增命名关键字参数name=None;Task类删除current_task、all_tasks方法,\_\_init\_\_方法新增命名关键字参数name=None,新增\_\_class_getitem\_\_、get_coro、get_name、set_name方法,cancel方法新增默认参数msg=None.<br> (14)unix_events.py模块_UnixReadPipeTransport类的\_\_del\_\_方法新增默认参数_warn=warnings.warn;AbstractChildWatcher类新增is_active方法;新增PidfdChildWatcher、MultiLoopChildWatcher类;BaseChildWatcher类删除了_compute_returncode方法,将其定义放在了类外面;<br> (15)windows_events.py模块_OverlappedFuture、_BaseWaitHandleFuture类的cancel方法新增默认参数msg=None;ProactorEventLoop类新增run_forever方法,IocpProactor类新增recvfrom、sendto方法。<br> (16)windows_utils.py模块的PipeHandle类的\_\_del\_\_方法新增默认参数_warn=warnings.warn。<br> 4、collections库变更:<br> (1)collections模块OrderedDict类的\_\_init\_\_方法“*args”参数变为“other=()”;Counter类\_\_init\_\_、update、subtract方法“*args”参数变为“iterable=None”;UserDict类的\_\_init\_\_方法“*args”参数变为“dict=None”;UserString类\_\_rmod\_\_方法的format参数改为template,新增removeprefix、removesuffix方法,encode方法的参数默认值变更,由“encoding=None, errors=None”变为“encoding='utf-8', errors='strict'”; OrderedDict、Counter、UserDict类新增\_\_ior\_\_、\_\_or\_\_、\_\_ror\_\_方法.<br> 5、futures库变更:<br> (1)_base.py模块Executor类submit方法新增关键字参数fn,shutdown方法新增命名关键字参数cancel_futures=False.<br> (2)process.py模块的_SafeQueue类\_\_init\_\_新增关键字参数shutdown_lock、thread_wakeup;删除_add_call_item_to_queue、_queue_management_worker方法,新增_ExecutorManagerThread类;ProcessPoolExecutor类_start_queue_management_thread方法修改为_start_executor_manager_thread方法,submit方法新增关键字参数fn,shutdown方法新增命名关键字参数cancel_futures=False;<br> (3)thread.py模块ThreadPoolExecutor类的submit方法新增关键字参数fn,shutdown方法新增命名关键字参数cancel_futures=False;<br> 6、ctypes库变更:<br> (1)util.py模块新增_is_elf方法.<br> 7、curses库变更:wrapper方法新增关键字参数func.<br> 8、distutils库变更:<br> (1)spawn.py模块删除_nt_quote_args、_spawn_nt、_spawn_posix方法;<br> (2)util.py模块新增get_host_platform方法.<br> 9、email库变更:<br> (1)charset.py模块删除\_\_str\_\_定义.<br> 10、encodings库变更:<br> (1)删除cp65001.py、mac_centeuro.py、unicode_internal.py模块。<br> (2)aliases.py模块aliases字典变量中新增'cp1051' : 'hp_roman8', 'ibm1051' : 'hp_roman8', 'mac_centeuro' : 'mac_latin2','cp65001' : 'utf_8',删除了'tis260' : 'tactis'.<br> (3)raw_unicode_escape.py模块IncrementalDecoder类的父类变为codecs.BufferedIncrementalDecoder,它的decode方法改为_buffer_decode,新增参数errors,并且默认参数final=False变为关键字参数final。<br> (4)unicode_escape.py模块IncrementalDecoder类的父类变为codecs.BufferedIncrementalDecoder,它的decode方法改为_buffer_decode,新增参数errors,并且默认参数final=False变为关键字参数final;StreamReader类新增decode方法定义。<br> 11、html库变更:<br> (1)parser.py模块HTMLParser类删除unescape方法。<br> 12、importlib库变更:<br> (1)新增_common.py、metadata.py模块.<br> (2)_bootstrap.py模块删除_installed_safely类;<br> (3)_bootstrap_external.py模块删除_w_long、_r_long方法,新增_pack_uint32、_unpack_uint32、_unpack_uint16、_path_isabs方法,MAGIC_NUMBER值变更;<br> (4)abc.py模块新增Traversable、TraversableResources类;<br> (5)resources.py模块新增_resolve、files、_path_from_reader方法,删除_ZipImportResourceReader类和_zipimport_get_resource_reader方法; | 接口变更较多,升级后需要适配修改代码 | | | 新增/变更/删除结构体 | | | | | | | | | 命令行/功能 | 新增/变更/删除命令 |1、主包不再提供pyvenv、pyvenv-3.7、python3.7m命令.<br> 2、devel包不再提供python3.7-config命令.<br> 3、二进制命名名字中带有3.7的,统一变更成3.9 | pyvenv命令用于创建python虚拟环境,可以使用"python3 -m venv"或者python3-virtualenv提供的virtualenv命令实现同样的功能。该命令删除影响较小,如果有使用到,需要适配修改代码 | | | 新增/变更/删除命令选项 |1、2to3命令新增选项:-e, --exec-function Modify the grammar so that exec() is a function.<br> 2、pathfix.py命令新增选项:-k -a .<br> 3、python3命令变更如下:<br> (1)python3 -X新增下面选项:<br> -X oldparser: enable the traditional LL(1) parser; also PYTHONOLDPARSER<br> -X pycache_prefix=PATH: enable writing .pyc files to a parallel tree rooted at the given directory instead of to the code tree.<br> (2)python3 -X删除下面选项:-X showalloccount: output the total count of allocated objects for each type when the program finishes. This only works when Python was built with COUNT_ALLOCS defined.<br> (3)新增环境变量:<br> PYTHONPLATLIBDIR : override sys.platlibdir.<br> PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files.<br> | | | | 新增/变更/删除日志输出 | | | | | | | | | SPEC文件 | 新增/变更/删除 编译依赖、安装依赖、依赖的软件版本变更 |1、主包新增安装依赖libffi(低版本也依赖,spec中未写)。<br> 2、devel包新增安装依赖libX11、tk(低版本也依赖,spec中未写)。 | | | | 拆分软件包方式变更 | 无 | | | | | | |
| 差异分析报告 | | | | | :----------- | ----------------------------------------------------- | -------- | ------------------ | | 版本变更原因 | | 变更后版本 |3.9.9 | | 差异分类 | 差异项 | 差异说明 | 影响评估与适配方案 | | 特性变化 | 新增特性/删除特性/变更特性实现 |1、对于浮点数据,优化了floor(), ceil(),trunc()<br> 2、移除sys.getcheckinterval()、sys.setcheckinterval(),使用sys.getswitchinterval()、sys.setswitchinterval()代替<br> 3、优化解码 ASCII字符串,``b"foo".decode()``快了约15%<br> 4、如果sys.argv[0]是通过命令行指定的1个文件名,sys.argv[0]将返回绝对路径<br> 5、venv模块添加--upgrade-deps选项<br> 6、移除mac_centeuro编码<br> 7、pydoc可以解析https链接<br> 8、os.sendfile的out、in参数改名为out_fd、in_fd<br> 9、向subprocess添加umask支持;Popen类的构造方法新增默认参数umask=-1,_execute_child方法新增关键字参数unused_umask<br> 10、弃用_tkinter.TkappType的split()方法<br> 11、更新pow函数的参数,使其有意义,原来pow(x, y, z=None, /),修改为pow(base, exp, mod=None)<br> 12、Lib/http/server.py模块SimpleHTTPRequestHandler的构造函数directory参数允许传入类路径对象<br> 13、ast模块添加__main__函数,可以通过命令行调用ast模块传参数执行<br> 14、ast模块dump函数添加命名关键字参数indent,允许生成一个多行缩进输出<br> 15、http模块添加新的状态码:451,对应宏UNAVAILABLE_FOR_LEGAL_REASONS<br> 16、移除threading.Thread.isAlive()<br> 17、调用 logging.getLogger('root') 时返回根记录器,而以前它返回一个名为 'root' 的非root记录器<br> 18、弃用parser模块<br> 19、当allow_abbrev=False时,停止参数解析-vv<br> 20、添加UDPLITE 支持<br> 21、移除弃用的方法HTMLParser.unescape<br> 22、移除aifc, sunau,wave模块openfp()方法<br> 23、弃用math.factorial()方法<br> 24、移除_dummy_thread和dummy_threading模块<br> 25、pathlib.Path类的rename和replace方法添加返回值<br> 26、弃用xml.etree.ElementTree.Element.copy()方法<br> 27、删除xml.etree.cElementTree模块,删除Element.getchildren()、 Element.getiterator()、ElementTree.getiterator()方法<br> 28、删除plistlib模块在python3.4中弃用的API,包括Data类,"readPlist", "writePlist", "readPlistFromBytes", "writePlistToBytes"方法,_PlistParser、_BinaryPlistParser的构造方法中移除关键字参数use_builtin_types,load和loads方法中移除默认参数use_builtin_types=True<br> 29、subprocess模块的Popen类的构造函数中新增默认参数user=None, group=None, extra_groups=None;_execute_child方法中新增关键字参数gid, gids, uid<br> 30、弃用smtpd.MailmanProxy类,从python3.11开始将会被删除<br> 31、将线程堆栈大小设置为 8 Mb,以便在 android 平台上进行调试。<br> 32、移除PyFPE_START_PROTECT、PyFPE_END_PROTECT<br> 33、对于浮点对象,实现了__floor__和 __ceil__<br> 34、当int + int 和 int - int的结果在python小整数范围内([-5,256]),将不会返回一个新的int对象<br> 35、``os.PathLike``, ``pathlib.Path``类实现``__class_getitem__``<br> 36、asyncio对象(Future, Task, Queue)实现``__class_getitem__``<br> 37、array.array:移除tostring()、fromstring(),他们是tobytes()、frombytes()的别名<br> 38、向json.tool添加--no-ensure-ascii选项以禁用转义非 ascii 字符<br> 39、当所有权重为零时,random.choices() 现在会引发 ValueError。<br> 40、当 unpickling 失败时,抛出异常变更<br> 41、对ast添加-i、--indent (indentation level)、--no-type-comments选项<br> 42、在关闭的 zipfile.ZipExtFile 上调用以下内容时引发 ValueError:read, readable, seek, seekable, tell.<br> 43、functools模块添加TopologicalSorter,实现拓扑图排序<br> 44、添加gc.is_finalized函数以检查对象是否被回收<br> 45、从json.loads中移除encoding选项,它从Python 3.1开始就被弃用<br> 46、移除bz2.BZ2File类构造函数中的默认参数buffering=_sentinel,并且compresslevel参数变成keyword-only参数<br> 47、移除了nntplib.NNTP类xpath()、xgtitle()方法,从Python 3.3开始弃用,现在删除<br> 48、弃用binhex4、hexbin4标准库<br> 49、下面函数被弃用:func:`~binascii.b2a_hqx`, `~binascii.a2b_hqx`、`~binascii.rlecode_hqx`, `~binascii.rledecode_hqx`<br> 50、移除base64.encodestring()、base64.decodestring(),其别名已在python3.1中弃用<br> 51、移除fractions.gcd(),其在py3.5中被弃用;可以使用math.gcd代替<br> 52、smtplib.SMTP构造函数添加默认参数timeout=socket._GLOBAL_DEFAULT_TIMEOUT<br> 53、RefactoringTool添加exec_function选项<br> 54、poplib现在拒绝timeout = 0;如果他们的构造函数中timeout = 0,poplib.POP3、poplib.POP3_SSL将抛出异常ValueError<br> 55、ftplib.FTP/FTP_TLS现在拒绝timeout = 0<br> 56、smtp.SMTP/SMTP_SSL现在拒绝timeout = 0<br> 57、nntplib.NNTP/NNTP_SSL现在拒绝timeout = 0<br> 58、epoll.unregister()不再忽略EBADF错误<br> 59、ast.literal_eval()现在支持通过'set()'创建空的集合对象<br> 60、IMAP4、IMAP4_SSL构造函数新增默认参数timeout=None<br> 61、locale:删除格式化货币的尾随空格<br> 62、pstats.Stats添加get_profile_dict()方法,此方法返回 StatsProfile 的一个实例<br> 63、fcntl, msvcrt, os, resource, shutil, signal,syslog,pty等多个模块添加审计事件( auditing events)功能<br> 64、扩展 math.gcd() 和 math.lcm() 以处理多个参数,兼容以前的版本<br> 65、io.BufferedReader()实例是truncate()将报错UnsupportedOperation,当它调用一个只读的io.BufferedReader()对象的时候<br> 66、distutils库弃用bdist_msi命令,可使用wheel库的bdist_wheel命令替代<br> 67、移除uuid.getnode方法的无用参数getters<br> 68、Executor.shutdown()方法新增默认参数cancel_futures=False<br> 69、asyncio.locks中移除旧风格的上下文管理器,在py3.7中已弃用<br> 70、`inspect.Signature.parameters`、`inspect.BoundArguments.arguments`的类型由OrderedDicts修改成dict<br> 71、ipaddress模块添加对scoped IPv6地址的支持<br> 72、uuid._netstat_getnode()拒绝(跳过)长度17的IPv6地址(ex: 'fe80::5054:ff:fe9')<br> 73、``ast.Suite``, ``ast.Param``, ``ast.AugLoad`` and ``ast.AugStore``被移除<br> 74、添加一个开关,以实现当 -E或-I使用时忽略PYTHONCASEOK<br> 75、移除``ast.Suite``<br> 76、http.HTTPStatus类新增``103 EARLY_HINTS``和``425 TOO_EARLY``http状态码<br> 77、http.HTTPStatus类新增``418 IM_A_TEAPOT``http状态码<br> 78、提高 bytes.hex() 的性能。<br> 79、提高range(), list() ,dict()的性能<br> 80、random.sample()放弃对set对象的支持<br> 81、statistics.NormalDist()新增zscore()方法去计算(x - mean) / stdev<br> 82、random.getrandbits()方法现在接受输入0<br> 83、添加 random.randbytes() 函数和 random.Random.randbytes()方法以生成随机字节。<br> 84、移除弃用的方法symtable.SymbolTable.has_exec<br> 85、typing.NamedTuple移除属性_field_types<br> 86、从concurrent.futures.ThreadPoolExecutor、concurrent.futures.ProcessPoolExecutor删除了daemon线程<br> 87、time模块添加CLOCK_TAI常量<br> 88、shlex.split()第一个参数s不支持``None``<br> 89、移除Tools/scripts/checkpyc.py<br> 90、`date.isocalendar()`返回值类型变更,原先返回一个简单的元组(year, week, weekday),现在返回的是一个namedtuple对象([查看提交](https://github.com/python/cpython/commit/1b97b9b0ad9a2ff8eb5c8f2e2e7c2aec1d13a330))<br> 91、uuid模块不再使用ctypes加载libuuid或者rpcrt4.dll`([查看提交](https://github.com/python/cpython/commit/d6b727e2c947240804b8e434b305ba2890122550))<br> 92、对abc模块应用PEP 573([查看提交](https://github.com/python/cpython/commit/77c614624b6bf2145bef69830d0f499d8b55ec0c))<br> 93、改进源代码中无效字符的语法错误,比如错误信息不再包含误导性的“in identifier”([查看提交](https://github.com/python/cpython/commit/74ea6b5a7501fb393cd567fb21998d0bfeeb267c))<br> 94、添加--experimental-isolated-subinterpreters构建选项,使用这个选项时,将强制使用 libc malloc() 内存分配器([查看提交](https://github.com/python/cpython/commit/c5fa364f4ea836f25dd07cfb328152d40a568371))<br> 95、添加对 CAN_J1939 套接字的支持([查看提交](https://github.com/python/cpython/commit/360371f79c48f15bbcee7aeecacf97a899913b25))<br> 96、concurrent.futures模块Process.shutdown(wait=True),当队列不为空且等待时,将关闭队列([查看提交](https://github.com/python/cpython/commit/1a275013d1ecc2e3778d64fda86174b2f13d6969))<br> 97、添加multiprocessing.SimpleQueue.close()方法,用于关闭队列,释放资源([查看提交](https://github.com/python/cpython/commit/9adccc1384568f4d46e37f698cb3e3a4f6ca0252))<br> 98、difflib.SequenceMatched.find_longest_match方法的四个参数新增默认值为0([查看提交](https://github.com/python/cpython/commit/3209cbd99b6d65aa18b3beb124fac9c792b8993d))<br> 99、添加random.randbytes()函数和random.Random.randbytes()函数,用于生成随机字节([查看提交](https://github.com/python/cpython/commit/9f5fe7910f4a1bf5a425837d4915e332b945eb7b))<br> 100、删除nntplib._NNTPBase类,将其内容合并至nntplib.NNTP类([查看提交](https://github.com/python/cpython/commit/aa92a7cf210c98ad94229f282221136d846942db))<br> 101、弃用random.shuffle()方法的random参数([查看提交](https://github.com/python/cpython/commit/190fac99c58232f3e0b34891872b91e50ea2f057))<br> 102、random.sample()添加默认参数counts(counts=None)([查看提交](https://github.com/python/cpython/commit/81a5fc38e81b424869f4710f48e9371dfa2d3b77))<br> 103、重构typing._GenericAlias([查看提交](https://github.com/python/cpython/commit/c1c7d8ead9eb214a6149a43e31a3213c52448877))<br> 104、修复拼写shake128为shake_128([查看提交](https://github.com/python/cpython/commit/62ecd8a8f908282726d2f019c93efa1cf2e9e784))<br> 105、hashlib模块现在可以使用SHA3、SHAKE (OpenSSL 1.1.1+)([查看提交](https://github.com/python/cpython/commit/d5b3f6b7f9fc74438009af63f1de01bd77be9385))<br> 106、添加--without-builtin-hashlib-hashes、--with-builtin-hashlib-hashes=sha3,blake1选项以禁用或有选择地启用内置哈希模块([查看提交](https://github.com/python/cpython/commit/9b60e55db2897acc30d6b9ef1dbc49674eed40c7))<br> 107、将HMAC密钥长度限制为INT_MAX ([查看提交](https://github.com/python/cpython/commit/aca4670ad695d4b01c7880fe3d0af817421945bd))<br> 108、hmac.HMAC类的digest_con、inner、outer属性将被弃用([查看提交](https://github.com/python/cpython/commit/837f9e42e3a1ad03b340661afe85e67d2719334f))<br> 109、公开了OpenSSL的HMAC API([查看提交](https://github.com/python/cpython/commit/54f2898fe7e4ca1f239e96284af3cc5b34d2ae02))<br> 110、修复ast模块_ABC类构造函数中的关键字冲突处理问题,_ABC是Num、Str等多个类的元类([查看提交](https://github.com/python/cpython/commit/c73914a562580ae72048876cb42ed8e76e2c83f9))<br> 111、更新了 PurePath.relative_to() 的错误消息和文档,以更好地反映函数行为。([查看提交](https://github.com/python/cpython/commit/448325369ff73011d34d6c3a493014fe3ead8843))<br> 112、当ast.parse传递的``feature_version``小于``(3, 8)``时,不会解析其中的f-string([查看提交](https://github.com/python/cpython/commit/c116c94ff119485761460f1033cdee425bed0310))<br> 113、弃用symbol模块([查看提交](https://github.com/python/cpython/commit/cf88871d6a9c12e7b7e5f4d65abc2ec6e2fe952e))<br> 114、添加Lib/graphlib.py库,实现拓扑排序算法([查看提交](https://bugs.python.org/issue17005))<br> 115、在新的 PEG 解析器中支持“-d”调试标志([查看提交](https://github.com/python/cpython/commit/82da2c3eb4d69b55d9e300ab5d9c1d22bd09b9cd))<br> 116、允许通过环境变量PYTHONPLATLIBDIR覆盖sys.platlibdir([查看提交](https://github.com/python/cpython/commit/8f023a2f664f902a3d0b7a6f64d63afc0d1c15ae))<br> 117、当验证True、False、None在 ast.Name节点中使用的自定义 AST 常量时,抛出异常ValueError([查看提交](https://github.com/python/cpython/commit/83a9ba442662c2a030b45955f3dd24ff4b24bb61))<br> 118、IDLE:始终对标准IO流(“stdin”、“stdout”和“stderr”)使用 UTF-8编码(修改前可能是'ascii'等编码)([查看提交](https://github.com/python/cpython/commit/2515a28230b1a011205f30263da6b01c6bd167a3))<br> 119、删除旧的不推荐使用的ElementTree功能([查看提交](https://github.com/python/cpython/commit/f02ea6225bc3b71bd5fe66224d199a6e3e23b14d))<br> 120、弃用C函数PyNode_Compile([查看提交](https://github.com/python/cpython/commit/8ae5e8ec8147e6434454e66953c25848b848711a))<br> 121、修复了statistics模块中标准差和方差函数忽略mu和xbar的问题([查看提交](https://github.com/python/cpython/commit/d71ab4f73887a6e2b380ddbbfe35b600d236fd4a))<br> 122、删除了弃用方法asyncio.Task.current_task和asyncio.Task.all_tasks([查看提交](https://github.com/python/cpython/commit/df59293bf0d815fe37743025d639a63a78e0c771))<br> 123、修复了非ascii文件写入后不关闭直接读取失败报错的问题([查看提交](https://github.com/python/cpython/commit/c916c48afc02c26a50843c7b381a2b567bb72e46))<br> 124、删除了typing.Generic类的__new__方法([查看提交](https://github.com/python/cpython/commit/5a1384935ee8996a5bd240dd29f9b5e356cfc467))<br> 125、修复了pathlib.Path.resolve() 在解析根目录中的相对路径时返回带有双斜杠的路径的问题,这与非根目录中 Path.resolve() 的行为不同,高版本保持行为一致([查看提交](https://github.com/python/cpython/commit/211e4c6e9c1ab60bb2577dda6587fbec79f679b2))<br> 126、当对等方在TLS协商期间关闭连接时,ssl.wrap_socket()将引发ssl.SSLEOFError而不是OSError([查看提交](https://github.com/python/cpython/commit/495bd035662fda29639f9d52bb6baebea31d72fa))<br> 127、将方法 asyncio.AbstractEventLoop.run_in_executor更改为不是async 方法([查看提交](https://github.com/python/cpython/commit/d6bdf6d52f0400df1bd1dce24aaad9514015c755))<br> 128、pdb whatis 命令正确地将实例方法报告为“Method”而不是“Function”。([查看提交](https://github.com/python/cpython/commit/7361451b97a30de0e758094ac83a1fb1f01ed5bb))<br> 129、修复Enum多重继承问题,现在不允许多重继承Enums([查看提交](https://github.com/python/cpython/commit/3064dbf5df1021e85b507366a7ea448c8895efe7))<br> | 升级变更较大,升级后用户需要基本高版本适配修改代码 | | | | | | | 配置文件 | 新增/变更/删除配置项 | | | | | | | | | ABI差异 | 新增/变更/删除API | 1、libpython3.7m.so.1.0升级为libpython3.9.so.1.0.<br> 2、pyconfig-64.h中删除#define HAVE_BROKEN_NICE 1<br> #define HAVE_GETTIMEOFDAY 1<br> #define HAVE_PUTENV 1<br> #define HAVE_UNSETENV 1<br> #define HAVE_VFORK 1<br> #define TANH_PRESERVES_ZERO_SIGN 1<br> 新增:<br> #define HAVE_COPY_FILE_RANGE 1<br> #define HAVE_EXPLICIT_BZERO 1<br> #define HAVE_GETGRGID_R 1等多个宏定义.<br> 3、asyncio库变更如下:<br>(1)新增\_\_main\_\_.py、exceptions.py、staggered.py、threads.py、trsock.py模块;<br> (2)base_events.py模块新增_interleave_addrinfos方法;BaseEventLoop类新增_check_default_executor、shutdown_default_executor、_do_shutdown、_connect_sock方法;\_\_del\_\_方法新增默认参数_warn=warnings.warn。<br> (3)base_futures.py模块删除InvalidStateError类(继承自concurrent.futures._base.Error,子类中无其他定义),删除Error = concurrent.futures._base.Error、CancelledError = concurrent.futures.CancelledError、TimeoutError = concurrent.futures.TimeoutError。<br> (4)base_subprocess.py模块BaseSubprocessTransport类的\_\_del\_\_方法新增默认参数_warn=warnings.warn。<br> (5)events.py模块删除SendfileNotAvailableError类(继承自RuntimeError类,子类中无其他定义);TimerHandle类删除\_\_ne\_\_方法,新增shutdown_default_executor方法,create_task方法新增参数命名关键字参数name=None,run_in_executor方法去掉了前面的async。<br> (6)futures.py模块删除了CancelledError = base_futures.CancelledError、InvalidStateError = base_futures.InvalidStateError、TimeoutError = base_futures.TimeoutError,新增_convert_future_exc方法;Future类新增\_\_class_getitem\_\_、_make_cancelled_error方法,cancel方法新增默认参数msg=None.<br> (7)locks.py模块删除_ContextManager类;_ContextManagerMixin类中删除\_\_enter\_\_、\_\_exit\_\_、\_\_iter\_\_、\_\_acquire_ctx、\_\_await\_\_方法;<br> (8)proactor_events.py模块新增_set_socket_extra方法;_ProactorBasePipeTransport类的\_\_del\_\_方法新增默认参数_warn=warnings.warn;新增_ProactorDatagramTransport类。<br> (9)runners.py模块run方法的debug参数默认值由False变为None;<br> (10)selector_events.py模块BaseSelectorEventLoop类新增_sock_read_done方法;_sock_recv、_sock_recv_into、_sock_accept方法删除关键字参数registered_fd;_sock_sendall方法删除关键字参数registered_fd, data,新增关键字参数view, pos;_sock_connect_done方法变为_sock_write_done方法,且新增默认参数handle=None;_SelectorTransport类的\_\_del\_\_方法新增默认参数_warn=warnings.warn。<br> (11)sslproto.py模块的_SSLProtocolTransport类的\_\_del\_\_方法新增默认参数_warn=warnings.warn。<br> (12)streams.py模块删除IncompleteReadError、LimitOverrunError类;StreamReaderProtocol类新增_stream_reader、_get_close_waiter。<br> (13)tasks.py模块新增_set_task_name方法,create_task方法新增命名关键字参数name=None;Task类删除current_task、all_tasks方法,\_\_init\_\_方法新增命名关键字参数name=None,新增\_\_class_getitem\_\_、get_coro、get_name、set_name方法,cancel方法新增默认参数msg=None.<br> (14)unix_events.py模块_UnixReadPipeTransport类的\_\_del\_\_方法新增默认参数_warn=warnings.warn;AbstractChildWatcher类新增is_active方法;新增PidfdChildWatcher、MultiLoopChildWatcher类;BaseChildWatcher类删除了_compute_returncode方法,将其定义放在了类外面;<br> (15)windows_events.py模块_OverlappedFuture、_BaseWaitHandleFuture类的cancel方法新增默认参数msg=None;ProactorEventLoop类新增run_forever方法,IocpProactor类新增recvfrom、sendto方法。<br> (16)windows_utils.py模块的PipeHandle类的\_\_del\_\_方法新增默认参数_warn=warnings.warn。<br> 4、collections库变更:<br> (1)collections模块OrderedDict类的\_\_init\_\_方法“*args”参数变为“other=()”;Counter类\_\_init\_\_、update、subtract方法“*args”参数变为“iterable=None”;UserDict类的\_\_init\_\_方法“*args”参数变为“dict=None”;UserString类\_\_rmod\_\_方法的format参数改为template,新增removeprefix、removesuffix方法,encode方法的参数默认值变更,由“encoding=None, errors=None”变为“encoding='utf-8', errors='strict'”; OrderedDict、Counter、UserDict类新增\_\_ior\_\_、\_\_or\_\_、\_\_ror\_\_方法.<br> 5、futures库变更:<br> (1)_base.py模块Executor类submit方法新增关键字参数fn,shutdown方法新增命名关键字参数cancel_futures=False.<br> (2)process.py模块的_SafeQueue类\_\_init\_\_新增关键字参数shutdown_lock、thread_wakeup;删除_add_call_item_to_queue、_queue_management_worker方法,新增_ExecutorManagerThread类;ProcessPoolExecutor类_start_queue_management_thread方法修改为_start_executor_manager_thread方法,submit方法新增关键字参数fn,shutdown方法新增命名关键字参数cancel_futures=False;<br> (3)thread.py模块ThreadPoolExecutor类的submit方法新增关键字参数fn,shutdown方法新增命名关键字参数cancel_futures=False;<br> 6、ctypes库变更:<br> (1)util.py模块新增_is_elf方法.<br> 7、curses库变更:wrapper方法新增关键字参数func.<br> 8、distutils库变更:<br> (1)spawn.py模块删除_nt_quote_args、_spawn_nt、_spawn_posix方法;<br> (2)util.py模块新增get_host_platform方法.<br> 9、email库变更:<br> (1)charset.py模块删除\_\_str\_\_定义.<br> 10、encodings库变更:<br> (1)删除cp65001.py、mac_centeuro.py、unicode_internal.py模块。<br> (2)aliases.py模块aliases字典变量中新增'cp1051' : 'hp_roman8', 'ibm1051' : 'hp_roman8', 'mac_centeuro' : 'mac_latin2','cp65001' : 'utf_8',删除了'tis260' : 'tactis'.<br> (3)raw_unicode_escape.py模块IncrementalDecoder类的父类变为codecs.BufferedIncrementalDecoder,它的decode方法改为_buffer_decode,新增参数errors,并且默认参数final=False变为关键字参数final。<br> (4)unicode_escape.py模块IncrementalDecoder类的父类变为codecs.BufferedIncrementalDecoder,它的decode方法改为_buffer_decode,新增参数errors,并且默认参数final=False变为关键字参数final;StreamReader类新增decode方法定义。<br> 11、html库变更:<br> (1)parser.py模块HTMLParser类删除unescape方法。<br> 12、importlib库变更:<br> (1)新增_common.py、metadata.py模块.<br> (2)_bootstrap.py模块删除_installed_safely类;<br> (3)_bootstrap_external.py模块删除_w_long、_r_long方法,新增_pack_uint32、_unpack_uint32、_unpack_uint16、_path_isabs方法,MAGIC_NUMBER值变更;<br> (4)abc.py模块新增Traversable、TraversableResources类;<br> (5)resources.py模块新增_resolve、files、_path_from_reader方法,删除_ZipImportResourceReader类和_zipimport_get_resource_reader方法; | 接口变更较多,升级后需要适配修改代码 | | | 新增/变更/删除结构体 | | | | | | | | | 命令行/功能 | 新增/变更/删除命令 |1、主包不再提供pyvenv、pyvenv-3.7、python3.7m命令.<br> 2、devel包不再提供python3.7-config命令.<br> 3、二进制命名名字中带有3.7的,统一变更成3.9 | pyvenv命令用于创建python虚拟环境,可以使用"python3 -m venv"或者python3-virtualenv提供的virtualenv命令实现同样的功能。该命令删除影响较小,如果有使用到,需要适配修改代码 | | | 新增/变更/删除命令选项 |1、2to3命令新增选项:-e, --exec-function Modify the grammar so that exec() is a function.<br> 2、pathfix.py命令新增选项:-k -a .<br> 3、python3命令变更如下:<br> (1)python3 -X新增下面选项:<br> -X oldparser: enable the traditional LL(1) parser; also PYTHONOLDPARSER<br> -X pycache_prefix=PATH: enable writing .pyc files to a parallel tree rooted at the given directory instead of to the code tree.<br> (2)python3 -X删除下面选项:-X showalloccount: output the total count of allocated objects for each type when the program finishes. This only works when Python was built with COUNT_ALLOCS defined.<br> (3)新增环境变量:<br> PYTHONPLATLIBDIR : override sys.platlibdir.<br> PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files.<br> | | | | 新增/变更/删除日志输出 | | | | | | | | | SPEC文件 | 新增/变更/删除 编译依赖、安装依赖、依赖的软件版本变更 |1、主包新增安装依赖libffi(低版本也依赖,spec中未写)。<br> 2、devel包新增安装依赖libX11、tk(低版本也依赖,spec中未写)。 | | | | 拆分软件包方式变更 | 无 | | | | | | |
评论 (
5
)
登录
后才可以发表评论
状态
已完成
待办的
进行中
已完成
已拒绝
负责人
未设置
桐小哥
tong_1001
负责人
协作者
+负责人
+协作者
标签
sig/Base-service
未设置
项目
未立项任务
未立项任务
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (32)
标签 (64)
master
openEuler-24.03-LTS-SP3
openEuler-22.03-LTS-SP4
openEuler-22.03-LTS-SP3
openEuler-20.03-LTS-SP4
openEuler-24.03-LTS-SP2
openEuler-24.03-LTS-Next
openEuler-24.03-LTS
openEuler-24.03-LTS-SP1
openEuler-25.09
openEuler-22.03-LTS-LoongArch
openEuler-25.03
sync-pr410-master-to-openEuler-25.03
sync-pr411-openEuler-24.03-LTS-Next-to-openEuler-24.03-LTS-SP1
openEuler-22.03-LTS-SP1
openEuler-24.09
openEuler-22.03-LTS-Next
openEuler-22.03-LTS
openEuler-20.03-LTS-SP3
openEuler-22.03-LTS-SP2
openEuler-20.03-LTS-SP1
openEuler-23.09
openEuler-23.03
openEuler-22.09
openEuler-20.03-LTS-SP2
openEuler-20.03-LTS-Next
openEuler-20.03-LTS
openEuler-21.03
openEuler-21.09
openEuler-20.09
openEuler1.0
openEuler1.0-base
openEuler-20.03-LTS-SP4-update-20251024
openEuler-25.09-release
openEuler-24.03-LTS-update-20250926
openEuler-22.03-LTS-SP3-update-20250926
openEuler-22.03-LTS-SP4-update-20250926
openEuler-24.03-LTS-SP1-update-20250926
openEuler-24.03-LTS-SP2-update-20250926
openEuler-22.03-LTS-SP3-update-20250919
openEuler-20.03-LTS-SP4-update-20250919
openEuler-22.03-LTS-SP4-update-20250919
openEuler-24.03-LTS-SP1-update-20250919
openEuler-24.03-LTS-SP2-update-20250919
openEuler-22.03-LTS-SP4-update-20250912
openEuler-24.03-LTS-update-20250912
openEuler-22.03-LTS-SP3-update-20250912
openEuler-24.03-LTS-SP1-update-20250911
openEuler-24.03-LTS-SP2-update-20250905
openEuler-22.03-LTS-SP3-update-20250905
openEuler-22.03-LTS-SP4-update-20250905
openEuler-24.03-LTS-SP1-update-20250905
openEuler-24.03-LTS-SP1-update-20250711
openEuler-24.03-LTS-update-20250711
openEuler-24.03-LTS-SP2-update-20250711
openEuler-24.03-LTS-SP2-release
openEuler-25.03-release
openEuler-24.03-LTS-SP1-update-20250221
openEuler-24.03-LTS-update-20250221
openEuler-22.03-LTS-SP4-update-20250221
openEuler-22.03-LTS-SP3-update-20250221
openEuler-22.03-LTS-SP1-update-20250110
openEuler-22.03-LTS-SP3-update-20250110
openEuler-22.03-LTS-SP4-update-20250110
openEuler-24.03-LTS-SP1-release
openEuler-22.03-LTS-SP1-update-20241129
openEuler-22.03-LTS-SP3-update-20241129
openEuler-22.03-LTS-SP4-update-20241129
openEuler-24.03-LTS-update-20241129
openEuler-22.03-LTS-SP1-update-20241115
openEuler-22.03-LTS-SP3-update-20241115
openEuler-24.03-LTS-update-20241108
openEuler-22.03-LTS-SP4-update-before-20241025
openEuler-22.03-LTS-SP4-before-20241025
openEuler-24.03-LTS-update-before-20241025
openEuler-20.03-LTS-SP4-update-20241101
openEuler-22.03-LTS-SP4-release
openEuler-24.09-release
openEuler-24.03-LTS-release
openEuler-22.03-LTS-SP3-release
openEuler-23.09-rc5
openEuler-22.03-LTS-SP1-release
openEuler-22.09-release
openEuler-22.09-rc5
openEuler-22.09-20220829
openEuler-22.03-LTS-20220331
openEuler-22.03-LTS-round5
openEuler-22.03-LTS-round3
openEuler-22.03-LTS-round2
openEuler-22.03-LTS-round1
openEuler-20.03-LTS-SP3-release
openEuler-20.03-LTS-SP2-20210624
openEuler-21.03-20210330
openEuler-20.09-20200929
openEuler-20.03-LTS-20200606
openEuler-20.03-LTS-tag
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
预计工期
(小时)
参与者(1)
1
https://gitee.com/src-openeuler/python3.git
git@gitee.com:src-openeuler/python3.git
src-openeuler
python3
python3
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册