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的更多相关文章

  1. Python xlwt 模块执行出错Exception: String longer than 32767 characters

    使用Python搜集数据时用到xlwt保存到excel文件,但是数据量有点大时出现 Exception: String longer than 32767 characters 搜索类似的问题都是建议 ...

  2. 异常-----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 ...

  3. Windows Preinstallation Environment

    https://en.wikipedia.org/wiki/Windows_Preinstallation_Environment https://zh.wikipedia.org/wiki/Wind ...

  4. 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,但 ...

  5. 译:Spring框架参考文档之IoC容器(未完成)

    6. IoC容器 6.1 Spring IoC容器和bean介绍 这一章节介绍了Spring框架的控制反转(IoC)实现的原理.IoC也被称作依赖注入(DI).It is a process wher ...

  6. Working with Strings(使用Oracle字符串)

    Working with Strings By Steven Feuerstein  Part 3 in a series of articles on understanding and using ...

  7. C# 代码 获取桌面路径

    Environment.GetFolderPath(Environment.SpecialFolder.MyComputer); // // 摘要: // 获取由指定枚举标识的系统特殊文件夹的路径. ...

  8. bzoj1684 [Usaco2005 Oct]Close Encounter

    Description Lacking even a fifth grade education, the cows are having trouble with a fraction proble ...

  9. BZOJ 1684: [Usaco2005 Oct]Close Encounter

    题目 1684: [Usaco2005 Oct]Close Encounter Time Limit: 5 Sec  Memory Limit: 64 MB Description Lacking e ...

随机推荐

  1. wuter 使用了腾讯云Ubuntu系统,但是没有root权限怎么办?

    友情链接: 手把手教你搭饥荒专用服务器(一)-服务器准备工作 手把手教你搭饥荒专用服务器(二)-环境配置及基本使用 手把手教你搭饥荒专用服务器(三)-MOD及其他高级设置 手把手教你搭饥荒专用服务器( ...

  2. 前端技术VUE 的前世今生从PC 走向移动

    一.Vue的前世 Vue 框架诞生于2014年,他的作者为中国人–尤雨溪(江苏无锡人).Vue用于构建交互式的Web界面的库,是一个构建数据驱动的Web界面渐进式框架,该框架遵循CMD规范,并且提供的 ...

  3. sql模糊查询和根据日期筛选

    <!-- 查询统计列表 -->   >= 小于等于      <=大于等于 将字符类型转换成日期格式进行比较 select * from xy_platformMessage ...

  4. BPF的可移植性和CO-RE (Compile Once – Run Everywhere)

    BPF的可移植性和CO-RE (Compile Once – Run Everywhere) 在上一篇文章中介绍了提高socket性能的几个socket选项,其中给出了几个源于内核源码树中的例子,如果 ...

  5. 8种常被忽视的SQL错误用法,你中招了吗?

    前言 MySQL在近几年仍然保持强劲的数据库流行度增长趋势.越来越多的客户将自己的应用建立在 MySQL 数据库之上,甚至是从 Oracle 迁移到 MySQL上来.但也存在部分客户在使用 MySQL ...

  6. Docker本地镜像仓库搭建Nginx+BusyBox为例

    下载Busybox.Nginx镜像 docker pull busybox docker pull nginx 基于Busybox镜像创建容器,并在容器中做部分变更操作,生成新镜像 添加一些内容 正在 ...

  7. redis加锁的几种实现

    redis加锁的几种实现 2017/09/21 1. redis加锁分类 redis能用的的加锁命令分表是INCR.SETNX.SET 2. 第一种锁命令INCR 这种加锁的思路是, key 不存在, ...

  8. 编写高质量JAVA代码之让接口的职责保持单一

    上述标题读者朋友应该也注意到了是让接口的职责保持单一,而不是实现者单一. 设计模式六大原则之单一原则: 定义 不要存在多于一个导致类变更的原因.**通俗的说,即一个类只负责一项职责. 下面以一个电话模 ...

  9. cmake - 编译

    cmake在编译期间会使用到的命令总结: 1.指定编译器并同时设置编译选项 set(CMAKE_CXX_COMPILER "clang++" ) # 显示指定使用的C++编译器 s ...

  10. [从源码学设计]蚂蚁金服SOFARegistry之服务上线

    [从源码学设计]蚂蚁金服SOFARegistry之服务上线 目录 [从源码学设计]蚂蚁金服SOFARegistry之服务上线 0x00 摘要 0x01 业务领域 1.1 应用场景 1.1.1 服务发布 ...