[New-bugs-announce] [issue13286] PEP 3151 breaks backward compatibility: it should be documented
STINNER Victor
report at bugs.python.org
Fri Oct 28 16:18:50 CEST 2011
New submission from STINNER Victor <victor.stinner at haypocalc.com>:
The following example works on Python 2.7 and 3.2, but fails on Python 3.3:
-----------
import errno
import os
try:
os.rmdir("testdir")
except:
pass
os.mkdir("testdir")
try:
try:
os.mkdir("testdir")
except IOError as exc:
# If can't get proper access, then just forget about writing
# the data.
if exc.errno == errno.EACCES:
pass
else:
raise
except OSError as exc:
# Probably another Python process already created the dir.
if exc.errno == errno.EEXIST:
pass
else:
raise
except Exception:
print("PEP 3151 broke backward compatibility on such pattern!")
-----------
I noticed the problem while reading the changeset e4d44c2e8e81.
----------
assignee: docs at python
components: Documentation
messages: 146562
nosy: docs at python, flox, haypo, pitrou
priority: normal
severity: normal
status: open
title: PEP 3151 breaks backward compatibility: it should be documented
versions: Python 3.3
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13286>
_______________________________________
More information about the New-bugs-announce
mailing list