strange behaviour of colon within string

khany sharif.khan at gmail.com
Mon Oct 19 09:15:08 EDT 2009


On 19 Oct, 13:44, khany <sharif.k... at gmail.com> 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="http://www.ebay.com/marketplace/search/v1/services">  .... "
>
> 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

OK

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

here is the code

========
  xml = '<?xml version="1.0" encoding="utf-8"?> \
    <findItemsAdvancedRequest xmlns="http://www.ebay.com/marketplace/
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.

HTH



More information about the Python-list mailing list