Message146562
| Author |
vstinner |
| Recipients |
docs@python, flox, pitrou, vstinner |
| Date |
2011年10月28日.14:18:49 |
| SpamBayes Score |
5.0821767e-05 |
| Marked as misclassified |
No |
| Message-id |
<1319811530.69.0.689775391155.issue13286@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年10月28日 14:18:50 | vstinner | set | recipients:
+ vstinner, pitrou, flox, docs@python |
| 2011年10月28日 14:18:50 | vstinner | set | messageid: <1319811530.69.0.689775391155.issue13286@psf.upfronthosting.co.za> |
| 2011年10月28日 14:18:50 | vstinner | link | issue13286 messages |
| 2011年10月28日 14:18:49 | vstinner | create |
|