1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a6cfe95047eb/
Changeset: a6cfe95047eb
Branch: stable
User: nsoranzo
Date: 2014-08-28 15:09:10
Summary: Fix SQlite datatype sniffing for old sqlite3. Remove unused imports.
Bug fixed: when uploading a gzipped FASTQ file through upload1 tool on a
machine with SQLite 3.3.6, it was detected as 'sqlite' datatype and not
decompressed.
In fact, the sqlite3 command 'pragma schema_version' on any file returns
without error on this SQLite version.
Affected #: 1 file
diff -r 57d1b775b0ca8515fd1fc71cee91e5db41cd9ec1 -r
a6cfe95047eb7e85e3d0aa54e8bcce0ce449c880 lib/galaxy/datatypes/binary.py
--- a/lib/galaxy/datatypes/binary.py
+++ b/lib/galaxy/datatypes/binary.py
@@ -11,10 +11,7 @@
import struct
import subprocess
import tempfile
-import zipfile
-import sqlite3
-from urllib import urlencode, quote_plus
from galaxy import eggs
eggs.require( "bx-python" )
@@ -22,7 +19,6 @@
from galaxy.datatypes.metadata import MetadataElement
from galaxy.datatypes import metadata
-from galaxy.datatypes.sniff import *
import dataproviders
log = logging.getLogger(__name__)
@@ -552,14 +548,12 @@
class SQlite ( Binary ):
file_ext = "sqlite"
- # Connects and runs a query that should work on any real database
- # If the file is not sqlite, an exception will be thrown and the sniffer will return
false
def sniff( self, filename ):
+ # The first 16 bytes of any SQLite3 database file is 'SQLite format 3\0',
and the file is binary. For details
+ # about the format, see
http://www.sqlite.org/fileformat.html
try:
- conn = sqlite3.connect(filename)
- schema_version=conn.cursor().execute("pragma
schema_version").fetchone()
- conn.close()
- if schema_version is not None:
+ header = open(filename).read(16)
+ if binascii.b2a_hex(header) == binascii.hexlify('SQLite format
3\0'):
return True
return False
except:
@@ -586,5 +580,5 @@
return dataproviders.dataset.SQliteDataProvider( dataset_source, **settings )
-Binary.register_sniffable_binary_format("sqlite","sqlite",SQlite)
+Binary.register_sniffable_binary_format("sqlite", "sqlite", SQlite)
Repository URL:
https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from
bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.