details: http://www.bx.psu.edu/hg/galaxy/rev/f7336991d0ee changeset: 2364:f7336991d0ee user: Greg Von Kuster greg@bx.psu.edu date: Thu Apr 23 09:20:11 2009 -0400 description: Fix for uploading binary files into a library.
2 file(s) affected in this change:
lib/galaxy/util/__init__.py lib/galaxy/web/controllers/library_dataset.py
diffs (29 lines):
diff -r feb4f5dab9cf -r f7336991d0ee lib/galaxy/util/__init__.py --- a/lib/galaxy/util/__init__.py Wed Apr 22 14:43:54 2009 -0400 +++ b/lib/galaxy/util/__init__.py Thu Apr 23 09:20:11 2009 -0400 @@ -37,9 +37,8 @@ for char in chars: try: char = unicode( char ) - except Exception, e: + except UnicodeDecodeError, e: # Probably binary - log.exception( e ) return False if wchartype.is_asian( char ) or \ wchartype.is_full_width( char ) or \ diff -r feb4f5dab9cf -r f7336991d0ee lib/galaxy/web/controllers/library_dataset.py --- a/lib/galaxy/web/controllers/library_dataset.py Wed Apr 22 14:43:54 2009 -0400 +++ b/lib/galaxy/web/controllers/library_dataset.py Thu Apr 23 09:20:11 2009 -0400 @@ -69,7 +69,10 @@ ext = file_format if not data_type: if self.check_binary( temp_name ): - ext = file_name.split( "." )[1].strip().lower() + try: + ext = name.split( "." )[1].strip().lower() + except: + ext = '' if not( ext == 'ab1' or ext == 'scf' ): raise BadFileException( "you attempted to upload an inappropriate file." ) if ext == 'ab1' and file_format != 'ab1':
galaxy-dev@lists.galaxyproject.org