在官方网站已经提交相关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. JVM虚拟机(一):类加载机制

    类加载的时机   类加载的生命周期为: 加载.验证.准备.解析.初始化.使用.卸载七个阶段,其中验证.准备.解析三个阶段统称为连接.其中加载与连接时交叉执行的. 类必须初始化的六种情况 遇到new.g ...

  2. selenium 浏览器的操作

    一.浏览器的最大化 #coding=utf-8 from selneium import wbedriver driver = wbedriver.Firefox() #将webdriver 的Fir ...

  3. 死磕以太坊源码分析之Ethash共识算法

    死磕以太坊源码分析之Ethash共识算法 代码分支:https://github.com/ethereum/go-ethereum/tree/v1.9.9 引言 目前以太坊中有两个共识算法的实现:cl ...

  4. vue第四单元(初识vue-在页面中直接引入vue框架-学习使用vue语法-vue的指令-介绍data用法-methods用法)

    第四单元(初识vue-在页面中直接引入vue框架-学习使用vue语法-vue的指令-介绍data用法-methods用法) #课程目标 了解 vue 框架的特点 掌握创建 vue 实例 掌握 data ...

  5. PHP MySQL 快速导入10万条数据

    项目背景 数据来源:所有数据均为外部导入,最大数据量在10w+ 输出数据:导出经过业务处理之后的数据 使用框架:fastadmin 涉及的问题: 1.数据读取 2.数据保存 使用数据:10w+ 解决方 ...

  6. C#数据结构-赫夫曼树

    什么是赫夫曼树? 赫夫曼树(Huffman Tree)是指给定N个权值作为N个叶子结点,构造一棵二叉树,若该树的带权路径长度达到最小.哈夫曼树(也称为最优二叉树)是带权路径长度最短的树,权值较大的结点 ...

  7. 微服务之服务治理_Eureka

    首先需要明确,不管是什么事物需要"治理",那一定是该事物存在一定问题.比如环境治理.那么服务,或者说微服务为什么需要治理?对于服务来说,如果它承担的业务职责简单,那其实治理的必要性 ...

  8. Wordpress Polylang 翻译自定义格式

    WordPress 多语言插件 Polylang 主题函数参考 重要:使用一个函数之前,你必须检查函数是否存在,否则,你的网站可能会在 Polylang 更新之前遇到致命错误(因为 WordPress ...

  9. MyBatis史上最全文章

    老规矩,本篇文章 不做 MyBatis 的 编码讲解 ,只介绍 文章学习的一些优秀文章 重点在于不要循规蹈矩,教程 这样走,你不一定要按他这样走,按自己的方式来,学习效率会更高,网上的教程有很多,今天 ...

  10. SpringBoot从入门到精通教程(五)

    上节,我们讲了 SpringBoot 如何使用MyBatis 今天我们讲讲 Springboot Logo自定义的问题, 我们在启动 SpringBoot 时,控制台会打印 SpringBoot Lo ...