whoami7 - Manager
:
/
home
/
creaupfw
/
public_html
/
wp-includes
/
assets
/
Upload File:
files >> /home/creaupfw/public_html/wp-includes/assets/share.tar
doc/pycurl/README.rst 0000644 00000014546 15030136332 0010324 0 ustar 00 PycURL -- A Python Interface To The cURL library ================================================ .. image:: https://github.com/pycurl/pycurl/workflows/CI/badge.svg :target: https://github.com/pycurl/pycurl/actions PycURL is a Python interface to `libcurl`_, the multiprotocol file transfer library. Similarly to the urllib_ Python module, PycURL can be used to fetch objects identified by a URL from a Python program. Beyond simple fetches however PycURL exposes most of the functionality of libcurl, including: - Speed - libcurl is very fast and PycURL, being a thin wrapper above libcurl, is very fast as well. PycURL `was benchmarked`_ to be several times faster than requests_. - Features including multiple protocol support, SSL, authentication and proxy options. PycURL supports most of libcurl's callbacks. - Multi_ and share_ interfaces. - Sockets used for network operations, permitting integration of PycURL into the application's I/O loop (e.g., using Tornado_). .. _was benchmarked: http://stackoverflow.com/questions/15461995/python-requests-vs-pycurl-performance .. _requests: http://python-requests.org/ .. _Multi: https://curl.haxx.se/libcurl/c/libcurl-multi.html .. _share: https://curl.haxx.se/libcurl/c/libcurl-share.html .. _Tornado: http://www.tornadoweb.org/ Requirements ------------ - Python 3.5-3.10. - libcurl 7.19.0 or better. Installation ------------ Download source and binary distributions from `PyPI`_. Binary wheels are now available for 32 and 64 bit Windows versions. Please see `INSTALL.rst`_ for installation instructions. If installing from a Git checkout, please follow instruction in the `Git Checkout`_ section of INSTALL.rst. .. _PyPI: https://pypi.python.org/pypi/pycurl .. _INSTALL.rst: http://pycurl.io/docs/latest/install.html .. _Git Checkout: http://pycurl.io/docs/latest/install.html#git-checkout Documentation ------------- Documentation for the most recent PycURL release is available on `PycURL website <http://pycurl.io/docs/latest/>`_. Documentation for the development version of PycURL is available `here <http://pycurl.io/docs/dev/>`_. To build documentation from source, run ``make docs``. Building documentation requires `Sphinx <http://sphinx-doc.org/>`_ to be installed, as well as pycurl extension module built as docstrings are extracted from it. Built documentation is stored in ``build/doc`` subdirectory. Support ------- For support questions please use `curl-and-python mailing list`_. `Mailing list archives`_ are available for your perusal as well. Although not an official support venue, `Stack Overflow`_ has been popular with some PycURL users. Bugs can be reported `via GitHub`_. Please use GitHub only for bug reports and direct questions to our mailing list instead. .. _curl-and-python mailing list: https://lists.haxx.se/listinfo/curl-and-python .. _Stack Overflow: http://stackoverflow.com/questions/tagged/pycurl .. _Mailing list archives: https://curl.haxx.se/mail/list.cgi?list=curl-and-python .. _via GitHub: https://github.com/pycurl/pycurl/issues Automated Tests --------------- PycURL comes with an automated test suite. To run the tests, execute:: make test The suite depends on packages `pytest`_ and `flask`_, as well as `vsftpd`_. Some tests use vsftpd configured to accept anonymous uploads. These tests are not run by default. As configured, vsftpd will allow reads and writes to anything the user running the tests has read and write access. To run vsftpd tests you must explicitly set PYCURL_VSFTPD_PATH variable like so:: # use vsftpd in PATH export PYCURL_VSFTPD_PATH=vsftpd # specify full path to vsftpd export PYCURL_VSFTPD_PATH=/usr/local/libexec/vsftpd .. _pytest: https://pytest.org/ .. _flask: https://flask.palletsprojects.com/ .. _vsftpd: http://vsftpd.beasts.org/ Test Matrix ----------- The test matrix is a separate framework that runs tests on more esoteric configurations. It supports: - Testing against Python 2.4, which bottle does not support. - Testing against Python compiled without threads, which requires an out of process test server. - Testing against locally compiled libcurl with arbitrary options. To use the test matrix, first start the test server from Python 2.5+ by running:: python -m tests.appmanager Then in a different shell, and preferably in a separate user account, run the test matrix:: # run ftp tests, etc. export PYCURL_VSFTPD_PATH=vsftpd # create a new work directory, preferably not under pycurl tree mkdir testmatrix cd testmatrix # run the matrix specifying absolute path python /path/to/pycurl/tests/matrix.py The test matrix will download, build and install supported Python versions and supported libcurl versions, then run pycurl tests against each combination. To see what the combinations are, look in `tests/matrix.py <tests/matrix.py>`_. Contribute ---------- For smaller changes: #. Fork `the repository`_ on Github. #. Create a branch off **master**. #. Make your changes. #. Write a test which shows that the bug was fixed or that the feature works as expected. #. Send a pull request. #. Check back after 10-15 minutes to see if tests passed on Travis CI. PycURL supports old Python and libcurl releases and their support is tested on Travis. For larger changes: #. Join the `mailing list`_. #. Discuss your proposal on the mailing list. #. When consensus is reached, implement it as described above. Please contribute binary distributions for your system to the `downloads repository`_. License ------- :: Copyright (C) 2001-2008 by Kjetil Jacobsen <kjetilja at gmail.com> Copyright (C) 2001-2008 by Markus F.X.J. Oberhumer <markus at oberhumer.com> Copyright (C) 2013-2022 by Oleg Pudeyev <code at olegp.name> All rights reserved. PycURL is dual licensed under the LGPL and an MIT/X derivative license based on the cURL license. A full copy of the LGPL license is included in the file COPYING-LGPL. A full copy of the MIT/X derivative license is included in the file COPYING-MIT. You can redistribute and/or modify PycURL according to the terms of either license. .. _PycURL: http://pycurl.io/ .. _libcurl: https://curl.haxx.se/libcurl/ .. _urllib: http://docs.python.org/library/urllib.html .. _`the repository`: https://github.com/pycurl/pycurl .. _`mailing list`: https://lists.haxx.se/listinfo/curl-and-python .. _`downloads repository`: https://github.com/pycurl/downloads doc/pycurl/AUTHORS 0000644 00000011762 15030136332 0007702 0 ustar 00 Copyright (C) 2001-2008 by Kjetil Jacobsen <kjetilja at gmail.com> Copyright (C) 2001-2008 by Markus F.X.J. Oberhumer <markus at oberhumer.com> Copyright (C) 2013-2022 by Oleg Pudeyev <code at olegp.name> Please see README, COPYING-LGPL and COPYING-MIT for license information. The following individuals contributed code to PycURL: Aaron Hill <visine19 at hotmail.com> Adam Guthrie <therigu at users.sourceforge.net> Adam Jacob Muller <adam at isprime.com> Akiomi Kamakura <akiomik at gmail.com> Alexandre Pion <pion at afnic.fr> Amir Rossert <amir.rossert at safebreach.com> Amit Mongia <amit_mongia at hotmail.com> Andjelko Horvat <comel at vingd.com> Arshad Khan <khan.m.arshad at gmail.com> Artur Sobierak <asobierak at gmail.com> Ashley Whetter <ashleyw at activestate.com> Barry Warsaw <barry at python.org> Bastian Kleineidam Benjamin Peterson <benjamin at python.org> Bill Collins <bill.collins at hp.com> Bo Anderson <mail at boanderson.me> Casey Miller <camiller at linkedin.com> Chih-Hsuan Yen <yan12125 at gmail.com> Christian Clauss <cclauss at me.com> Christopher Warner <cwarner at kernelcode.com> Clint Clayton <clintclayton at me.com> Conrad Steenberg <conrad at hep.caltech.edu> Daniel Pena Arteaga <dpena at ph.tum.de> Daniel Stenberg <daniel at haxx.se> decitre <decitre at gmail.com> Dima Tisnek <dimaqq at gmail.com> Dmitriy Taychenachev <dmitriy.taychenachev at skypicker.com> Dmitry Ketov <dketov at gmail.com> Dom Sekotill <dom.sekotill at kodo.org.uk> Domenico Andreoli <cavok at libero.it> Dominique <curl-and-python at d242.net> Eneas U de Queiroz <cotequeiroz at gmail.com> Eric S. Raymond <esr at thyrsus.com> Felix Yan <felixonmars at archlinux.org> Francisco Alves <chico at corp.globo.com> Gabi Davar <grizzly.nyo at gmail.com> Gisle Vanem <gvanem at yahoo.no> Gregory Petukhov <lorien at lorien.name> Hasan <aliyevH at hotmail.com> Hugo <hugovk at users.noreply.github.com> Iain R. Learmonth <irl at fsfe.org> ideal <idealities at gmail.com> Jakob Truelsen <jakob at scalgo.com> Jakub Wilk <jwilk at jwilk.net> James Deucker <bitwisecook at users.noreply.github.com> Jan Kryl <jan.kryl at nexenta.com> Jayne <corvine at gmail.com> James Deucker <bitwisecook at users.noreply.github.com> Jean Hominal <jhominal at gmail.com> JiCiT <jason at infinitebubble.com> Jim Patterson Josef Schlehofer <pepe.schlehofer at gmail.com> Jozef Melicher <jozef.melicher at eset.sk> K.S.Sreeram <sreeram at tachyontech.net> Kamil Dudka <kdudka at redhat.com> Kevin Ko <kevin.s.ko at gmail.com> Kevin Schlosser <drschlosser at hotmail.com> Khavish Anshudass Bhundoo <khavishbhundoo at users.noreply.github.com> Kian-Meng Ang <kianmeng at cpan.org> kxrd <onyeabor at riseup.net> Lipin Dmitriy <blackwithwhite666 at gmail.com> Léo El Amri <leo at superlel.me> Marc Labranche <mlabranche at developertown.com> Marcel Brouwers <marcel at marcelbrouwers.nl> Marcelo Jorge Vieira <metal at alucinados.com> Marien Zwart <marienz at users.sourceforge.net> Mark Eichin Markus <nepenthesdev at gmail.com> Martin Muenstermann <mamuema at sourceforge.net> Matt King <matt at gnik.com> Michael C <michael at mchang.name> Michael Cho <michael at michaelcho.dev> Michael Coughlin <michael.w.coughlin at gmail.com> Michael Treanor <26148512+skeptycal at users.noreply.github.com> Michał Górny <mgorny at gentoo.org> Miro Hrončok <miro at hroncok.cz> Nelson Chen <crazysim at gmail.com> Nick Pilon <npilon at oreilly.com> Nicolas Pauss <nicolas.pauss at intersec.com> Oleg Broytman <phd at phdru.name> Oren <orenyomtov at users.noreply.github.com> Orion Poplawski <orion at cora.nwra.com> Oskari Saarenmaa <os at ohmu.fi> Paul Pacheco Pavel Horáček <horacek.pavel at protonmail.com> Pierre Grimaud <grimaud.pierre at gmail.com> René Dudfield <renesd at gmail.com> resokou <resokou at gmail.com> Roland Sommer <rol at ndsommer.de> Romuald Brunet <romuald at gandi.net> Romulo A. Ceccon <romuloceccon at gmail.com> Russell McConnachie <okanaganrusty at mcconnachie.ca> Russell McConnachie <pmcconna at cisco.com> Samuel Dion-Girardeau <samuel.diongirardeau at gmail.com> Samuel Henrique <samueloph at debian.org> Scott Talbert <swt at techie.net> Simon Legner <Simon.Legner at gmail.com> Srinivas <spg349 at nyu.edu> Steve Kowalik <steven at wedontsleep.org> Subin <eourm20 at gmail.com> Tal Einat <tal.einat at socialcodeinc.com> Thomas Hunger <teh at camvine.org> Tino Lange <Tino.Lange at gmx.de> toddrme2178 <toddrme2178 at gmail.com> Tom Pierce <tom.pierce0 at gmail.com> Vesa Jääskeläinen <vesa.jaaskelainen at vaisala.com> Victor Lascurain <bittor at eleka.net> Vincent Philippon <Vincent.Philippon at ubisoft.com> Vitaly Murashev <vitaly.murashev at gmail.com> Vitezslav Cizek <vcizek at suse.com> vmurashev <vitaly.murashev at gmail.com> Wei C <gitsouler at users.noreply.github.com> Whitney Sorenson <wsorenson at gmail.com> Wim Lewis <wiml at users.sourceforge.net> Yiteng Zhang <yiteng.zhang at oracle.com> Yuhui H <eyecat at gmail.com> Yuri Ushakov <yuri.ushakov at gmail.com> Yves Bastide <yves at botify.com> Zdenek Pavlas <zpavlas at redhat.com> ziggy <ziggy at elephant-bird.net> doc/pycurl/INSTALL.rst 0000644 00000027662 15030136333 0010501 0 ustar 00 .. _install: PycURL Installation =================== NOTE: You need Python and libcurl installed on your system to use or build pycurl. Some RPM distributions of curl/libcurl do not include everything necessary to build pycurl, in which case you need to install the developer specific RPM which is usually called curl-dev. Distutils --------- Build and install pycurl with the following commands:: (if necessary, become root) tar -zxvf pycurl-$VER.tar.gz cd pycurl-$VER python setup.py install $VER should be substituted with the pycurl version number, e.g. 7.10.5. Note that the installation script assumes that 'curl-config' can be located in your path setting. If curl-config is installed outside your path or you want to force installation to use a particular version of curl-config, use the '--curl-config' command line option to specify the location of curl-config. Example:: python setup.py install --curl-config=/usr/local/bin/curl-config If libcurl is linked dynamically with pycurl, you may have to alter the LD_LIBRARY_PATH environment variable accordingly. This normally applies only if there is more than one version of libcurl installed, e.g. one in /usr/lib and one in /usr/local/lib. SSL ^^^ PycURL requires that the SSL library that it is built against is the same one libcurl, and therefore PycURL, uses at runtime. PycURL's ``setup.py`` uses ``curl-config`` to attempt to figure out which SSL library libcurl was compiled against, however this does not always work. If PycURL is unable to determine the SSL library in use it will print a warning similar to the following:: src/pycurl.c:137:4: warning: #warning "libcurl was compiled with SSL support, but configure could not determine which " "library was used; thus no SSL crypto locking callbacks will be set, which may " "cause random crashes on SSL requests" [-Wcpp] It will then fail at runtime as follows:: ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other) To fix this, you need to tell ``setup.py`` what SSL backend is used:: python setup.py --with-[openssl|gnutls|nss|mbedtls|wolfssl|sectransp|schannel] install Note: as of PycURL 7.21.5, setup.py accepts ``--with-openssl`` option to indicate that libcurl is built against OpenSSL/LibreSSL/BoringSSL. ``--with-ssl`` is an alias for ``--with-openssl`` and continues to be accepted for backwards compatibility. You can also ask ``setup.py`` to obtain SSL backend information from installed libcurl shared library, as follows: python setup.py --libcurl-dll=libcurl.so An unqualified ``libcurl.so`` would use the system libcurl, or you can specify a full path. easy_install / pip ------------------ :: easy_install pycurl pip install pycurl If you need to specify an alternate curl-config, it can be done via an environment variable:: export PYCURL_CURL_CONFIG=/usr/local/bin/curl-config easy_install pycurl The same applies to the SSL backend, if you need to specify it (see the SSL note above):: export PYCURL_SSL_LIBRARY=[openssl|gnutls|nss|mbedtls|sectransp|schannel] easy_install pycurl pip and cached pycurl package ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you have already installed pycurl and are trying to reinstall it via pip with different SSL options for example, pip may reinstall the package it has previously compiled instead of recompiling pycurl with newly specified options. More details are given in `this Stack Overflow post`_. To force pip to recompile pycurl, run:: # upgrade pip if necessary pip install --upgrade pip # remove current pycurl pip uninstall pycurl # set PYCURL_SSL_LIBRARY export PYCURL_SSL_LIBRARY=nss # recompile and install pycurl pip install --compile pycurl .. _this Stack Overflow post: http://stackoverflow.com/questions/21487278/ssl-error-installing-pycurl-after-ssl-is-set Windows ------- There are currently no official binary Windows packages. You can build PycURL from source or use third-party binary packages. Building From Source ^^^^^^^^^^^^^^^^^^^^ Building PycURL from source is not for the faint of heart due to the multitude of possible dependencies and each of these dependencies having its own directory structure, configuration style, parameters and quirks. Additionally different dependencies have different settings for MSVCRT usage, and an application must have all of its parts agreeing on a single setting. If you decide to build PycURL from source it is advisable to look through the ``winbuild.py`` script - it is used to build the official binaries and contains a wealth of information for compiling PycURL's dependencies on Windows. If you are compiling PycURL from source it is recommended to compile all of its dependencies from source as well. Using precompiled libraries may lead to multiple MSVCRT versions mixed in the resulting PycURL binary, which will not be good. If PycURL is to be linked statically against its dependencies, OpenSSL must be patched to link to the DLL version of MSVCRT. There is a patch for this in ``winbuild`` directory of PycURL source. For a minimum build you will just need libcurl source. Follow its Windows build instructions to build either a static or a DLL version of the library, then configure PycURL as follows to use it:: python setup.py --curl-dir=c:\dev\curl-7.33.0\builds\libcurl-vc-x86-release-dll-ipv6-sspi-spnego-winssl --use-libcurl-dll Note that ``--curl-dir`` must point not to libcurl source but rather to headers and compiled libraries. If libcurl and Python are not linked against the same exact C runtime (version number, static/dll, single-threaded/multi-threaded) you must use ``--avoid-stdio`` option (see below). Additional Windows setup.py options: - ``--use-libcurl-dll``: build against libcurl DLL, if not given PycURL will be built against libcurl statically. - ``--libcurl-lib-name=libcurl_imp.lib``: specify a different name for libcurl import library. The default is ``libcurl.lib`` which is appropriate for static linking and is sometimes the correct choice for dynamic linking as well. The other possibility for dynamic linking is ``libcurl_imp.lib``. - ``--with-openssl``: use OpenSSL/LibreSSL/BoringSSL crypto locks when libcurl was built against these SSL backends. - ``--with-ssl``: legacy alias for ``--with-openssl``. - ``--openssl-lib-name=""``: specify a different name for OpenSSL import library containing CRYPTO_num_locks. For OpenSSL 1.1.0+ this should be set to an empty string as given here. - ``--avoid-stdio``: on Windows, a process and each library it is using may be linked to its own version of the C runtime (MSVCRT). FILE pointers from one C runtime may not be passed to another C runtime. This option prevents direct passing of FILE pointers from Python to libcurl, thus permitting Python and libcurl to be linked against different C runtimes. This option may carry a performance penalty when Python file objects are given directly to PycURL in CURLOPT_READDATA, CURLOPT_WRITEDATA or CURLOPT_WRITEHEADER options. This option applies only on Python 2; on Python 3, file objects no longer expose C library FILE pointers and the C runtime issue does not exist. On Python 3, this option is recognized but does nothing. You can also give ``--avoid-stdio`` option in PYCURL_SETUP_OPTIONS environment variable as follows:: PYCURL_SETUP_OPTIONS=--avoid-stdio pip install pycurl A good ``setup.py`` target to use is ``bdist_wininst`` which produces an executable installer that you can run to install PycURL. You may find the following mailing list posts helpful: - https://curl.haxx.se/mail/curlpython-2009-11/0010.html - https://curl.haxx.se/mail/curlpython-2013-11/0002.html winbuild.py ^^^^^^^^^^^ This script is used to build official PycURL Windows packages. You can use it to build a full complement of packages with your own options or modify it to build a single package you need. Prerequisites: - `Git for Windows`_. - Appropriate `Python versions`_ installed. - MS Visual C++ 9/2008 for Python <= 3.2, MS Visual C++ 10/2010 for Python 3.3 or 3.4, MS Visual C++ 14/2015 for Python 3.5 through 3.8. Express versions of Visual Studio work fine for this, although getting 64 bit compilers to wok in some Express versions involves jumping through several hoops. - NASM if building libcurl against OpenSSL. - ActivePerl if building libcurl against OpenSSL. The perl shipping with Git for Windows handles forward and backslashes in paths in a way that is incompatible with OpenSSL's build scripts. .. _Git for Windows: https://git-for-windows.github.io/ .. _Python versions: http://python.org/download/ ``winbuild.py`` assumes all programs are installed in their default locations, if this is not the case edit it as needed. ``winbuild.py`` itself can be run with any Python it supports. Using PycURL With Custom Python Builds ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ As of version 7.21.5, the official binary packages of PycURL are linked statically against all of its dependencies except MSVCRT. This means that as long as your custom Python build uses the same version of MSVC as the corresponding official Python build as well as the same MSVCRT linking setting (/MD et. al.), an official PycURL package should work. If your Python build uses different MSVCRT settings or a different MSVC version from the official Python builds, you will need to compile PycURL from source. If the C runtime library (MSVCRT.DLL) versions used by PycURL and Python do not match, you will receive a message like the following one when trying to import ``pycurl`` module:: ImportError: DLL load failed: The specified procedure could not be found. To identify which MSVCRT version your Python uses use the `application profiling feature`_ of `Dependency Walker`_ and look for `msvcrt.dll variants`_ being loaded. You may find `the entire thread starting here`_ helpful. .. _application profiling feature: https://curl.haxx.se/mail/curlpython-2014-05/0007.html .. _Dependency Walker: http://www.dependencywalker.com/ .. _msvcrt.dll variants: https://curl.haxx.se/mail/curlpython-2014-05/0010.html .. _the entire thread starting here: https://curl.haxx.se/mail/curlpython-2014-05/0000.html Git Checkout ------------ In order to build PycURL from a Git checkout, some files need to be generated. On Unix systems it is easiest to build PycURL with ``make``:: make To specify which curl or SSL backend to compile against, use the same environment variables as easy_install/pip, namely ``PYCURL_CURL_CONFIG`` and ``PYCURL_SSL_LIBRARY``. To generate generated files only you may run:: make gen This might be handy if you are on Windows. Remember to run ``make gen`` whenever you change sources. To generate documentation, run:: make docs Generating documentation requires `Sphinx`_ to be installed. .. _Sphinx: http://sphinx-doc.org/ A Note Regarding SSL Backends ----------------------------- libcurl's functionality varies depending on which SSL backend it is compiled against. For example, users have `reported`_ `problems`_ with GnuTLS backend. As of this writing, generally speaking, OpenSSL backend has the most functionality as well as the best compatibility with other software. If you experience SSL issues, especially if you are not using OpenSSL backend, you can try rebuilding libcurl and PycURL against another SSL backend. .. _reported: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=515200 .. _problems: https://bugs.launchpad.net/ubuntu/+source/pycurl/+bug/1111673 SSL Certificate Bundle ---------------------- libcurl, and PycURL, by default verify validity of HTTPS servers' SSL certificates. Doing so requires a CA certificate bundle, which libcurl and most SSL libraries do not provide. Here_ is a good resource on how to build your own certificate bundle. certifie.com also has a `prebuilt certificate bundle`_. To use the certificate bundle, use ``CAINFO`` or ``CAPATH`` PycURL options. .. _Here: http://certifie.com/ca-bundle/ .. _prebuilt certificate bundle: http://certifie.com/ca-bundle/ca-bundle.crt.txt doc/pycurl/RELEASE-NOTES.rst 0000644 00000021262 15030136333 0011327 0 ustar 00 Release Notes ============= PycURL 7.45.6 - 2025-03-06 -------------------------- The previous release was accidentally built without CA bundle autodetection in Linux wheels - this restores that behavior (no changes to macOS or Linux). PycURL 7.45.5 - 2025-03-06 -------------------------- This release is mainly to update the wheels to incorporate libcurl 8.12.1 for security fixes, as well as enable some additional libraries in wheel builds. PycURL 7.45.4 - 2024-12-12 -------------------------- This release fixes several minor issues and adds support for several libcurl options. Additionally, it fixes several issues with the wheels on Linux/macOS/Windows. PycURL 7.45.3 - 2024-02-17 -------------------------- This release fixes several minor issues and adds support for several libcurl options. Additionally, we are now building wheels for Linux/macOS/Windows. PycURL 7.45.2 - 2022-12-16 -------------------------- This release fixes several minor issues and adds support for several libcurl options. PycURL 7.45.1 - 2022-03-13 -------------------------- This release fixes build when libcurl < 7.64.1 is used. PycURL 7.45.0 - 2022-03-09 -------------------------- This release adds support for SecureTransport SSL backend (MacOS), adds ability to unset a number of multi options, adds ability to duplicate easy handles and permits pycurl classes to be subclassed. PycURL 7.44.1 - 2021-08-15 -------------------------- This release repairs incorrect Python thread initialization logic which caused operations to hang. PycURL 7.44.0 - 2021-08-08 -------------------------- This release reinstates best effort Python 2 support, adds Python 3.9 and Python 3.10 alpha support and implements support for several libcurl options. Official Windows builds are currently not being produced. PycURL 7.43.0.6 - 2020-09-02 ---------------------------- This release improves SSL backend detection on various systems, adds support for libcurl's multiple SSL backend functionality and adds support for several libcurl options. PycURL 7.43.0.5 - 2020-01-29 ---------------------------- This release fixes a build issue on recent Pythons on CentOS/RHEL distributions. It also brings back Windows binaries. Special thank you to Gisle Vanem for contributing the nghttp2 makefile. PycURL 7.43.0.4 - 2020-01-15 ---------------------------- This release improves compatibility with Python 3.8 and removes support for Python 2 and Python 3.4. It also adds wolfSSL support and thread safety of the multi interface. PycURL 7.43.0.3 - 2019-06-17 ---------------------------- This release primarily fixes an OpenSSL-related installation issue, and repairs the ability to use PycURL with newer libcurls compiled without FTP support. Also, mbedTLS support has been contributed by Josef Schlehofer. PycURL 7.43.0.2 - 2018-06-02 ---------------------------- Highlights of this release: 1. Experimental perform_rs and perform_rb methods have been added to Curl objects. They return response body as a string and a byte string, respectively. The goal of these methods is to improve PycURL's usability for typical use cases, specifically removing the need to set up StringIO/BytesIO objects to store the response body. 2. getinfo_raw and errstr_raw methods have been added to Curl objects to return transfer information as byte strings, permitting applications to retrieve transfer information that is not decodable using Python's default encoding. 3. errstr and "fail or error" exceptions now replace undecodable bytes so as to provide usable strings; use errstr_raw to retrieve original byte strings. 4. There is no longer a need to keep references to Curl objects when they are used in CurlMulti objects - PycURL now maintains such references internally. 5. Official Windows builds now include HTTP/2 and international domain name support. 6. PycURL now officially supports BoringSSL. 7. A number of smaller improvements have been made and bugs fixed. PycURL 7.43.0.1 - 2017-12-07 ---------------------------- This release collects fixes and improvements made over the past two years, notably updating Windows dependencies to address DNS resolution and TLS connection issues. PycURL 7.43.0 - 2016-02-02 -------------------------- Highlights of this release: 1. Binary wheels are now built for Windows systems. 2. setopt_string method added to Curl objects to permit setting string libcurl options that PycURL does not know about. 3. curl module can now be imported on Windows again. 4. OPENSOCKETFUNCTION callback is now invoked with the address as bytes on Python 3 as was documented. 5. Support for many libcurl options and constants was added. PycURL 7.21.5 - 2016-01-05 -------------------------- Highlights of this release: 1. Socket callbacks are now fully implemented (``CURLOPT_OPENSOCKETFUNCTION``, ``CURLOPT_SOCKOPTFUNCTION``, ``CURLOPT_CLOSESOCKETFUNCTION``). Unfortunately this required changing ``OPENSOCKETFUNCTION`` API once again in a backwards-incompatible manner. Support for ``SOCKOPTFUNCTION`` and ``CLOSESOCKETFUNCTION`` was added in this release. ``OPENSOCKETFUNCTION`` now supports Unix sockets. 2. Many other libcurl options and constants have been added to PycURL. 3. When ``pycurl`` module initialization fails, ``ImportError`` is raised instead of a fatal error terminating the process. 4. Usability of official Windows builds has been greatly improved: * Dependencies are linked statically, eliminating possible DLL conflicts. * OpenSSL is used instead of WinSSL. * libcurl is linked against C-Ares and libssh2. PycURL 7.19.5.3 - 2015-11-03 ---------------------------- PycURL 7.19.5.2 release did not include some of the test suite files in its manifest, leading to inability to run the test suite from the sdist tarball. This is now fixed thanks to Kamil Dudka. PycURL 7.19.5.2 - 2015-11-02 ---------------------------- Breaking change: DEBUGFUNCTION now takes bytes rather than (Unicode) string as its argument on Python 3. Breaking change: CURLMOPT_* option constants moved from Easy to Multi class. They remain available in pycurl module. SSL library detection improved again, --libcurl-dll option to setup.py added. Options that required tuples now also accept lists, and vice versa. This release fixes several memory leaks and one use after free issue. Support for several new libcurl options and constants has been added. PycURL 7.19.5.1 - 2015-01-06 ---------------------------- This release primarily fixes build breakage against libcurl 7.19.4 through 7.21.1, such as versions shipped with CentOS. PycURL 7.19.5 - 2014-07-12 -------------------------- PycURL C code has been significantly reorganized. Curl, CurlMulti and CurlShare classes are now properly exported, instead of factory functions for the respective objects. PycURL API has not changed. Documentation has been transitioned to Sphinx and reorganized as well. Both docstrings and standalone documentation are now more informative. Documentation is no longer included in released distributions. It can be generated from source by running `make docs`. Tests are no longer included in released distributions. Instead the documentation and quickstart examples should be consulted for sample code. Official Windows builds now are linked against zlib. PycURL 7.19.3.1 - 2014-02-05 ---------------------------- This release restores PycURL's ability to automatically detect SSL library in use in most circumstances, thanks to Andjelko Horvat. PycURL 7.19.3 - 2014-01-09 -------------------------- This release brings official Python 3 support to PycURL. Several GNU/Linux distributions provided Python 3 packages of PycURL previously; these packages were based on patches that were incomplete and in some places incorrect. Behavior of PycURL 7.19.3 and later may therefore differ from behavior of unofficial Python 3 packages of previous PycURL versions. To summarize the behavior under Python 3, PycURL will accept ``bytes`` where it accepted strings under Python 2, and will also accept Unicode strings containing ASCII codepoints only for convenience. Please refer to `Unicode`_ and `file`_ documentation for further details. In the interests of compatibility, PycURL will also accept Unicode data on Python 2 given the same constraints as under Python 3. While Unicode and file handling rules are expected to be sensible for all use cases, and retain backwards compatibility with previous PycURL versions, please treat behavior of this versions under Python 3 as experimental and subject to change. Another potentially disruptive change in PycURL is the requirement for compile time and runtime SSL backends to match. Please see the readme for how to indicate the SSL backend to setup.py. .. _Unicode: doc/unicode.html .. _file: doc/files.html doc/pycurl/examples/smtp.py 0000644 00000002113 15030136334 0011775 0 ustar 00 # Based on the simple libcurl SMTP example: # https://github.com/bagder/curl/blob/master/docs/examples/smtp-mail.c # There are other SMTP examples in that directory that you may find helpful. from . import localhost import pycurl try: from io import BytesIO except ImportError: from StringIO import StringIO as BytesIO import sys PY3 = sys.version_info[0] > 2 mail_server = 'smtp://%s' % localhost mail_from = 'sender@example.org' mail_to = 'addressee@example.net' c = pycurl.Curl() c.setopt(c.URL, mail_server) c.setopt(c.MAIL_FROM, mail_from) c.setopt(c.MAIL_RCPT, [mail_to]) message = '''\ From: %s To: %s Subject: PycURL SMTP example SMTP example via PycURL ''' % (mail_from, mail_to) if PY3: message = message.encode('ascii') # libcurl does not perform buffering, therefore # we need to wrap the message string into a BytesIO or StringIO. io = BytesIO(message) c.setopt(c.READDATA, io) # If UPLOAD is not set, libcurl performs SMTP VRFY. # Setting UPLOAD to True sends a message. c.setopt(c.UPLOAD, True) # Observe SMTP conversation. c.setopt(c.VERBOSE, True) c.perform() doc/pycurl/examples/file_upload.py 0000644 00000002233 15030136334 0013300 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import os, sys import pycurl # Class which holds a file reference and the read callback class FileReader: def __init__(self, fp): self.fp = fp def read_callback(self, size): return self.fp.read(size) # Check commandline arguments if len(sys.argv) < 3: print("Usage: %s <url> <file to upload>" % sys.argv[0]) raise SystemExit url = sys.argv[1] filename = sys.argv[2] if not os.path.exists(filename): print("Error: the file '%s' does not exist" % filename) raise SystemExit # Initialize pycurl c = pycurl.Curl() c.setopt(pycurl.URL, url) c.setopt(pycurl.UPLOAD, 1) # Two versions with the same semantics here, but the filereader version # is useful when you have to process the data which is read before returning if 1: c.setopt(pycurl.READFUNCTION, FileReader(open(filename, 'rb')).read_callback) else: c.setopt(pycurl.READFUNCTION, open(filename, 'rb').read) # Set size of file to be uploaded. filesize = os.path.getsize(filename) c.setopt(pycurl.INFILESIZE, filesize) # Start transfer print('Uploading file %s to url %s' % (filename, url)) c.perform() c.close() doc/pycurl/examples/basicfirst.py 0000644 00000001041 15030136335 0013143 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import sys import pycurl PY3 = sys.version_info[0] > 2 class Test: def __init__(self): self.contents = '' if PY3: self.contents = self.contents.encode('ascii') def body_callback(self, buf): self.contents = self.contents + buf sys.stderr.write("Testing %s\n" % pycurl.version) t = Test() c = pycurl.Curl() c.setopt(c.URL, 'https://curl.haxx.se/dev/') c.setopt(c.WRITEFUNCTION, t.body_callback) c.perform() c.close() print(t.contents) doc/pycurl/examples/retriever-multi.py 0000644 00000006437 15030136335 0014167 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et # # Usage: python retriever-multi.py <file with URLs to fetch> [<# of # concurrent connections>] # import sys import pycurl # We should ignore SIGPIPE when using pycurl.NOSIGNAL - see # the libcurl tutorial for more info. try: import signal from signal import SIGPIPE, SIG_IGN except ImportError: pass else: signal.signal(SIGPIPE, SIG_IGN) # Get args num_conn = 10 try: if sys.argv[1] == "-": urls = sys.stdin.readlines() else: urls = open(sys.argv[1]).readlines() if len(sys.argv) >= 3: num_conn = int(sys.argv[2]) except: print("Usage: %s <file with URLs to fetch> [<# of concurrent connections>]" % sys.argv[0]) raise SystemExit # Make a queue with (url, filename) tuples queue = [] for url in urls: url = url.strip() if not url or url[0] == "#": continue filename = "doc_%03d.dat" % (len(queue) + 1) queue.append((url, filename)) # Check args assert queue, "no URLs given" num_urls = len(queue) num_conn = min(num_conn, num_urls) assert 1 <= num_conn <= 10000, "invalid number of concurrent connections" print("PycURL %s (compiled against 0x%x)" % (pycurl.version, pycurl.COMPILE_LIBCURL_VERSION_NUM)) print("----- Getting", num_urls, "URLs using", num_conn, "connections -----") # Pre-allocate a list of curl objects m = pycurl.CurlMulti() m.handles = [] for i in range(num_conn): c = pycurl.Curl() c.fp = None c.setopt(pycurl.FOLLOWLOCATION, 1) c.setopt(pycurl.MAXREDIRS, 5) c.setopt(pycurl.CONNECTTIMEOUT, 30) c.setopt(pycurl.TIMEOUT, 300) c.setopt(pycurl.NOSIGNAL, 1) m.handles.append(c) # Main loop freelist = m.handles[:] num_processed = 0 while num_processed < num_urls: # If there is an url to process and a free curl object, add to multi stack while queue and freelist: url, filename = queue.pop(0) c = freelist.pop() c.fp = open(filename, "wb") c.setopt(pycurl.URL, url) c.setopt(pycurl.WRITEDATA, c.fp) m.add_handle(c) # store some info c.filename = filename c.url = url # Run the internal curl state machine for the multi stack while 1: ret, num_handles = m.perform() if ret != pycurl.E_CALL_MULTI_PERFORM: break # Check for curl objects which have terminated, and add them to the freelist while 1: num_q, ok_list, err_list = m.info_read() for c in ok_list: c.fp.close() c.fp = None m.remove_handle(c) print("Success:", c.filename, c.url, c.getinfo(pycurl.EFFECTIVE_URL)) freelist.append(c) for c, errno, errmsg in err_list: c.fp.close() c.fp = None m.remove_handle(c) print("Failed: ", c.filename, c.url, errno, errmsg) freelist.append(c) num_processed = num_processed + len(ok_list) + len(err_list) if num_q == 0: break # Currently no more I/O is pending, could do something in the meantime # (display a progress bar, etc.). # We just call select() to sleep until some more data is available. m.select(1.0) # Cleanup for c in m.handles: if c.fp is not None: c.fp.close() c.fp = None c.close() m.close() doc/pycurl/examples/retriever.py 0000644 00000005151 15030136336 0013030 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et # # Usage: python retriever.py <file with URLs to fetch> [<# of # concurrent connections>] # import sys, threading try: import Queue except ImportError: import queue as Queue import pycurl # We should ignore SIGPIPE when using pycurl.NOSIGNAL - see # the libcurl tutorial for more info. try: import signal from signal import SIGPIPE, SIG_IGN except ImportError: pass else: signal.signal(SIGPIPE, SIG_IGN) # Get args num_conn = 10 try: if sys.argv[1] == "-": urls = sys.stdin.readlines() else: urls = open(sys.argv[1]).readlines() if len(sys.argv) >= 3: num_conn = int(sys.argv[2]) except: print("Usage: %s <file with URLs to fetch> [<# of concurrent connections>]" % sys.argv[0]) raise SystemExit # Make a queue with (url, filename) tuples queue = Queue.Queue() for url in urls: url = url.strip() if not url or url[0] == "#": continue filename = "doc_%03d.dat" % (len(queue.queue) + 1) queue.put((url, filename)) # Check args assert queue.queue, "no URLs given" num_urls = len(queue.queue) num_conn = min(num_conn, num_urls) assert 1 <= num_conn <= 10000, "invalid number of concurrent connections" print("PycURL %s (compiled against 0x%x)" % (pycurl.version, pycurl.COMPILE_LIBCURL_VERSION_NUM)) print("----- Getting", num_urls, "URLs using", num_conn, "connections -----") class WorkerThread(threading.Thread): def __init__(self, queue): threading.Thread.__init__(self) self.queue = queue def run(self): while 1: try: url, filename = self.queue.get_nowait() except Queue.Empty: raise SystemExit fp = open(filename, "wb") curl = pycurl.Curl() curl.setopt(pycurl.URL, url) curl.setopt(pycurl.FOLLOWLOCATION, 1) curl.setopt(pycurl.MAXREDIRS, 5) curl.setopt(pycurl.CONNECTTIMEOUT, 30) curl.setopt(pycurl.TIMEOUT, 300) curl.setopt(pycurl.NOSIGNAL, 1) curl.setopt(pycurl.WRITEDATA, fp) try: curl.perform() except: import traceback traceback.print_exc(file=sys.stderr) sys.stderr.flush() curl.close() fp.close() sys.stdout.write(".") sys.stdout.flush() # Start a bunch of threads threads = [] for dummy in range(num_conn): t = WorkerThread(queue) t.start() threads.append(t) # Wait for all threads to finish for thread in threads: thread.join() doc/pycurl/examples/quickstart/form_post.py 0000644 00000001064 15030136336 0015222 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl try: # python 3 from urllib.parse import urlencode except ImportError: # python 2 from urllib import urlencode c = pycurl.Curl() c.setopt(c.URL, 'https://httpbin.org/post') post_data = {'field': 'value'} # Form data must be provided already urlencoded. postfields = urlencode(post_data) # Sets request method to POST, # Content-Type header to application/x-www-form-urlencoded # and data to send in request body. c.setopt(c.POSTFIELDS, postfields) c.perform() c.close() doc/pycurl/examples/quickstart/file_upload_buffer.py 0000644 00000000467 15030136337 0017035 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl c = pycurl.Curl() c.setopt(c.URL, 'https://httpbin.org/post') c.setopt(c.HTTPPOST, [ ('fileupload', ( c.FORM_BUFFER, 'readme.txt', c.FORM_BUFFERPTR, 'This is a fancy readme file', )), ]) c.perform() c.close() doc/pycurl/examples/quickstart/get_python3.py 0000644 00000000623 15030136337 0015456 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl from io import BytesIO buffer = BytesIO() c = pycurl.Curl() c.setopt(c.URL, 'http://pycurl.io/') 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')) doc/pycurl/examples/quickstart/get_python2_https.py 0000644 00000000762 15030136340 0016675 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl import certifi from StringIO import StringIO buffer = StringIO() c = pycurl.Curl() c.setopt(c.URL, 'http://pycurl.io/') c.setopt(c.WRITEDATA, buffer) # For older PycURL versions: #c.setopt(c.WRITEFUNCTION, buffer.write) c.setopt(c.CAINFO, certifi.where()) c.perform() c.close() body = buffer.getvalue() # Body is a string in some encoding. # In Python 2, we can print it without knowing what the encoding is. print(body) doc/pycurl/examples/quickstart/response_info.py 0000644 00000000762 15030136340 0016062 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl try: from io import BytesIO except ImportError: from StringIO import StringIO as BytesIO buffer = BytesIO() c = pycurl.Curl() c.setopt(c.URL, 'http://pycurl.io/') c.setopt(c.WRITEDATA, buffer) c.perform() # HTTP response code, e.g. 200. print('Status: %d' % c.getinfo(c.RESPONSE_CODE)) # Elapsed time for the transfer. print('Time: %f' % c.getinfo(c.TOTAL_TIME)) # getinfo must be called before close. c.close() doc/pycurl/examples/quickstart/response_headers.py 0000644 00000004061 15030136341 0016537 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl import re try: from io import BytesIO except ImportError: from StringIO import StringIO as BytesIO headers = {} def header_function(header_line): # HTTP standard specifies that headers are encoded in iso-8859-1. # On Python 2, decoding step can be skipped. # On Python 3, decoding step is required. header_line = header_line.decode('iso-8859-1') # Header lines include the first status line (HTTP/1.x ...). # We are going to ignore all lines that don't have a colon in them. # This will botch headers that are split on multiple lines... if ':' not in header_line: return # Break the header line into header name and value. name, value = header_line.split(':', 1) # Remove whitespace that may be present. # Header lines include the trailing newline, and there may be whitespace # around the colon. name = name.strip() value = value.strip() # Header names are case insensitive. # Lowercase name here. name = name.lower() # Now we can actually record the header name and value. headers[name] = value buffer = BytesIO() c = pycurl.Curl() c.setopt(c.URL, 'http://pycurl.io') c.setopt(c.WRITEFUNCTION, buffer.write) # Set our header function. c.setopt(c.HEADERFUNCTION, header_function) c.perform() c.close() # Figure out what encoding was sent with the response, if any. # Check against lowercased header name. encoding = None if 'content-type' in headers: content_type = headers['content-type'].lower() match = re.search('charset=(\S+)', content_type) if match: encoding = match.group(1) print('Decoding using %s' % encoding) if encoding is None: # Default encoding for HTML is iso-8859-1. # Other content types may have different default encoding, # or in case of binary data, may have no encoding at all. encoding = 'iso-8859-1' print('Assuming encoding is %s' % encoding) body = buffer.getvalue() # Decode using the encoding we figured out. print(body.decode(encoding)) doc/pycurl/examples/quickstart/get_python2.py 0000644 00000000677 15030136341 0015461 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl from StringIO import StringIO buffer = StringIO() c = pycurl.Curl() c.setopt(c.URL, 'http://pycurl.io/') c.setopt(c.WRITEDATA, buffer) # For older PycURL versions: #c.setopt(c.WRITEFUNCTION, buffer.write) c.perform() c.close() body = buffer.getvalue() # Body is a string in some encoding. # In Python 2, we can print it without knowing what the encoding is. print(body) doc/pycurl/examples/quickstart/put_file.py 0000644 00000000454 15030136342 0015020 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl c = pycurl.Curl() c.setopt(c.URL, 'https://httpbin.org/put') c.setopt(c.UPLOAD, 1) file = open(__file__) c.setopt(c.READDATA, file) c.perform() c.close() # File must be kept open while Curl object is using it file.close() doc/pycurl/examples/quickstart/get_python3_https.py 0000644 00000000706 15030136342 0016676 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl import certifi from io import BytesIO buffer = BytesIO() c = pycurl.Curl() c.setopt(c.URL, 'http://pycurl.io/') c.setopt(c.WRITEDATA, buffer) c.setopt(c.CAINFO, certifi.where()) 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')) doc/pycurl/examples/quickstart/file_upload_real.py 0000644 00000000443 15030136343 0016476 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl c = pycurl.Curl() c.setopt(c.URL, 'https://httpbin.org/post') c.setopt(c.HTTPPOST, [ ('fileupload', ( # upload the contents of this file c.FORM_FILE, __file__, )), ]) c.perform() c.close() doc/pycurl/examples/quickstart/file_upload_real_fancy.py 0000644 00000000743 15030136343 0017661 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl c = pycurl.Curl() c.setopt(c.URL, 'https://httpbin.org/post') c.setopt(c.HTTPPOST, [ ('fileupload', ( # upload the contents of this file c.FORM_FILE, __file__, # specify a different file name for the upload c.FORM_FILENAME, 'helloworld.py', # specify a different content type c.FORM_CONTENTTYPE, 'application/x-python', )), ]) c.perform() c.close() doc/pycurl/examples/quickstart/put_buffer.py 0000644 00000000730 15030136343 0015350 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl try: from io import BytesIO except ImportError: from StringIO import StringIO as BytesIO c = pycurl.Curl() c.setopt(c.URL, 'https://httpbin.org/put') c.setopt(c.UPLOAD, 1) data = '{"json":true}' # READDATA requires an IO-like object; a string is not accepted # encode() is necessary for Python 3 buffer = BytesIO(data.encode('utf-8')) c.setopt(c.READDATA, buffer) c.perform() c.close() doc/pycurl/examples/quickstart/get.py 0000644 00000001107 15030136344 0013766 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl try: from io import BytesIO except ImportError: from StringIO import StringIO as BytesIO buffer = BytesIO() c = pycurl.Curl() c.setopt(c.URL, 'http://pycurl.io/') c.setopt(c.WRITEDATA, buffer) # For older PycURL versions: #c.setopt(c.WRITEFUNCTION, buffer.write) c.perform() c.close() body = buffer.getvalue() # Body is a string on Python 2 and a byte string on Python 3. # If we know the encoding, we can always decode the body and # end up with a Unicode string. print(body.decode('iso-8859-1')) doc/pycurl/examples/quickstart/follow_redirect.py 0000644 00000000372 15030136344 0016375 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl c = pycurl.Curl() # Redirects to https://www.python.org/. c.setopt(c.URL, 'http://www.python.org/') # Follow redirect. c.setopt(c.FOLLOWLOCATION, True) c.perform() c.close() doc/pycurl/examples/quickstart/write_file.py 0000644 00000000545 15030136345 0015346 0 ustar 00 #! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl # As long as the file is opened in binary mode, both Python 2 and Python 3 # can write response body to it without decoding. with open('out.html', 'wb') as f: c = pycurl.Curl() c.setopt(c.URL, 'http://pycurl.io/') c.setopt(c.WRITEDATA, f) c.perform() c.close() doc/pycurl/examples/quickstart/__pycache__/file_upload_buffer.cpython-312.pyc 0000644 00000001372 15030136345 0023371 0 ustar 00 � [��g7 � � � d dl Z e j � Zej ej d� ej ej dej dej dffg� ej � ej � y)� Nzhttps://httpbin.org/post� fileuploadz readme.txtzThis is a fancy readme file) �pycurl�Curl�c�setopt�URL�HTTPPOST�FORM_BUFFER�FORM_BUFFERPTR�perform�close� � �q/opt/hc_python/lib64/python3.12/site-packages/../../../share/doc/pycurl/examples/quickstart/file_upload_buffer.py�<module>r sw �� ��F�K�K�M�� ������*� +� ������� � � �|� ���7�� �� � � � �� ��� r doc/pycurl/examples/quickstart/__pycache__/form_post.cpython-312.pyc 0000644 00000001451 15030136346 0021564 0 ustar 00 � [��g4 � �& � d dl Z d dlmZ e j � Zej ej d� ddiZ ee � Z ej ej e � ej � ej � y# e$ r d dlmZ Y ��w xY w)� N)� urlencodezhttps://httpbin.org/post�field�value)�pycurl�urllib.parser �ImportError�urllib�Curl�c�setopt�URL� post_data� postfields� POSTFIELDS�perform�close� � �h/opt/hc_python/lib64/python3.12/site-packages/../../../share/doc/pycurl/examples/quickstart/form_post.py�<module>r s� �� �!�&� �F�K�K�M�� ������*� +� �g�� � �y� !� � ������z� "� � � �� ��� ��! � !� �!�s �B �B�B doc/pycurl/examples/quickstart/__pycache__/get_python2_https.cpython-312.pyc 0000644 00000001560 15030136346 0023241 0 ustar 00 � [��g� � � � d dl Z d dlZd dlmZ e� Z e j � Zej ej d� ej ej e� ej ej ej � � ej � ej � ej � Z ee� y)� N)�StringIOzhttp://pycurl.io/)�pycurl�certifir �buffer�Curl�c�setopt�URL� WRITEDATA�CAINFO�where�perform�close�getvalue�body�print� � �p/opt/hc_python/lib64/python3.12/site-packages/../../../share/doc/pycurl/examples/quickstart/get_python2_https.py�<module>r s� �� � � � ����F�K�K�M�� ������#� $� ������f� � ������=�7�=�=�?� #� � � �� ��� � ����� �d�r doc/pycurl/examples/quickstart/__pycache__/response_info.cpython-312.pyc 0000644 00000001765 15030136347 0022436 0 ustar 00 � [��g� � � � d dl Z d dlmZ e� Z e j � Zej ej d� ej ej e� ej � edej ej � z � edej ej � z � ej! � y# e$ r d dlmZ Y ��w xY w)� N)�BytesIO)�StringIOzhttp://pycurl.io/z Status: %dzTime: %f)�pycurl�ior �ImportErrorr �buffer�Curl�c�setopt�URL� WRITEDATA�perform�print�getinfo� RESPONSE_CODE� TOTAL_TIME�close� � �l/opt/hc_python/lib64/python3.12/site-packages/../../../share/doc/pycurl/examples/quickstart/response_info.py�<module>r s� �� �-�� ����F�K�K�M�� ������#� $� ������f� � � � �� �l�Q�Y�Y�q���/�/� 0� �j�1�9�9�Q�\�\�*�*� +� ��� �� � -�,�-�s �C �C�C doc/pycurl/examples/quickstart/__pycache__/get_python3.cpython-312.pyc 0000644 00000001424 15030136347 0022020 0 ustar 00 � [��g� � �F � d dl Z d dlmZ e� Z e j � Zej ej d� ej ej e� ej � ej � ej � Z e ej d� � y)� N)�BytesIOzhttp://pycurl.io/z iso-8859-1)�pycurl�ior �buffer�Curl�c�setopt�URL� WRITEDATA�perform�close�getvalue�body�print�decode� � �j/opt/hc_python/lib64/python3.12/site-packages/../../../share/doc/pycurl/examples/quickstart/get_python3.py�<module>r sw �� � � ����F�K�K�M�� ������#� $� ������f� � � � �� ��� � ����� �d�k�k�,�� r doc/pycurl/examples/quickstart/__pycache__/get_python3_https.cpython-312.pyc 0000644 00000001655 15030136350 0023242 0 ustar 00 � [��g� � � � d dl Z d dlZd dlmZ e� Z e j � Zej ej d� ej ej e� ej ej ej � � ej � ej � ej � Z eej# d� � y)� N)�BytesIOzhttp://pycurl.io/z iso-8859-1)�pycurl�certifi�ior �buffer�Curl�c�setopt�URL� WRITEDATA�CAINFO�where�perform�close�getvalue�body�print�decode� � �p/opt/hc_python/lib64/python3.12/site-packages/../../../share/doc/pycurl/examples/quickstart/get_python3_https.py�<module>r s� �� � � � ����F�K�K�M�� ������#� $� ������f� � ������=�7�=�=�?� #� � � �� ��� � ����� �d�k�k�,�� r doc/pycurl/examples/quickstart/__pycache__/follow_redirect.cpython-312.pyc 0000644 00000001115 15030136350 0022727 0 ustar 00 � [��g� � �� � d dl Z e j � Zej ej d� ej ej d� ej � ej � y)� Nzhttp://www.python.org/T)�pycurl�Curl�c�setopt�URL�FOLLOWLOCATION�perform�close� � �n/opt/hc_python/lib64/python3.12/site-packages/../../../share/doc/pycurl/examples/quickstart/follow_redirect.py�<module>r sP �� ��F�K�K�M�� ������(� )� ���� � �4� � � � �� ��� r doc/pycurl/examples/quickstart/__pycache__/response_headers.cpython-312.pyc 0000644 00000003651 15030136351 0023105 0 ustar 00 � [��g1 � �| � d dl Z d dlZ d dlmZ i Zd� Z e� Z e j � Z e j e j d� e j e j ej � e j e j e� e j! � e j# � dZdev rDed j'