[Buildbot] #3346: web change_hook::base NOT accept unicode parameters
Buildbot trac
trac at buildbot.net
Tue Sep 1 04:37:41 UTC 2015
#3346: web change_hook::base NOT accept unicode parameters
--------------------+------------------------
Reporter: evgeniy | Owner:
Type: defect | Status: new
Priority: major | Milestone: undecided
Version: 0.8.12 | Resolution:
Keywords: |
--------------------+------------------------
Description changed by sa2ajj:
Old description:
> In master.cfg I have these lines:
>
> {{{
> c['status'].append(html.WebStatus(http_port=8017,allowForce=True,
> change_hook_dialects = {
> 'base': True
> }
> ))
> }}}
>
> to trigger build I try such code:
> {{{
> ./post_build_request.py -v --repository 'repo_url' --project 'repo'
> --category release -w evgeniy -R
> e8a628fefe4a28594543ed5b4d0dd78af8d54013 -c 'Коментарий' -b master -H
> localhost:8017 -u /change_hook/base
> }}}
>
> And I got such errors in twistd.log:
> > sqlalchemy.exc.ProgrammingError: (ProgrammingError)
> > You must not use 8-bit bytestrings unless you use a
> > text_factory that can interpret 8-bit bytestrings
> > (like text_factory = str). It is highly recommended
> > that you instead just switch your application to
> > Unicode strings. u'INSERT INTO changes (author,
> > comments, is_dir, branch, revision, revlink,
> > when_timestamp, category, repository, codebase,
> > project)
>
> I fixed it with such change in source code:
>
> {{{
> diff --git a/master/buildbot/www/hooks/base.py
> b/master/buildbot/www/hooks/base.py
> index f4b18d0..dfc6b6e 100644
> --- a/master/buildbot/www/hooks/base.py
> +++ b/master/buildbot/www/hooks/base.py
> @@ -62,7 +62,7 @@ def getChanges(request, options=None):
> author = firstOrNothing(args.get('author'))
> if not author:
> author = firstOrNothing(args.get('who'))
> - comments = firstOrNothing(args.get('comments'))
> + comments = firstOrNothing(args.get('comments')).decode('utf-8')
> isdir = firstOrNothing(args.get('isdir', 0))
> branch = firstOrNothing(args.get('branch'))
> category = firstOrNothing(args.get('category'))
> }}}
New description:
In master.cfg I have these lines:
{{{
c['status'].append(html.WebStatus(http_port=8017,allowForce=True,
change_hook_dialects = {
'base': True
}
))
}}}
to trigger build I try such code:
{{{
./post_build_request.py -v --repository 'repo_url' --project 'repo'
--category release -w evgeniy -R
e8a628fefe4a28594543ed5b4d0dd78af8d54013 -c 'Коментарий' -b master -H
localhost:8017 -u /change_hook/base
}}}
And I got such errors in twistd.log:
> sqlalchemy.exc.!ProgrammingError: (!ProgrammingError)
> You must not use 8-bit bytestrings unless you use a
> text_factory that can interpret 8-bit bytestrings
> (like text_factory = str). It is highly recommended
> that you instead just switch your application to
> Unicode strings. u'INSERT INTO changes (author,
> comments, is_dir, branch, revision, revlink,
> when_timestamp, category, repository, codebase,
> project)
I fixed it with such change in source code:
{{{
diff --git a/master/buildbot/www/hooks/base.py
b/master/buildbot/www/hooks/base.py
index f4b18d0..dfc6b6e 100644
--- a/master/buildbot/www/hooks/base.py
+++ b/master/buildbot/www/hooks/base.py
@@ -62,7 +62,7 @@ def getChanges(request, options=None):
author = firstOrNothing(args.get('author'))
if not author:
author = firstOrNothing(args.get('who'))
- comments = firstOrNothing(args.get('comments'))
+ comments = firstOrNothing(args.get('comments')).decode('utf-8')
isdir = firstOrNothing(args.get('isdir', 0))
branch = firstOrNothing(args.get('branch'))
category = firstOrNothing(args.get('category'))
}}}
--
--
Ticket URL: <http://trac.buildbot.net/ticket/3346#comment:4>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation
More information about the bugs
mailing list