[New-bugs-announce] [issue23222] open doesn't provide traceback for int argument

Ievgen Aleinikov report at bugs.python.org
Sun Jan 11 13:03:34 CET 2015


New submission from Ievgen Aleinikov:

HI,

I was able to gat such behaviour on python version 3.4.2 and 3.2.3
>>> for i in range(10):
...   f = open(i, "w")
...   f.close()
... 
This will close interactive session without any output.


On python 2 (2.7.9) it's not happening:
>>> for i in range(10):
...  f = open(i, "w")
...  f.close()
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
TypeError: coercing to Unicode: need string or buffer, int found
>>>

And interpreter is not closed.

If run attached 1.py we'll see following:

python2.7 1.py 
Traceback (most recent call last):
  File "1.py", line 2, in <module>
    f = open(i, "w")
TypeError: coercing to Unicode: need string or buffer, int found


python3.4 1.py -> nothing happens (echo $? -> 1)



Kind regards,
Ievgen.

----------
components: IO
files: 1.py
messages: 233844
nosy: slivabox
priority: normal
severity: normal
status: open
title: open doesn't provide traceback for int argument
versions: Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file37676/1.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23222>
_______________________________________


More information about the New-bugs-announce mailing list