Mailinglist Archive: opensuse-buildservice (207 mails)

< Previous Next >
[opensuse-buildservice] Re: [PATCH] Reverting Sascha's unicode attempt. This made 'osc submit' always fail with uncaught exception: Fatal error: Start tag expected, '&lt;' not found at :1.
On Mar 07, 11 18:39:29 +0100, Marcus Hüwe wrote:
Hi,

On 2011-03-07 18:02:50 +0100, OBS osc wrote:
From: Juergen Weigert <jw@xxxxxxx>

---
osc/core.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/osc/core.py b/osc/core.py
index ccc1a06..560a36e 100644
--- a/osc/core.py
+++ b/osc/core.py
@@ -3512,7 +3512,12 @@ def create_submit_request(apiurl,
orev or show_upstream_rev(apiurl, src_project, src_package),
targetxml,
options_block,
- cgi.escape(unicode(message, "utf8")))
+ cgi.escape(message))
+
+ # Don't do cgi.escape(unicode(message, "utf8"))) above.
+ # Promoting the string to utf8, causes the post to explode with:
+ # uncaught exception: Fatal error: Start tag expected, '&lt;' not
found at :1.
+ # I guess, my original workaround was not that bad.

Hmm can you please provide the exact commandline of the failing osc
command? At the moment I fail to see what's wrong with a simple
"cgi.escape(message)" (without the unicode stuff).

I am sitting in a checkout directory of SUSE:Factory:Head collectl
(any package should do) and doing this:

$ osc -d -A https://api.suse.de submitpac --cleanup -m 'testing cgi unucode
encoding'

The following happens, when I have 'cgi.escape(unicode(message, "utf8")))'
in the code. The output after the -------- comes from a print xml.__repr__().


GET https://api.suse.de/source/SUSE:Factory:Head/collectl/_meta
GET
https://api.suse.de/search/request?match=%28state%2F%40name%3D%27new%27+or+state%2F%40name%3D%27review%27%29+and+%28action%2Ft

arget%2F%40project%3D%27SUSE%3AFactory%3AHead%27+or+action%2Fsource%2F%40project%3D%27SUSE%3AFactory%3AHead%27+or+submit%2Ftarget%2F%40project%3D%27SUSE%3AFactory%3AHead%27+or+submit%2Fsource%2F%40project%3D%27SUSE%3AFactory%3AHead%27%29+and+%28action%2Ftarget%2F%40package%3D%27collectl%27+or+action%2Fsource%2F%40package%3D%27collectl%27+or+submit%2Ftarget%2F%40package%3D%27collectl%27+or+submit%2Fsource%2F%40package%3D%27collectl%27%29+and+action%2F%40type%3D%27submit%27
GET
https://api.suse.de/source/home:jnweiger:ldig:branches:SUSE:Factory:Head/collectl?rev=latest
---------------
u'<request type="submit">\n <submit>\n <source
project="home:jnweiger:ldig:branches:SUSE:Factory:Head" package="collectl"
rev="4"/>\n <target project="SUSE:Factory:Head" package="collectl"
/> \n <options><sourceupdate>cleanup</sourceupdate></options> \n
</submit>\n <state name="new"/>\n <description>testing cgi unucode
encoding</description>\n</request>\n'
POST https://api.suse.de/request?cmd=create
Server returned an error: HTTP Error 400: Bad Request
X-Opensuse-Apiversion: 2.1.0
X-Opensuse-Errorcode: unknown
Cache-Control: no-cache
Date: Mon, 07 Mar 2011 17:02:00 GMT
Server: lighttpd/1.5.0
Content-Type: application/xml; charset=utf-8
Connection: close
Content-Length: 193
Via: 1.1 ICS_SERVER (iChain 2.3.419)

<?xml version="1.0" encoding="UTF-8"?>
<status code="unknown">
<summary>uncaught exception: Fatal error: Start tag expected, '&lt;' not
found at :1.</summary>
<details></details>
</status>

uncaught exception: Fatal error: Start tag expected, '&lt;' not found at :1.

This was behind an ssh connection on a SLE11SP1 machine, where my login session
apparently
lives in latin1 world. Not sure if it works with a better environment.

cheers,
JW-

--
o \ Juergen Weigert paint it green! __/ _=======.=======_
<V> | jw@xxxxxxx back to ascii! __/ _---|____________\/
\ | 0911 74053-508 __/ (____/ /\
(/) | _____________________________/ _/ \_ vim:set sw=2 wm=8
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)

SuSE. Supporting Linux since 1992.
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References