View previous topic :: View next topic |
Author |
Message |
JujuBickoille n00b


Joined: 20 Apr 2010 Posts: 13
|
Posted: Sat Apr 06, 2013 11:03 pm Post subject: pycurl is broken with python3.2 ? |
|
|
Hello,
I'm trying to make a python 3 script with pycurl, but something seem to strange :
with python 2.7.3 :
import pycurl, pprint
from StringIO import StringIO
URL="http://docs.python.org/3.0/library/io.html"
b = StringIO()
c = pycurl.Curl()
c.setopt(pycurl.URL, URL)
c.setopt(pycurl.WRITEFUNCTION, b.write)
c.perform()
print (b.getvalue())
-> it's okay, i got page
with python 3.2.3 :
I need to change StringIO import :
import pycurl, pprint
from io import StringIO
URL="http://docs.python.org/3.0/library/io.html"
b = StringIO()
c = pycurl.Curl()
c.setopt(pycurl.URL, URL)
c.setopt(pycurl.WRITEFUNCTION, b.write)
c.perform()
print (b.getvalue())
I got pycurl error :
pycurl.error: (23, 'Failed writing body (4069 != 4080)')
Maybe you have idea ?
Thanks a lot |
|
Back to top |
|
 |
Navar Guru


Joined: 20 Aug 2012 Posts: 353
|
Posted: Fri May 10, 2013 12:36 am Post subject: |
|
|
emerge --info dev-python/pycurl would give us more to go on.
Quote: |
# ChangeLog for dev-python/pycurl
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/pycurl/ChangeLog,v 1.80 2013/02/06 03:01:47 floppym Exp $
*pycurl-7.19.0-r3 (06 Feb 2013)
06 Feb 2013; Mike Gilbert <xxxxxxxx@gentoo.org>
+files/pycurl-7.19.0-python3.patch, +pycurl-7.19.0-r3.ebuild:
Add support for Python 3. |
Code: |
$ equery g pycurl
* Searching for pycurl ...
* dependency graph for dev-python/pycurl-7.19.0
`-- dev-python/pycurl-7.19.0 amd64
`-- net-misc/curl-7.29.0-r1 (>=net-misc/curl-7.19.0) amd64
`-- dev-lang/python-2.7.3-r3 (=dev-lang/python-2*) amd64
[ dev-python/pycurl-7.19.0 stats: packages (3), max depth (1) ]
* dependency graph for dev-python/pycurl-7.19.0-r1
`-- dev-python/pycurl-7.19.0-r1 amd64
`-- net-misc/curl-7.29.0-r1 (>=net-misc/curl-7.25.0-r1) amd64 [ssl=]
`-- net-libs/gnutls-2.12.23 (>=net-libs/gnutls-2.11.0) amd64
`-- dev-lang/python-2.7.3-r3 (=dev-lang/python-2*) amd64
[ dev-python/pycurl-7.19.0-r1 stats: packages (4), max depth (1) ]
* dependency graph for dev-python/pycurl-7.19.0-r2
`-- dev-python/pycurl-7.19.0-r2 [~amd64 keyword]
`-- net-misc/curl-7.29.0-r1 (>=net-misc/curl-7.25.0-r1) amd64 [ssl=]
`-- net-libs/gnutls-2.12.23 (>=net-libs/gnutls-2.11.0) amd64
`-- dev-lang/python-2.5.4-r5 (dev-lang/python) amd64
`-- dev-lang/python-2.6.8-r1 (dev-lang/python) amd64
`-- dev-lang/python-2.7.3-r3 (dev-lang/python) amd64
`-- dev-python/python-exec-0.3.1 (dev-python/python-exec) amd64 [python_targets_python2_5(-)? python_targets_python2_6(-)? python_targets_python2_7(-)? -python_single_target_python2_5(-) -python_single_target_python2_6(-) -python_single_target_python2_7(-)]
[ dev-python/pycurl-7.19.0-r2 stats: packages (7), max depth (1) ]
* dependency graph for dev-python/pycurl-7.19.0-r3
`-- dev-python/pycurl-7.19.0-r3 [~amd64 keyword]
`-- net-misc/curl-7.29.0-r1 (>=net-misc/curl-7.25.0-r1) amd64 [ssl=]
`-- net-libs/gnutls-2.12.23 (>=net-libs/gnutls-2.11.0) amd64
`-- dev-lang/python-2.5.4-r5 (dev-lang/python) amd64
`-- dev-lang/python-2.6.8-r1 (dev-lang/python) amd64
`-- dev-lang/python-2.7.3-r3 (dev-lang/python) amd64
`-- dev-lang/python-3.1.5-r1 (dev-lang/python) amd64
`-- dev-lang/python-3.2.3-r2 (dev-lang/python) amd64
`-- dev-lang/python-3.3.0 (dev-lang/python)
`-- dev-python/python-exec-0.3.1 (dev-python/python-exec) amd64 [python_targets_python2_5(-)? python_targets_python2_6(-)? python_targets_python2_7(-)? python_targets_python3_1(-)? python_targets_python3_2(-)? python_targets_python3_3(-)? -python_single_target_python2_5(-) -python_single_target_python2_6(-) -python_single_target_python2_7(-) -python_single_target_python3_1(-) -python_single_target_python3_2(-) -python_single_target_python3_3(-)]
|
_________________ Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|