ValueError: the environment variable is longer than 32767 characters On Windows, an environment variable string ("name=value" string) is limited to 32,767 characters
https://github.com/python/cpython/blob/aa1b8a168d8b8dc1dfc426364b7b664501302958/Lib/test/test_os.py
https://github.com/python/cpython/blob/master/Lib/test/test_os.py#L1122
import os s=''
for i in range(1<<24):
s+="A" os.environ.setdefault("k",s)
os.environ.setdefault("k",s)
File "C:\env\py382\lib\os.py", line 712, in setdefault
self[key] = value
File "C:\env\py382\lib\os.py", line 681, in __setitem__
self.putenv(key, value)
ValueError: the environment variable is longer than 32767 characters
if sys.platform == "win32":
# On Windows, an environment variable string ("name=value" string)
# is limited to 32,767 characters
longstr = 'x' * 32_768
self.assertRaises(ValueError, os.putenv, longstr, "1")
self.assertRaises(ValueError, os.putenv, "X", longstr)
self.assertRaises(ValueError, os.unsetenv, longstr)
ValueError: the environment variable is longer than 32767 characters On Windows, an environment variable string ("name=value" string) is limited to 32,767 characters的更多相关文章
- Python xlwt 模块执行出错Exception: String longer than 32767 characters
使用Python搜集数据时用到xlwt保存到excel文件,但是数据量有点大时出现 Exception: String longer than 32767 characters 搜索类似的问题都是建议 ...
- 异常-----Can't convert the date to string, because it is not known which parts of the date variable are in use. Use ?date, ?time or ?datetime built-in, or ?string.\u003Cformat> or ?string(format) built-
1.错误描述 五月 27, 2014 12:07:05 上午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template proc ...
- Windows Preinstallation Environment
https://en.wikipedia.org/wiki/Windows_Preinstallation_Environment https://zh.wikipedia.org/wiki/Wind ...
- Tomcat问题:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined ,At least one of these environment variable is needed to run this program
一眼就能看出来是jdk的环境有问题,但是用了这么久的jdk一直都配置的好好的,怎么一到Tomcat上就这么矫情了. 最后查解决方案,原来是我的jdk从官网直接下载的,虽然我修改了java_home,但 ...
- 译:Spring框架参考文档之IoC容器(未完成)
6. IoC容器 6.1 Spring IoC容器和bean介绍 这一章节介绍了Spring框架的控制反转(IoC)实现的原理.IoC也被称作依赖注入(DI).It is a process wher ...
- Working with Strings(使用Oracle字符串)
Working with Strings By Steven Feuerstein Part 3 in a series of articles on understanding and using ...
- C# 代码 获取桌面路径
Environment.GetFolderPath(Environment.SpecialFolder.MyComputer); // // 摘要: // 获取由指定枚举标识的系统特殊文件夹的路径. ...
- bzoj1684 [Usaco2005 Oct]Close Encounter
Description Lacking even a fifth grade education, the cows are having trouble with a fraction proble ...
- BZOJ 1684: [Usaco2005 Oct]Close Encounter
题目 1684: [Usaco2005 Oct]Close Encounter Time Limit: 5 Sec Memory Limit: 64 MB Description Lacking e ...
随机推荐
- C# Json对象数组复杂JObject 序列化
tatic void Main(string[] args) { //先反序列化看看 string json = "{\"name\": true,\"age\ ...
- Blogs添加横幅滚动条
#1.定义CSS样式 .box { width: 100%; margin: 0 auto; /* border: 0.2px solid gray; */ overflow: hidden; } . ...
- Python序列(十一)集合
集合试无序可变列表,使用一对大括号界定,元素不可重复,同一个集合中每一个元素的都是唯一的. 集合只能包含数字.字符串.元祖等不可变类型(或者说可哈希)的数据,而不能包含列表.字典.集合等可变类型额数据 ...
- 简析5G时代的MART流处理
在当今数字驱动的世界中,实时处理数据流是业务成功的必要条件. 5G网络的引入增加了对数据量和速要求,而这些要求给传统的数据架构带来了压力.对吸收数据流量的需求空前增长,同时还要通过跨多个数据流,做出智 ...
- idea run dashbord使用
idea 中使用dashbord可以迅速开启多个服务方便进行本地测试 开启步骤 1. 打开idea菜单 view-> toolWindows ->service 选项 2. 打开底部的se ...
- A child container failed during start
先贴一下bug详情 严重: A child container failed during start java.util.concurrent.ExecutionException: org.apa ...
- springMVC搭建分布式框架
https://www.cnblogs.com/lr393993507/p/7652717.html https://www.cnblogs.com/Tpf386/p/10987931.html
- postgre sql递归查询
WITH RECURSIVE r AS (SELECT * FROM [表] WHERE id = xxxunion ALLSELECT [表].* FROM [表], r WHERE [表]. ...
- 讲两个int 数组找出重复的数字 用最少的循环
int a[] = {1,3}; int b[] = {1,3,5}; int size = a.length>b.length ?a.length:b.length; int valueA = ...
- [LeetCode]2. Add Two Numbers链表相加
注意进位的处理和节点为null的处理 public ListNode addTwoNumbers(ListNode l1, ListNode l2) { int flag = 0; ListNode ...