在stdout上写入大量数据时的奇怪行为 [英] strange behaviour when writing a large amount of data on stdout

查看:119
本文介绍了在stdout上写入大量数据时的奇怪行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候。


在我的系统上:

Python 2.4.1(#65,2005年3月30日,09:13:57)[MSC v .1310 32位(英特尔)]
win32上的
,Windows XP

我有这个问题:

n = 61409 + 1
data =''x''* n
打印数据




Traceback(最近一次调用最后一次):

文件" xxx",第xxx行,在?

打印数据

IOError:[Errno 12]空间不够

有人可以重现这个bug吗?

我开始认为我的系统搞砸了...


感谢Manlio Perillo

解决方案

Manlio Perillo写道:

问候。

在我的系统上:
Python 2.4.1(#65,2005年3月30日,09:13:57)[MSC v.1310 32 bit(Intel)]
关于win32,Windows XP

我有这个问题:

n = 61409 + 1
data =''x''* n
打印数据

<回溯(最近一次调用最后一次):
文件xxx,行xxx,在?
打印数据
IOError:[Errno 12]没有足够的空间<有人可以重现这个错误吗?




不在这里,但它是一个带有几Mb内存的双向amd64! - ) />
(对于记录,它适用于更大的值,即n = 128000000)

我开始认为我的系统搞砸了......




< troll>

当然它搞砸了,否则它不会是一个真正的Windows盒子! - )

< / troll>


-

bruno desthuilliers

python -c" print''@ ''.join([''。''。join([w [:: - 1] for p in p.split(''。'')])for />
p in''o **** @ xiludom.gro''。split(''''')])"

这段代码在这里工作。


Python2.4(#60,2004年11月30日,11:49:19)[MSC v.1310 32 bit (英特尔)]在win32上


它是Windows XP,Pentium 4,未知数量的RAM。我在

控制台窗口中运行python.exe。它也在IDLE工作。


Jeff


-----开始PGP签名-----

版本:GnuPG v1.4.1(GNU / Linux)

iD8DBQFDhHMuJd01MZaTXX0RArcvAKCfg5BwudQXHtvWTXxj6R 8BBb14eQCeOfN1

RdsnJ9yHOreKL7WBr2qVA2A =

= 0 + zD

-----结束PGP SIGNATURE -----


Manlio Perillo写道:

Python 2.4.1(#65,2005年3月30日,09:13:57)[MSC v.1310 32位(英特尔)]
在Win32上,Windows XP
我有这个问题:

n = 61409 + 1
data =''x''* n打印数据



Traceback(最近一次调用最后一次):
文件xxx,行xxx,在?
打印数据
IOError:[Errno 12 ]没有足够的空间




errno 12是ENOMEM(也就是说,系统没有足够的内存

来完成操作)。


是上面一个完整的解释器会话?如果是的话,为什么你xxx输出

文件名(< stdin>)和行号?


< / F>


Regards.

On my system:
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
on win32, Windows XP

I have this problem:

n = 61409 + 1
data = ''x'' * n print data



Traceback (most recent call last):
File "xxx", line xxx, in ?
print data
IOError: [Errno 12] Not enough space
Can someone reproduce this bug?
I begin to think that my system is messed up...

Thanks Manlio Perillo

解决方案

Manlio Perillo wrote:

Regards.

On my system:
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
on win32, Windows XP

I have this problem:

n = 61409 + 1
data = ''x'' * n
print data



Traceback (most recent call last):
File "xxx", line xxx, in ?
print data
IOError: [Errno 12] Not enough space

Can someone reproduce this bug?



Not here, but it''s a bipro amd64 with a couple Mb of ram !-)
(for the record, it works fine for far greater values, ie n = 128000000)
I begin to think that my system is messed up...



<troll>
OF course it''s messed up, else it wouldn''t be a real Windows box !-)
</troll>

--
bruno desthuilliers
python -c "print ''@''.join([''.''.join([w[::-1] for w in p.split(''.'')]) for
p in ''o****@xiludom.gro''.split(''@'')])"


That code works here.

Python2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32

It''s Windows XP, Pentium 4, unknown amount of RAM. I''m running python.exe in a
console window. It also worked in IDLE.

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDhHMuJd01MZaTXX0RArcvAKCfg5BwudQXHtvWTXxj6R 8BBb14eQCeOfN1
RdsnJ9yHOreKL7WBr2qVA2A=
=0+zD
-----END PGP SIGNATURE-----


Manlio Perillo wrote:

Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
on win32, Windows XP

I have this problem:

n = 61409 + 1
data = ''x'' * n print data



Traceback (most recent call last):
File "xxx", line xxx, in ?
print data
IOError: [Errno 12] Not enough space



errno 12 is ENOMEM (that is, the system did not have enough memory
to finish an operation).

is the above a complete interpreter session? if it is, why did you xxx out
the filename (<stdin>) and line number?

</F>


这篇关于在stdout上写入大量数据时的奇怪行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆