在官方网站已经提交相关issue,不过目前看好像还没有修复。具体的bug位置为:

http文件夹下的client.py文件,代码位置为:类HTTPMessage下的方法getallmatchingheaders

源代码如下:

    def getallmatchingheaders(self, name):
"""Find all header lines matching a given header name. Look through the list of headers and find all lines matching a given
header name (and their continuation lines). A list of the lines is
returned, without interpretation. If the header does not occur, an
empty list is returned. If the header occurs multiple times, all
occurrences are returned. Case is not important in the header name. """
name = name.lower() + ':'
n = len(name)
lst = []
hit = 0
for line in self.keys():
if line[:n].lower() == name:
hit = 1
elif not line[:1].isspace():
hit = 0
if hit:
lst.append(line)
return lst

 修改后代码如下:

 1     def getallmatchingheaders(self, name):
2 """Find all header lines matching a given header name.
3
4 Look through the list of headers and find all lines matching a given
5 header name (and their continuation lines). A list of the lines is
6 returned, without interpretation. If the header does not occur, an
7 empty list is returned. If the header occurs multiple times, all
8 occurrences are returned. Case is not important in the header name.
9
10 """
11 name = name.lower()
12 n = len(name)
13 lst = []
14 hit = 0
15 for line,value in self.items():
16 if line[:n].lower() == name:
17 hit = 1
18 elif not line[:1].isspace():
19 hit = 0
20 if hit:
21 lst.append(line+':'+value)
22 return lst

Python3.9的http.client.py下的HTTPMessage类中的方法getallmatchingheaders的bug修复建议的更多相关文章

  1. VC++下封装ADO类以及使用方法

    操作系统:windows 7软件环境:visual studio 2008 .Microsoft SQL 2005本次目的:介绍一个已经封装的ADO类,简单说明怎么导入使用 首先声明一下,这个封装的A ...

  2. .Net core 下的ConfigurationManager类正确引用方法

    大家在项目中经常会用到需要引用配置文件的情况,这也是我偶然间遇到的问题,菜鸟一枚,如有需纠正多谢指点. 正题 在不先引用using的情况下直接写 ConfigurationManager.AppSet ...

  3. python client.py

    vi /Library/Frameworks/Python.framework/Versions//http/client.py vi /Library/Frameworks/Python.frame ...

  4. python3 安装scrapy Exception: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 1006, in check_if_exists解决方法

    错误代码: Exception: Traceback (most recent call last): File , in check_if_exists self.satisfied_by = pk ...

  5. Python3实现ICMP远控后门(下)之“Boss”出场

    ICMP后门 前言 第一篇:Python3实现ICMP远控后门(上) 第二篇:Python3实现ICMP远控后门(上)_补充篇 第三篇:Python3实现ICMP远控后门(中)之"嗅探&qu ...

  6. client模式下对应接口加入桥接出错

    client模式下,响应的接口wlan0 加入桥接时出现如下错误: root@root:~# brctl addif br-lan wlan0brctl: bridge br-lan: Operati ...

  7. 一、在windows环境下修改pip镜像源的方法(以python3为例)

    在windows环境下修改pip镜像源的方法(以python3为例) 1.在windows文件管理器中,输入 %APPDATA% 2.会定位到一个新的目录下,在该目录下新建pip文件夹,然后到pip文 ...

  8. httprunner3源码解读(3)client.py

    源码目录结构 ApiResponse 这个类没啥好说的 class ApiResponse(Response): """ 继承了requests模块中的Response类 ...

  9. MAC下 mysql不能插入中文和中文乱码的问题总结

    MAC下 mysql不能插入中文和中文乱码的问题总结 前言 本文中所提到的问题解决方案,都是基于mac环境下的,但其他环境,比如windows应该也适用. 问题描述 本文解决下边两个问题: 往mysq ...

随机推荐

  1. react第五单元(事件系统-原生事件-react中的合成事件-详解事件的冒泡和捕获机制)

    第五单元(事件系统-原生事件-react中的合成事件-详解事件的冒泡和捕获机制) 课程目标 深入理解和掌握事件的冒泡及捕获机制 理解react中的合成事件的本质 在react组件中合理的使用原生事件 ...

  2. Flink开发中的问题

    1. 流与批处理的区别 流处理系统 流处理系统,其节点间数据传输的标准模型是:当一条数据被处理完成后,序列化到缓存中,然后立刻通过网络传输到下一个节点,由下一个节点继续处理. 批处理系统 批处理系统, ...

  3. Spring笔记(9) - IOC实现方式详解

    IOC概念 控制反转(Inversion of Control,IOC),是面向对象编程中的一种设计原则,它建议将不需要的职责移出类,让类专注于核心职责,从而提供松散耦合,提高优化软件程序设计.它把传 ...

  4. 详解Python Google Protocol Buffer

    为什么要使用PB? PB(Protocol Buffer)是 Google 开发的用于结构化数据交换格式,作为腾讯云日志服务标准写入格式.因此用于写入日志数据前,需要将日志原始数据序列化为 PB 数据 ...

  5. RHCE <复习RHSCA>

    什么是shell? shell是你(用户)和Linux(或者更准确的说,是你和Linux内核)之间的接口程序,你在提示符下输入的每个命令都由shell先解释然后传给Linux内核. bash 是大多数 ...

  6. [EF] - Code First处理Clustered Index

    Clustered Index <=>集群索引: http://msdn.microsoft.com/en-us/library/ms177443.aspx 由于其特殊性,使得每个tabl ...

  7. 解决Vue-router 报NavigationDuplicated的三种方法

    控制台会报[NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicate ...

  8. 广告计价方式:CPM,CPC,CPA

    转自知乎链接:https://www.zhihu.com/question/20416888/answer/15076251 1.CPM 收费最科学的办法是按照有多少人看到你的广告来收费.按访问人次收 ...

  9. Tiny6410烧入uboot,linux内核,文件系统

    好久没有玩tiny6410了,今天拿出来试试.之前学习一直是跟着视频学习的.今天自己动手来做一下. 首先我将光盘linux目录下的linux-2.6.38-20150708.tgz  rootfs_r ...

  10. H5-地理定位/本地存储/拖放

    一.地理定位 Geolocation 兼容性:Internet Explorer 9+, Firefox, Chrome, Safari 和 Opera 支持Geolocation(地理定位). 一次 ...