6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00

Release 0.15.2. Fixed DB init script encoding/charset

This commit is contained in:
Pavel Císař 2022-06-13 20:14:47 +02:00
parent 7d0bbb838c
commit bfc92a15fa
4 changed files with 19 additions and 7 deletions

View File

@ -2,6 +2,12 @@
Changelog
#########
Version 0.15.2
==============
* Fix problem with database init script. Now it uses the database charset instead default
UTF8. The UTF8 is used only when database charset is not specified.
Version 0.15.1
==============

View File

@ -23,10 +23,10 @@ copyright = '2022, Pavel Cisar'
author = 'Pavel Císař'
# The short X.Y version
version = '0.15.1'
version = '0.15.2'
# The full version, including alpha/beta/rc tags
release = '0.15.1'
release = '0.15.2'
# -- General configuration ---------------------------------------------------

View File

@ -652,10 +652,16 @@ class Database:
"""
__tracebackhide__ = True
result = run([_vars_['isql'], '-ch', 'UTF8', '-user', self.user,
'-password', self.password, str(self.dsn)],
input=substitute_macros(script, self.subs),
encoding='utf8', capture_output=True)
params = [_vars_['isql'], '-user', self.user, '-password', self.password]
if self.charset != 'NONE':
params.extend(['-ch', self.charset])
io_enc = CHARSET_MAP[self.charset]
else:
params.extend(['-ch', 'utf8'])
io_enc = 'utf8'
params.append(str(self.dsn))
result = run(params, input=substitute_macros(script, self.subs), encoding=io_enc,
capture_output=True)
if result.returncode:
print(f"-- stdout {'-' * 20}")
print(result.stdout)

View File

@ -5,7 +5,7 @@ all-files=True
[metadata]
name = firebird-qa
version = 0.15.1
version = 0.15.2
description = pytest plugin for Firebird QA
long_description = file: README.rst
long_description_content_type = text/x-rst; charset=UTF-8