<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CKAN: Ticket #1210: WebOb 1.0.1 behaviour</title>
    <link>http://localhost/ticket/1210</link>
    <description>&lt;p&gt;
&lt;a class="missing wiki"&gt;WebOb?&lt;/a&gt; from v1.0.1 has some interesting new behaviour with reading request data for different Content-Types:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;It seems that looking at request.body mangles request.POST. See fix in ckan cset:e83bad9caa1b
&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;A particular request caused an &lt;a class="missing wiki"&gt;AssertionError?&lt;/a&gt; during looking at request.body, so we need to enclose this in a try/except. I couldn't recreate it in a test unfortunately.
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
Example:
&lt;/p&gt;
&lt;pre class="wiki"&gt;Module ckan.controllers.api:206 in create
&amp;lt;&amp;lt;          log.debug('create: %s' % (context))
               try:
                   request_data = self._get_request_data()
               except ValueError, inst:
                   response.status_int = 400
&amp;gt;&amp;gt;  request_data = self._get_request_data()
Module ckan.lib.base:149 in _get_request_data
&amp;lt;&amp;lt;          cls.log.debug('Retrieving request params: %r' % request.params)
               cls.log.debug('Retrieving request POST: %r' % request.POST)
               cls.log.debug('Retrieving request POST body: %r' % request.body)
               if request.POST:
                   try:
&amp;gt;&amp;gt;  cls.log.debug('Retrieving request POST body: %r' % request.body)
Module paste.registry:137 in __getattr__
&amp;lt;&amp;lt;
           def __getattr__(self, attr):
               return getattr(self._current_obj(), attr)
           def __setattr__(self, attr, value):
&amp;gt;&amp;gt;  return getattr(self._current_obj(), attr)
Module webob.request:470 in _body__get
&amp;lt;&amp;lt;          Return the content of the request body.
               """
               self.make_body_seekable() # we need this to have content_length
               r = self.body_file.read(self.content_length)
               self.body_file.seek(0)
&amp;gt;&amp;gt;  self.make_body_seekable() # we need this to have content_length
Module webob.request:697 in make_body_seekable
&amp;lt;&amp;lt;              self.body_file_raw.seek(0)
               else:
                   self.copy_body()
&amp;gt;&amp;gt;  self.copy_body()
Module webob.request:714 in copy_body
&amp;lt;&amp;lt;                  self.body = self.body_file_raw.read(length)
               elif self.is_body_readable:
                   self.body = self.body_file_raw.read()
                   self._copy_body_tempfile()
               else:
&amp;gt;&amp;gt;  self.body = self.body_file_raw.read()
Module webob.request:1190 in read
&amp;lt;&amp;lt;      def read(self, size=-1):
               body = self._get_body()
               if size &amp;lt; 0:
                   v = body[self.position:]
&amp;gt;&amp;gt;  body = self._get_body()
Module webob.request:1207 in _get_body
&amp;lt;&amp;lt;                  self._body = _encode_multipart(self.vars, self.content_type)
                   else:
                       assert 0, ('Bad content type: %r' % self.content_type)
               return self._body
&amp;gt;&amp;gt;  assert 0, ('Bad content type: %r' % self.content_type)
AssertionError: Bad content type: '; charset=utf-8'
&lt;/pre&gt;</description>
    <language>en-us</language>
    <image>
      <title>CKAN</title>
      <url>http://assets.okfn.org/p/ckan/img/ckan_logo_shortname.png</url>
      <link>http://localhost/ticket/1210</link>
    </image>
    <generator>Trac 0.12.3</generator>
    <item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Wed, 06 Jul 2011 10:51:39 GMT</pubDate>
      <title>summary changed</title>
      <link>http://localhost/ticket/1210#comment:1</link>
      <guid isPermaLink="false">http://localhost/ticket/1210#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;summary&lt;/strong&gt;
                changed from &lt;em&gt;WebOb 1.0.1 behaviour&lt;/em&gt; to &lt;em&gt;POST application/json error handling with newer WebOb&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Wed, 06 Jul 2011 10:53:35 GMT</pubDate>
      <title>priority, description changed</title>
      <link>http://localhost/ticket/1210#comment:2</link>
      <guid isPermaLink="false">http://localhost/ticket/1210#comment:2</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;priority&lt;/strong&gt;
                changed from &lt;em&gt;awaiting triage&lt;/em&gt; to &lt;em&gt;minor&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/1210?action=diff&amp;amp;version=2"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Wed, 06 Jul 2011 17:53:01 GMT</pubDate>
      <title>status changed; resolution set</title>
      <link>http://localhost/ticket/1210#comment:3</link>
      <guid isPermaLink="false">http://localhost/ticket/1210#comment:3</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;fixed&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Fix in ckan for &lt;a class="missing wiki"&gt;AssertionError?&lt;/a&gt; in cset:8f6ba8ef63f3 lined up for CKAN release 1.4.2.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>