From c8fa6d2148512ff6b4aabb15be2ae3e8dbc6f17c Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Wed, 23 Nov 2011 23:04:33 -0600 Subject: [PATCH] http://groups.google.com/group/web2py/browse_thread/thread/efdb2e4c5f3eda26 --- VERSION | 2 +- gluon/dal.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index cc99b4f2..2217dbc7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.3 (2011-11-23 17:29:51) dev +Version 1.99.3 (2011-11-23 23:04:18) dev diff --git a/gluon/dal.py b/gluon/dal.py index eb53ead3..ab172e0d 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -5591,8 +5591,9 @@ class Field(Expression): dest_file = open(pathfilename, 'wb') try: shutil.copyfileobj(file, dest_file) - finally: - dest_file.close() + except IOError: + raise IOError, 'Unable to store file "%s" because invalid permissions, readonly file system, or filename too long' % pathfilename + dest_file.close() return newfilename def retrieve(self, name, path=None):