Re: zope-tests - FAILED: 5, OK: 12

Marius Gedminas <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <20130916143803.GA31084@platonas>
On Mon, Sep 16, 2013 at 01:50:32PM +0300, Marius Gedminas wrote:
> On Mon, Sep 16, 2013 at 01:00:01AM +0200, Zope tests summarizer wrote:
> > [5]    winbot / zope.testbrowser_py_265_32
> 
> Interesting new error:
...
> At first I suspected Windows line endings, but look closer:
> 
>     - Content-type: text/csv
>     + Content-type: application/octet-stream

    rdesktop winbot.zope.org
    "Git Bash"
    $ /c/python26_32/python
    >>> import mimetypes
    >>> mimetypes.guess_type('x.csv')
    (None, None)

So that's fun.

The test in question does

    >>> browser.getControl(name='foo').add_file(
    ...     b'blah blah blah', 'text/csv', 'x.csv')

and then we get to the implementation of .add_file(), which has this
nice little XXX comment

         # XXX: webtest relies on mimetypes.guess_type to get mime type of
         # upload file and doesn't let to set it explicitly, so we are ignoring
         # content_type parameter here. If it is still unacceptable, consider
         # using mock.object to force mimetypes to return "right" type.
         self._form[self.name] = webtest.forms.Upload(filename or '', contents)

and then ignores the content_type argument.

First of all, monkey-patch?  Instead of fixing the problem upstream?
Seriously?

Therefore https://github.com/Pylons/webtest/issues/86

Marius Gedminas
-- 
http://pov.lt/ -- Zope 3/BlueBream consulting and development

_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
signature.asc (application/pgp-signature, 190 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iD8DBQFSNxfLkVdEXeem148RAt5tAJ49I9sRoqcZTpf7uK4ZXmOyRl7ZCwCgiTS5
lcEfGS1cXWrecMlvjwq959g=
=o7zs
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.