strange behaviour of colon within string

khany sharif.khan at
Mon Oct 19 15:15:08 CEST 2009

On 19 Oct, 13:44, khany <sharif.k... at> wrote:
> hello all,
> i am relatively new to python and i am trying to convert a php app i
> have over to it using googleapps.
> anyway here is the problem. i poll ebay API which has in its XML "<?
> xml version="1.0" encoding="utf-8"?><findItemsAdvancedRequest
> xmlns="">  .... "
> however it fails to create the string UNLESS i remove the colon (:) in
> the http section. i tried to substitute it with chr(58) but it errors
> the same without showing why. does anyone know what i am doing wrong?
> is this peculiar to googleapps?
> thanks


first thanks for replying so soon (most other groups out there take

here is the code

  xml = '<?xml version="1.0" encoding="utf-8"?> \
    <findItemsAdvancedRequest xmlns="
search/v1/services"> \
    <categoryId>%(category)i</categoryId> \
    <keywords>%(searchtext)s</keywords> \
    <paginationInput> \
      <pageNumber>%(page)i</pageNumber> \
      <entriesPerPage>10</entriesPerPage> \
    </paginationInput> \
    </findItemsAdvancedRequest>' % \
    {'category':9834, 'searchtext':"bmw", 'page':1}
  print xml

if i run this, the page is blank (even the source) with no errors or
anything. if i remove the colon from the string (after the http) it
prints the string on the browser fine.


More information about the Python-list mailing list