Skip to content

Commit

Permalink
make bottle compatible with python 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Dec 27, 2024
1 parent 4cf89af commit 11d143c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/copr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mv /tmp/kcli.tar.gz $HOME/rpmbuild/SOURCES
export GIT_CUSTOM_VERSION=0.0.git.$(date "+%Y%m%d%H%M").$(git rev-parse --short HEAD)
export GIT_DIR_VCS=git+https://github.com/karmab/kcli#$(git rev-parse HEAD):
envsubst < kcli.spec > $HOME/rpmbuild/SOURCES/kcli.spec
git log -n 200 --format='* %ad %an <%ae> %n- %s' --date=format:"%a %b %d %Y" >> $HOME/rpmbuild/SOURCES/kcli.spec
git log -n 30 --format='* %ad %an <%ae> %n- %s' --date=format:"%a %b %d %Y" >> $HOME/rpmbuild/SOURCES/kcli.spec

rpmbuild -bs $HOME/rpmbuild/SOURCES/kcli.spec
copr-cli build --nowait kcli $HOME/rpmbuild/SRPMS/*src.rpm
7 changes: 6 additions & 1 deletion kvirt/bottle.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,14 @@ def _cli_patch(cli_args): # pragma: no coverage
json_loads = lambda s: json_lds(touni(s))
callable = lambda x: hasattr(x, '__call__')

# KARIM HACK
def isascii(s):
return all(ord(c) < 128 for c in s)

def _wsgi_recode(src):
""" Translate a PEP-3333 latin1-string to utf8+surrogateescape """
if src.isascii():
# if src.isascii():
if isascii(src):
return src
return src.encode('latin1').decode('utf8', 'surrogateescape')

Expand Down

0 comments on commit 11d143c

Please sign in to comment.