mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-25 00:12:08 +08:00
Fix postgresql metadata setting on python 3
This commit is contained in:
@@ -1953,17 +1953,14 @@ class PostgresqlArchive(CompressedArchive):
|
||||
if dataset and tarfile.is_tarfile(dataset.file_name):
|
||||
with tarfile.open(dataset.file_name, 'r') as temptar:
|
||||
pg_version_file = temptar.extractfile('postgresql/db/PG_VERSION')
|
||||
dataset.metadata.version = pg_version_file.read().strip()
|
||||
dataset.metadata.version = util.unicodify(pg_version_file.read()).strip()
|
||||
except Exception as e:
|
||||
log.warning('%s, set_meta Exception: %s', self, e)
|
||||
log.warning('%s, set_meta Exception: %s', self, util.unicodify(e))
|
||||
|
||||
def sniff(self, filename):
|
||||
if filename and tarfile.is_tarfile(filename):
|
||||
try:
|
||||
with tarfile.open(filename, 'r') as temptar:
|
||||
return 'postgresql/db/PG_VERSION' in temptar.getnames()
|
||||
except Exception as e:
|
||||
log.warning('%s, sniff Exception: %s', self, e)
|
||||
with tarfile.open(filename, 'r') as temptar:
|
||||
return 'postgresql/db/PG_VERSION' in temptar.getnames()
|
||||
return False
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
|
||||
Reference in New Issue
Block a user