http://hg.code.sf.net:8000/p/roundup/code/atom-log/tip/roundup/scripts/roundup_xmlrpc_server.py Mercurial Repository: p/roundup/code: roundup/scripts/roundup_xmlrpc_server.py history 2026-04-08T21:39:40-04:00 chore: remove __future print_funcion from code. http://hg.code.sf.net:8000/p/roundup/code/#changeset-9c3ec0a5c7fc88acb8a65632ecc13b2d52380314 John Rouillard rouilj@ieee.org 2026-04-08T21:39:40-04:00 2026-04-08T21:39:40-04:00
changeset 9c3ec0a5c7fc
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description chore: remove __future print_funcion from code.

Not needed as of Python 3.
files
feat: improve store_trace_reason with extract parameter http://hg.code.sf.net:8000/p/roundup/code/#changeset-f80c566f5726c55c8654ec24a9f73a138b2c8a6f John Rouillard rouilj@ieee.org 2026-04-06T22:10:23-04:00 2026-04-06T22:10:23-04:00
changeset f80c566f5726
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description feat: improve store_trace_reason with extract parameter

store_trace_reason() used embedded code to extract reason based on the
location passed to the function.

This change adds support for extract keyword that is a Python
expression eval'ed when the underlying function/method is called. All
callers now set the extract parameter. The prior embedded code has
been removed from store_trace_reason().

Failure to eval the expression results in an roundup.logcontext error
severity log. Also updated docs.

Also replaced env['REQUEST_URI'] with env['PATH_INFO'] for web based
entry points as REQUEST_URI isn't documented as a required key and
some other front end (e.g. zope, cgi) might not supply this.
files
fix: replace except: with except Exception: (by haosenwang1018@github) http://hg.code.sf.net:8000/p/roundup/code/#changeset-fed0f839c26062bca99304a0198a17cf21554915 John Rouillard rouilj@ieee.org 2026-02-26T09:46:02-05:00 2026-02-26T09:46:02-05:00
changeset fed0f839c260
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix: replace except: with except Exception: (by haosenwang1018@github)

Remove bare 'except:' statements replace with 'except Exception'.

In roundup_xmlrpc_server.py I changed Exception to BaseException so
the database gets closed on signals as well. The rest of the changes
do not look like they affect data integrity and are commited as
supplied.
files
feature: add thread local trace_id and trace_reason to logging. http://hg.code.sf.net:8000/p/roundup/code/#changeset-14c7c07b32d846e405260147a3112e8c8b15642a John Rouillard rouilj@ieee.org 2025-09-16T22:53:00-04:00 2025-09-16T22:53:00-04:00
changeset 14c7c07b32d8
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description feature: add thread local trace_id and trace_reason to logging.

Added trace_id to default logging so that all logs for a given request
share the same trace_id.

This allows correlation of logs across a request.

admin_guide.txt, upgrading.txt:
add docs
update sample configs to include trace_id.
rewrite logging docs in admin_guide. Hopefully they are clearer now.
clean up some stuff in the logging config file docs.

admin.py:

add decorators to run_command to enable trace_id.
change calls to db.commit() to use run_command to get trace_id.

configuration.py:

clean up imports.
update docstrings, comments and inline docs.
add trace_id to default log format.
add function for testing decorated with trace_id.
add support for dumping stack trace in logging.
add check for pytest in sys.modules to enable log propagation when
pytest is running. Otherwise tests fail as the caplog logger doesn't
see the roundup logs.

logcontext.py:

new file to handle thread local contextvar mangement.

mailgw.py:

add decorators for trace_id etc.

scripts/roundup_xlmrpc_server.py:

add decorators for trace_id etc.
fix encoding bug turning bytes into a string.
fix command line issue where we can't set encoding. (not sure if
changing encoding via command line even works)

cgi/client.py

decorate two entry points for trace_id etc.

cgi/wsgi_handler.py:

decorate entry point for trace_id etc.

test/test_config.py:

add test for trace_id in new log format.
test various cases for sinfo and errors in formating msg.
files
Replace depricated base64.decodestring with base64.b64decode. http://hg.code.sf.net:8000/p/roundup/code/#changeset-bc2b00afa9808f7dde241f983614861f0cf281fb John Rouillard rouilj@ieee.org 2020-12-14T09:52:58-05:00 2020-12-14T09:52:58-05:00
changeset bc2b00afa980
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Replace depricated base64.decodestring with base64.b64decode.
files
flake8 fixes. http://hg.code.sf.net:8000/p/roundup/code/#changeset-937fff530ccdd2fd13f7fe83db72b178356684d0 John Rouillard rouilj@ieee.org 2020-01-07T21:38:28-05:00 2020-01-07T21:38:28-05:00
changeset 937fff530ccd
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description flake8 fixes.
files
Python 3 preparation: update xmlrpclib / SimpleXMLRPCServer imports. http://hg.code.sf.net:8000/p/roundup/code/#changeset-e46ce04d5bbcecc7b7dfc3f057118a8f7e33576c Joseph Myers jsm@polyomino.org.uk 2018-07-25T00:16:00+00:00 2018-07-25T00:16:00+00:00
changeset e46ce04d5bbc
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: update xmlrpclib / SimpleXMLRPCServer imports.

New roundup/anypy/xmlrpc_.py added. Manual patch.
files
Python 3 preparation: update urllib / urllib2 / urlparse imports. http://hg.code.sf.net:8000/p/roundup/code/#changeset-88dbacd11cd104e041ebecf9fe2285b1b2021df8 Joseph Myers jsm@polyomino.org.uk 2018-07-24T23:48:30+00:00 2018-07-24T23:48:30+00:00
changeset 88dbacd11cd1
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: update urllib / urllib2 / urlparse imports.

The existing roundup/anypy/urllib_.py is extended to cover more
imports and used in more places. Manual patch.
files
Python 3 preparation: "raise" syntax. http://hg.code.sf.net:8000/p/roundup/code/#changeset-35ea9b1efc1494f29fb07690e7087686de58e0f3 Joseph Myers jsm@polyomino.org.uk 2018-07-24T21:39:58+00:00 2018-07-24T21:39:58+00:00
changeset 35ea9b1efc14
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: "raise" syntax.

Changing "raise Exception, value" to "raise Exception(value)".
Tool-assisted patch. Particular cases to check carefully are the one
place in frontends/ZRoundup/ZRoundup.py where a string exception
needed to be fixed, and the one in roundup/cgi/client.py involving
raising an exception with a traceback (requires three-argument form of
raise in Python 2, which as I understand it requires exec() to avoid a
Python 3 syntax error).
files
Python 3 preparation: convert print to a function. http://hg.code.sf.net:8000/p/roundup/code/#changeset-64b05e24dbd889f52bf8f773d3456bd0135baa27 Joseph Myers jsm@polyomino.org.uk 2018-07-24T09:54:52+00:00 2018-07-24T09:54:52+00:00
changeset 64b05e24dbd8
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: convert print to a function.

Tool-assisted patch. It is possible that some "from __future__ import
print_function" are not in fact needed, if a file only uses print()
with a single string as an argument and so would work fine in Python 2
without that import.
files
Use Python-3-compatible 'as' syntax for except statements http://hg.code.sf.net:8000/p/roundup/code/#changeset-198b6e810c67c4e7e38f1aa41edbc864783fe6e6 Eric S. Raymond esr@thyrsus.com 2017-08-24T22:21:37-04:00 2017-08-24T22:21:37-04:00
changeset 198b6e810c67
branch
bookmark
tag
user Eric S. Raymond <esr@thyrsus.com>
description Use Python-3-compatible 'as' syntax for except statements

Many raise statements near these are also fixed.
So are two ivorrect file encoding marks ('utf8'->'utf-8').
files
Run scripts (roundup_admin.py, ...) directly from checkout. http://hg.code.sf.net:8000/p/roundup/code/#changeset-86ef4ab17dc5126e90162938593f25f94e2d55ca anatoly techtonik techtonik@gmail.com 2013-02-21T20:49:45+03:00 2013-02-21T20:49:45+03:00
changeset 86ef4ab17dc5
branch
bookmark
tag
user anatoly techtonik <techtonik@gmail.com>
description Run scripts (roundup_admin.py, ...) directly from checkout.

Convenient when you don't want to install Roundup, but want
to run latest version.
files
Adjust usage string to previous interface changes. http://hg.code.sf.net:8000/p/roundup/code/#changeset-a728d421a65aadb5c4b56fc5f433664ea8c00be6 Stefan Seefeld stefan@seefeld.name 2009-03-10T03:26:04+00:00 2009-03-10T03:26:04+00:00
changeset a728d421a65a
branch
bookmark
tag
user Stefan Seefeld <stefan@seefeld.name>
description Adjust usage string to previous interface changes.
files
XMLRPC improvements: http://hg.code.sf.net:8000/p/roundup/code/#changeset-bbab97f8ffb2f6e94262615a068f7878d9e572c0 Stefan Seefeld stefan@seefeld.name 2009-02-27T17:46:47+00:00 2009-02-27T17:46:47+00:00
changeset bbab97f8ffb2
branch
bookmark
tag
user Stefan Seefeld <stefan@seefeld.name>
description XMLRPC improvements:

* Add support for actions to XMLRPC interface.
* Provide bridge so user actions may be executed
either via CGI or XMLRPC.
* Adjust XMLRPC tests to recent work.
* Cleanup.
files
* Refactor XMLRPC interface. http://hg.code.sf.net:8000/p/roundup/code/#changeset-edf526c9141291a6ae203226678afbf35f56f1cb Stefan Seefeld stefan@seefeld.name 2009-02-25T18:17:39+00:00 2009-02-25T18:17:39+00:00
changeset edf526c91412
branch
bookmark
tag
user Stefan Seefeld <stefan@seefeld.name>
description * Refactor XMLRPC interface.
* Make it accessible through web-server.
files
Varia http://hg.code.sf.net:8000/p/roundup/code/#changeset-cf6c45201980db1a90cb86c4d2f9f1becd06800b Stefan Seefeld stefan@seefeld.name 2007-04-03T16:52:51+00:00 2007-04-03T16:52:51+00:00
changeset cf6c45201980
branch
bookmark
tag
user Stefan Seefeld <stefan@seefeld.name>
description Varia
files
Initial checkin for new xmlrpc frontend. http://hg.code.sf.net:8000/p/roundup/code/#changeset-ba6ba8d6bcc1fec38e3d3bd7c9784b03563c26e2 Stefan Seefeld stefan@seefeld.name 2007-03-22T02:07:44+00:00 2007-03-22T02:07:44+00:00
changeset ba6ba8d6bcc1
branch
bookmark
tag
user Stefan Seefeld <stefan@seefeld.name>
description Initial checkin for new xmlrpc frontend.
files