Mageia Bugzilla – Attachment 7194 Details for
Bug 17077
python-curl new use-after-free issue fixed upstream in 7.19.5.2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
testpy3.py - test script for python 3
testpy3.py (text/x-python), 355 bytes, created by
claire robinson
on 2015-11-10 18:38:23 CET
(
hide
)
Description:
testpy3.py - test script for python 3
Filename:
MIME Type:
Creator:
claire robinson
Created:
2015-11-10 18:38:23 CET
Size:
355 bytes
patch
obsolete
>import pycurl >from io import BytesIO > >buffer = BytesIO() >c = pycurl.Curl() >c.setopt(c.URL, 'http://pycurl.sourceforge.net/') >c.setopt(c.WRITEDATA, buffer) >c.perform() >c.close() > >body = buffer.getvalue() ># Body is a byte string. ># We have to know the encoding in order to print it to a text file ># such as standard output. >print(body.decode('iso-8859-1'))
import pycurl from io import BytesIO buffer = BytesIO() c = pycurl.Curl() c.setopt(c.URL, 'http://pycurl.sourceforge.net/') c.setopt(c.WRITEDATA, buffer) c.perform() c.close() body = buffer.getvalue() # Body is a byte string. # We have to know the encoding in order to print it to a text file # such as standard output. print(body.decode('iso-8859-1'))
View Attachment As Raw
Actions:
View
Attachments on
bug 17077
:
7193
| 7194