# HG changeset patch # User Marcin Kuzminski # Date 1327727641 -7200 # Node ID 1ce36a5f2305e6276159629aba9648c769a266cf # Parent a1b8bd86c48884c3e45c3312182196e51b4a3d85 backported fix for issue with uploading files from web interface diff -r a1b8bd86c488 -r 1ce36a5f2305 rhodecode/model/scm.py --- a/rhodecode/model/scm.py Tue Jan 24 20:01:09 2012 +0200 +++ b/rhodecode/model/scm.py Sat Jan 28 07:14:01 2012 +0200 @@ -7,7 +7,7 @@ :created_on: Apr 9, 2010 :author: marcink - :copyright: (C) 2009-2011 Marcin Kuzminski + :copyright: (C) 2010-2012 Marcin Kuzminski :license: GPLv3, see COPYING for more details. """ # This program is free software: you can redistribute it and/or modify @@ -26,6 +26,7 @@ import time import traceback import logging +import cStringIO from sqlalchemy.exc import DatabaseError @@ -370,8 +371,12 @@ if isinstance(content, (basestring,)): content = safe_str(content) - elif isinstance(content, file): + elif isinstance(content, (file, cStringIO.OutputType,)): content = content.read() + else: + raise Exception('Content is of unrecognized type %s' % ( + type(content) + )) message = safe_str(message) path = safe_str(f_path)