view setup.cfg @ 8457:c91f5f36fb2b stable

api: fix 'kallithea-api --save-config' Commit eca0cb56a822 attempted to fix a type inconsistency, which caused failure in the 'kallithea-api' tool when using '--save-config', but this unfortunately did not fix the problem completely. Following error still appeared: Traceback (most recent call last): File ".../bin/kallithea-api", line 33, in <module> sys.exit(load_entry_point('Kallithea', 'console_scripts', 'kallithea-api')()) File ".../bin/kallithea_api.py", line 84, in main 'apihost': args.apihost}) File ".../bin/base.py", line 104, in __init__ self.make_config(config) File ".../bin/base.py", line 132, in make_config ext_json.dump(config, f, indent=4) File "/usr/lib/python3.7/json/__init__.py", line 180, in dump fp.write(chunk) TypeError: a bytes-like object is required, not 'str' The json module documentation says: https://docs.python.org/3.7/library/json.html#basic-usage "The json module always produces str objects, not bytes objects. Therefore, fp.write() must support str input." Therefore, instead of opening the file in binary mode and writing bytes, open it in text mode and write strings. For symmetry reasons, we make the same change when _loading_ the config file, but this code worked regardless.
author Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
date Thu, 10 Sep 2020 20:17:18 +0200
parents 0a2d85671b59
children 278cc5936ed5
line wrap: on
line source

[egg_info]
tag_build =
tag_svn_revision = 0
tag_date = 0

[aliases]
test = pytest

[compile_catalog]
domain = kallithea
directory = kallithea/i18n
statistics = true

[extract_messages]
add_comments = TRANSLATORS:
output_file = kallithea/i18n/kallithea.pot
msgid-bugs-address = translations@kallithea-scm.org
copyright-holder = Various authors, licensing as GPLv3

[init_catalog]
domain = kallithea
input_file = kallithea/i18n/kallithea.pot
output_dir = kallithea/i18n

[update_catalog]
domain = kallithea
input_file = kallithea/i18n/kallithea.pot
output_dir = kallithea/i18n
previous = true

[build_sphinx]
source-dir = docs/
build-dir = docs/_build
all_files = 1

[upload_sphinx]
upload-dir = docs/_build/html