Hello community, here is the log from the commit of package python-pycares for openSUSE:Factory checked in at 2020-03-27 00:27:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pycares (Old) and /work/SRC/openSUSE:Factory/.python-pycares.new.3160 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pycares" Fri Mar 27 00:27:41 2020 rev:3 rq:786484 version:3.1.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pycares/python-pycares.changes 2019-03-22 15:10:07.149351682 +0100 +++ /work/SRC/openSUSE:Factory/.python-pycares.new.3160/python-pycares.changes 2020-03-27 00:27:45.812331756 +0100 @@ -1,0 +2,14 @@ +Thu Mar 19 12:52:26 UTC 2020 - Marketa Calabkova <mcalabk...@suse.com> + +- Update to 3.1.1 + * misc: add Python 3.8 classifier + * ci: run tests in Python 3.8 too + * test: remove no longer valid test + * test: remove empty test + * errno: return str from errno.strerror + * core: fix crash when processing .onion queries + * core: fix support for ARES_OPT_LOOKUPS option + * misc: simplify non-ascii txt test example + * core: fix long TXT record with non-ascii bytes + +------------------------------------------------------------------- Old: ---- pycares-3.0.0.tar.gz New: ---- pycares-3.1.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pycares.spec ++++++ --- /var/tmp/diff_new_pack.j3oSYC/_old 2020-03-27 00:27:46.748332230 +0100 +++ /var/tmp/diff_new_pack.j3oSYC/_new 2020-03-27 00:27:46.748332230 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-pycares # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,12 +19,12 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-pycares -Version: 3.0.0 +Version: 3.1.1 Release: 0 Summary: Python interface for c-ares License: MIT Group: Development/Languages/Python -Url: http://github.com/saghul/pycares +URL: http://github.com/saghul/pycares Source: https://files.pythonhosted.org/packages/source/p/pycares/pycares-%{version}.tar.gz BuildRequires: %{python_module cffi} BuildRequires: %{python_module devel} ++++++ pycares-3.0.0.tar.gz -> pycares-3.1.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycares-3.0.0/ChangeLog new/pycares-3.1.1/ChangeLog --- old/pycares-3.0.0/ChangeLog 2019-03-02 12:38:02.000000000 +0100 +++ new/pycares-3.1.1/ChangeLog 2020-01-09 23:03:35.000000000 +0100 @@ -1,3 +1,27 @@ +Version 3.1.1 +============= +- ffi: new style callbacks + +Version 3.1.0 +============= +- misc: add Python 3.8 classifier +- (origin/master, origin/HEAD) build: use Travis to build Python Wheels +- ci: use GH Actions to test on macOS +- ci: run tests in Python 3.8 too +- test: remove no longer valid test +- test: remove empty test +- errno: return str from errno.strerror +- core: fix crash when processing .onion queries +- test: fix test_query_txt_multiple_chunked +- doc: fix path of _version.py file +- core: fix support for ARES_OPT_LOOKUPS option +- build: add cygwin support +- core: fix struct in6_addr alignment +- misc: simplify non-ascii txt test example +- core: fix long TXT record with non-ascii bytes +- build: remove extra add_include_dir line on linux +- build: fix testing manylinux wheels + Version 3.0.0 ============= (changes since version 2.x) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycares-3.0.0/PKG-INFO new/pycares-3.1.1/PKG-INFO --- old/pycares-3.0.0/PKG-INFO 2019-03-02 12:39:09.000000000 +0100 +++ new/pycares-3.1.1/PKG-INFO 2020-01-09 23:03:41.000000000 +0100 @@ -1,14 +1,12 @@ Metadata-Version: 2.1 Name: pycares -Version: 3.0.0 +Version: 3.1.1 Summary: Python interface for c-ares Home-page: http://github.com/saghul/pycares Author: Saúl Ibarra Corretgé Author-email: s...@saghul.net License: UNKNOWN -Description: - ==================================== - pycares: Python interface for c-ares +Description: pycares: Python interface for c-ares ==================================== .. image:: https://badge.fury.io/py/pycares.png @@ -20,19 +18,22 @@ .. image:: https://ci.appveyor.com/api/projects/status/vx1wbkfq3l7nm1m8?svg=true :target: https://ci.appveyor.com/project/saghul/pycares + .. image:: https://github.com/saghul/pycares/workflows/Test%20macOS/badge.svg + :target: https://github.com/saghul/pycares/actions) + pycares is a Python module which provides an interface to c-ares. `c-ares <http://c-ares.haxx.se>`_ is a C library that performs DNS requests and name resolutions asynchronously. Documentation - ============= + ------------- http://readthedocs.org/docs/pycares/ Bundled c-ares - ============== + -------------- pycares currently bundles c-ares and as of pycares 1.0.0 this is a strong requirement. Upstream c-ares is not willing to apply `a patch adding TTL support <http://c-ares.haxx.se/mail/c-ares-archive-2013-07/0005.shtml>`_. @@ -41,7 +42,7 @@ Installation - ============ + ------------ GNU/Linux, macOS, Windows, others: @@ -70,7 +71,7 @@ Running the test suite - ====================== + ---------------------- There are several ways of running the test ruite: @@ -85,7 +86,7 @@ Using it from the cli, a la dig - =============================== + ------------------------------- This module can be used directly from the command line in a similar fashion to dig (limited, of course): @@ -111,31 +112,30 @@ Author - ====== + ------ Saúl Ibarra Corretgé <s...@saghul.net> License - ======= + ------- Unless stated otherwise on-file pycares uses the MIT license, check LICENSE file. Supported Python versions - ========================= + ------------------------- Python >= 3.5 are supported. Both CPython and PyPy are supported. Contributing - ============ + ------------ If you'd like to contribute, fork the project, make a patch and send a pull request. Have a look at the surrounding code and please, make yours look alike :-) - Platform: POSIX Platform: Microsoft Windows Classifier: Development Status :: 5 - Production/Stable @@ -148,6 +148,8 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy +Description-Content-Type: text/x-rst Provides-Extra: idna diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycares-3.0.0/README.rst new/pycares-3.1.1/README.rst --- old/pycares-3.0.0/README.rst 2019-03-02 12:34:46.000000000 +0100 +++ new/pycares-3.1.1/README.rst 2020-01-09 23:03:35.000000000 +0100 @@ -1,5 +1,3 @@ - -==================================== pycares: Python interface for c-ares ==================================== @@ -12,19 +10,22 @@ .. image:: https://ci.appveyor.com/api/projects/status/vx1wbkfq3l7nm1m8?svg=true :target: https://ci.appveyor.com/project/saghul/pycares +.. image:: https://github.com/saghul/pycares/workflows/Test%20macOS/badge.svg + :target: https://github.com/saghul/pycares/actions) + pycares is a Python module which provides an interface to c-ares. `c-ares <http://c-ares.haxx.se>`_ is a C library that performs DNS requests and name resolutions asynchronously. Documentation -============= +------------- http://readthedocs.org/docs/pycares/ Bundled c-ares -============== +-------------- pycares currently bundles c-ares and as of pycares 1.0.0 this is a strong requirement. Upstream c-ares is not willing to apply `a patch adding TTL support <http://c-ares.haxx.se/mail/c-ares-archive-2013-07/0005.shtml>`_. @@ -33,7 +34,7 @@ Installation -============ +------------ GNU/Linux, macOS, Windows, others: @@ -62,7 +63,7 @@ Running the test suite -====================== +---------------------- There are several ways of running the test ruite: @@ -77,7 +78,7 @@ Using it from the cli, a la dig -=============================== +------------------------------- This module can be used directly from the command line in a similar fashion to dig (limited, of course): @@ -103,27 +104,26 @@ Author -====== +------ Saúl Ibarra Corretgé <s...@saghul.net> License -======= +------- Unless stated otherwise on-file pycares uses the MIT license, check LICENSE file. Supported Python versions -========================= +------------------------- Python >= 3.5 are supported. Both CPython and PyPy are supported. Contributing -============ +------------ If you'd like to contribute, fork the project, make a patch and send a pull request. Have a look at the surrounding code and please, make yours look alike :-) - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycares-3.0.0/deps/c-ares/src/ares_create_query.c new/pycares-3.1.1/deps/c-ares/src/ares_create_query.c --- old/pycares-3.0.0/deps/c-ares/src/ares_create_query.c 2019-01-16 23:38:44.000000000 +0100 +++ new/pycares-3.1.1/deps/c-ares/src/ares_create_query.c 2020-01-09 23:03:35.000000000 +0100 @@ -94,14 +94,14 @@ size_t buflen; unsigned char *buf; - /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */ - if (ares__is_onion_domain(name)) - return ARES_ENOTFOUND; - /* Set our results early, in case we bail out early with an error. */ *buflenp = 0; *bufp = NULL; + /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */ + if (ares__is_onion_domain(name)) + return ARES_ENOTFOUND; + /* Allocate a memory area for the maximum size this packet might need. +2 * is for the length byte and zero termination if no dots or ecscaping is * used. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycares-3.0.0/deps/c-ares/src/config_cygwin/ares_config.h new/pycares-3.1.1/deps/c-ares/src/config_cygwin/ares_config.h --- old/pycares-3.0.0/deps/c-ares/src/config_cygwin/ares_config.h 1970-01-01 01:00:00.000000000 +0100 +++ new/pycares-3.1.1/deps/c-ares/src/config_cygwin/ares_config.h 2020-01-09 23:03:35.000000000 +0100 @@ -0,0 +1,515 @@ +/* ares_config.h. Generated from ares_config.h.in by configure. */ +/* ares_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* define this if ares is built for a big endian system */ +/* #undef ARES_BIG_ENDIAN */ + +/* when building as static part of libcurl */ +/* #undef BUILDING_LIBCURL */ + +/* when building c-ares library */ +/* #undef CARES_BUILDING_LIBRARY */ + +/* when not building a shared library */ +/* #undef CARES_STATICLIB */ + +/* Define to 1 to enable hiding of library internal symbols. */ +#define CARES_SYMBOL_HIDING 1 + +/* Definition to make a library symbol externally visible. */ +#define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((visibility ("default"))) + +/* the signed version of size_t */ +#define CARES_TYPEOF_ARES_SSIZE_T ssize_t + +/* if a /etc/inet dir is being used */ +/* #undef ETC_INET */ + +/* Define to the type qualifier of arg 1 for getnameinfo. */ +#define GETNAMEINFO_QUAL_ARG1 const + +/* Define to the type of arg 1 for getnameinfo. */ +#define GETNAMEINFO_TYPE_ARG1 struct sockaddr * + +/* Define to the type of arg 2 for getnameinfo. */ +#define GETNAMEINFO_TYPE_ARG2 socklen_t + +/* Define to the type of args 4 and 6 for getnameinfo. */ +#define GETNAMEINFO_TYPE_ARG46 int + +/* Define to the type of arg 7 for getnameinfo. */ +#define GETNAMEINFO_TYPE_ARG7 int + +/* Specifies the number of arguments to getservbyport_r */ +/* #undef GETSERVBYPORT_R_ARGS */ + +/* Specifies the size of the buffer to pass to getservbyport_r */ +/* #undef GETSERVBYPORT_R_BUFSIZE */ + +/* Define to 1 if you have AF_INET6. */ +#define HAVE_AF_INET6 1 + +/* Define to 1 if you have the <arpa/inet.h> header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the <arpa/nameser_compat.h> header file. */ +#define HAVE_ARPA_NAMESER_COMPAT_H 1 + +/* Define to 1 if you have the <arpa/nameser.h> header file. */ +#define HAVE_ARPA_NAMESER_H 1 + +/* Define to 1 if you have the <assert.h> header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the `bitncmp' function. */ +/* #undef HAVE_BITNCMP */ + +/* Define to 1 if bool is an available type. */ +#define HAVE_BOOL_T 1 + +/* Define to 1 if you have the clock_gettime function and monotonic timer. */ +/* #undef HAVE_CLOCK_GETTIME_MONOTONIC */ + +/* Define to 1 if you have the closesocket function. */ +/* #undef HAVE_CLOSESOCKET */ + +/* Define to 1 if you have the CloseSocket camel case function. */ +/* #undef HAVE_CLOSESOCKET_CAMEL */ + +/* Define to 1 if you have the connect function. */ +#define HAVE_CONNECT 1 + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the <errno.h> header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the fcntl function. */ +#define HAVE_FCNTL 1 + +/* Define to 1 if you have the <fcntl.h> header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have a working fcntl O_NONBLOCK function. */ +#define HAVE_FCNTL_O_NONBLOCK 1 + +/* Define to 1 if you have the freeaddrinfo function. */ +#define HAVE_FREEADDRINFO 1 + +/* Define to 1 if you have a working getaddrinfo function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if the getaddrinfo function is threadsafe. */ +/* #undef HAVE_GETADDRINFO_THREADSAFE */ + +/* Define to 1 if you have the gethostbyaddr function. */ +#define HAVE_GETHOSTBYADDR 1 + +/* Define to 1 if you have the gethostbyname function. */ +#define HAVE_GETHOSTBYNAME 1 + +/* Define to 1 if you have the gethostname function. */ +#define HAVE_GETHOSTNAME 1 + +/* Define to 1 if you have the getnameinfo function. */ +#define HAVE_GETNAMEINFO 1 + +/* Define to 1 if you have the getservbyport_r function. */ +/* #undef HAVE_GETSERVBYPORT_R */ + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the `if_indextoname' function. */ +#define HAVE_IF_INDEXTONAME 1 + +/* Define to 1 if you have the `inet_net_pton' function. */ +/* #undef HAVE_INET_NET_PTON */ + +/* Define to 1 if inet_net_pton supports IPv6. */ +/* #undef HAVE_INET_NET_PTON_IPV6 */ + +/* Define to 1 if you have a IPv6 capable working inet_ntop function. */ +#define HAVE_INET_NTOP 1 + +/* Define to 1 if you have a IPv6 capable working inet_pton function. */ +#define HAVE_INET_PTON 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the ioctl function. */ +#define HAVE_IOCTL 1 + +/* Define to 1 if you have the ioctlsocket function. */ +/* #undef HAVE_IOCTLSOCKET */ + +/* Define to 1 if you have the IoctlSocket camel case function. */ +/* #undef HAVE_IOCTLSOCKET_CAMEL */ + +/* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. + */ +/* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ + +/* Define to 1 if you have a working ioctlsocket FIONBIO function. */ +/* #undef HAVE_IOCTLSOCKET_FIONBIO */ + +/* Define to 1 if you have a working ioctl FIONBIO function. */ +#define HAVE_IOCTL_FIONBIO 1 + +/* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ +#define HAVE_IOCTL_SIOCGIFADDR 1 + +/* Define to 1 if you have the `resolve' library (-lresolve). */ +/* #undef HAVE_LIBRESOLVE */ + +/* Define to 1 if you have the <limits.h> header file. */ +#define HAVE_LIMITS_H 1 + +/* if your compiler supports LL */ +#define HAVE_LL 1 + +/* Define to 1 if the compiler supports the 'long long' data type. */ +#define HAVE_LONGLONG 1 + +/* Define to 1 if you have the malloc.h header file. */ +#define HAVE_MALLOC_H 1 + +/* Define to 1 if you have the memory.h header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the MSG_NOSIGNAL flag. */ +#define HAVE_MSG_NOSIGNAL 1 + +/* Define to 1 if you have the <netdb.h> header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the <netinet/tcp.h> header file. */ +#define HAVE_NETINET_TCP_H 1 + +/* Define to 1 if you have the <net/if.h> header file. */ +#define HAVE_NET_IF_H 1 + +/* Define to 1 if you have PF_INET6. */ +#define HAVE_PF_INET6 1 + +/* Define to 1 if you have the recv function. */ +#define HAVE_RECV 1 + +/* Define to 1 if you have the recvfrom function. */ +#define HAVE_RECVFROM 1 + +/* Define to 1 if you have the send function. */ +#define HAVE_SEND 1 + +/* Define to 1 if you have the setsockopt function. */ +#define HAVE_SETSOCKOPT 1 + +/* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ +/* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ + +/* Define to 1 if you have the <signal.h> header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if sig_atomic_t is an available typedef. */ +#define HAVE_SIG_ATOMIC_T 1 + +/* Define to 1 if sig_atomic_t is already defined as volatile. */ +/* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ + +/* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ +#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 + +/* Define to 1 if you have the socket function. */ +#define HAVE_SOCKET 1 + +/* Define to 1 if you have the <socket.h> header file. */ +/* #undef HAVE_SOCKET_H */ + +/* Define to 1 if you have the <stdbool.h> header file. */ +#define HAVE_STDBOOL_H 1 + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the strcasecmp function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the strcmpi function. */ +/* #undef HAVE_STRCMPI */ + +/* Define to 1 if you have the strdup function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the stricmp function. */ +/* #undef HAVE_STRICMP */ + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the strncasecmp function. */ +#define HAVE_STRNCASECMP 1 + +/* Define to 1 if you have the strncmpi function. */ +/* #undef HAVE_STRNCMPI */ + +/* Define to 1 if you have the strnicmp function. */ +/* #undef HAVE_STRNICMP */ + +/* Define to 1 if you have the <stropts.h> header file. */ +/* #undef HAVE_STROPTS_H */ + +/* Define to 1 if you have struct addrinfo. */ +#define HAVE_STRUCT_ADDRINFO 1 + +/* Define to 1 if you have struct in6_addr. */ +#define HAVE_STRUCT_IN6_ADDR 1 + +/* Define to 1 if you have struct sockaddr_in6. */ +#define HAVE_STRUCT_SOCKADDR_IN6 1 + +/* if struct sockaddr_storage is defined */ +#define HAVE_STRUCT_SOCKADDR_STORAGE 1 + +/* Define to 1 if you have the timeval struct. */ +#define HAVE_STRUCT_TIMEVAL 1 + +/* Define to 1 if you have the <sys/ioctl.h> header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the <sys/param.h> header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the <sys/select.h> header file. */ +#define HAVE_SYS_SELECT_H 1 + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/time.h> header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <sys/uio.h> header file. */ +#define HAVE_SYS_UIO_H 1 + +/* Define to 1 if you have the <time.h> header file. */ +#define HAVE_TIME_H 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the windows.h header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define to 1 if you have the winsock2.h header file. */ +/* #undef HAVE_WINSOCK2_H */ + +/* Define to 1 if you have the winsock.h header file. */ +/* #undef HAVE_WINSOCK_H */ + +/* Define to 1 if you have the writev function. */ +#define HAVE_WRITEV 1 + +/* Define to 1 if you have the ws2tcpip.h header file. */ +/* #undef HAVE_WS2TCPIP_H */ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Define to 1 if you are building a native Windows target. */ +/* #undef NATIVE_WINDOWS */ + +/* Define to 1 if you need the malloc.h header file even with stdlib.h */ +/* #undef NEED_MALLOC_H */ + +/* Define to 1 if you need the memory.h header file even with stdlib.h */ +/* #undef NEED_MEMORY_H */ + +/* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ +/* #undef NEED_REENTRANT */ + +/* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ +/* #undef NEED_THREAD_SAFE */ + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* cpu-machine-OS */ +#define OS "i686-pc-cygwin" + +/* Name of package */ +#define PACKAGE "c-ares" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "c-ares mailing list => http://cool.haxx.se/mailman/listinfo/c-ares" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "c-ares" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "c-ares 1.13.0" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "c-ares" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.13.0" + +/* a suitable file/device to read random data from */ +#define RANDOM_FILE "/dev/urandom" + +/* Define to the type of arg 1 for recvfrom. */ +#define RECVFROM_TYPE_ARG1 int + +/* Define to the type pointed by arg 2 for recvfrom. */ +#define RECVFROM_TYPE_ARG2 void + +/* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ +#define RECVFROM_TYPE_ARG2_IS_VOID 1 + +/* Define to the type of arg 3 for recvfrom. */ +#define RECVFROM_TYPE_ARG3 size_t + +/* Define to the type of arg 4 for recvfrom. */ +#define RECVFROM_TYPE_ARG4 int + +/* Define to the type pointed by arg 5 for recvfrom. */ +#define RECVFROM_TYPE_ARG5 struct sockaddr + +/* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ +/* #undef RECVFROM_TYPE_ARG5_IS_VOID */ + +/* Define to the type pointed by arg 6 for recvfrom. */ +#define RECVFROM_TYPE_ARG6 socklen_t + +/* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ +/* #undef RECVFROM_TYPE_ARG6_IS_VOID */ + +/* Define to the function return type for recvfrom. */ +#define RECVFROM_TYPE_RETV int + +/* Define to the type of arg 1 for recv. */ +#define RECV_TYPE_ARG1 int + +/* Define to the type of arg 2 for recv. */ +#define RECV_TYPE_ARG2 void * + +/* Define to the type of arg 3 for recv. */ +#define RECV_TYPE_ARG3 size_t + +/* Define to the type of arg 4 for recv. */ +#define RECV_TYPE_ARG4 int + +/* Define to the function return type for recv. */ +#define RECV_TYPE_RETV int + +/* Define as the return type of signal handlers (`int' or `void'). */ +#define RETSIGTYPE void + +/* Define to the type qualifier of arg 2 for send. */ +#define SEND_QUAL_ARG2 const + +/* Define to the type of arg 1 for send. */ +#define SEND_TYPE_ARG1 int + +/* Define to the type of arg 2 for send. */ +#define SEND_TYPE_ARG2 void * + +/* Define to the type of arg 3 for send. */ +#define SEND_TYPE_ARG3 size_t + +/* Define to the type of arg 4 for send. */ +#define SEND_TYPE_ARG4 int + +/* Define to the function return type for send. */ +#define SEND_TYPE_RETV int + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + +/* The size of `struct in6_addr', as computed by sizeof. */ +#define SIZEOF_STRUCT_IN6_ADDR 16 + +/* The size of `struct in_addr', as computed by sizeof. */ +#define SIZEOF_STRUCT_IN_ADDR 4 + +/* The size of `time_t', as computed by sizeof. */ +#define SIZEOF_TIME_T 4 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ +#define TIME_WITH_SYS_TIME 1 + +/* Define to disable non-blocking sockets. */ +/* #undef USE_BLOCKING_SOCKETS */ + +/* Version number of package */ +#define VERSION "1.7.1" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Define to 1 if OS is AIX. */ +#ifndef _ALL_SOURCE +/* # undef _ALL_SOURCE */ +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Type to use in place of in_addr_t when system does not provide it. */ +/* #undef in_addr_t */ + +/* Define to `unsigned int' if <sys/types.h> does not define. */ +/* #undef size_t */ + +/* the signed version of size_t */ +/* #undef ssize_t */ + +#define HAVE_GETENV 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycares-3.0.0/docs/conf.py new/pycares-3.1.1/docs/conf.py --- old/pycares-3.0.0/docs/conf.py 2019-01-02 10:16:48.000000000 +0100 +++ new/pycares-3.1.1/docs/conf.py 2020-01-09 23:03:35.000000000 +0100 @@ -14,7 +14,7 @@ import re def get_version(): - return re.search(r"""__version__\s+=\s+(?P<quote>['"])(?P<version>.+?)(?P=quote)""", open('../pycares/_version.py').read()).group('version') + return re.search(r"""__version__\s+=\s+(?P<quote>['"])(?P<version>.+?)(?P=quote)""", open('../src/pycares/_version.py').read()).group('version') _version = get_version() # If extensions (or modules to document with autodoc) are in another directory, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycares-3.0.0/setup.py new/pycares-3.1.1/setup.py --- old/pycares-3.0.0/setup.py 2019-01-23 08:43:16.000000000 +0100 +++ new/pycares-3.1.1/setup.py 2020-01-09 23:03:35.000000000 +0100 @@ -19,6 +19,7 @@ url = 'http://github.com/saghul/pycares', description = 'Python interface for c-ares', long_description = codecs.open('README.rst', encoding='utf-8').read(), + long_description_content_type = 'text/x-rst', platforms = ['POSIX', 'Microsoft Windows'], classifiers = [ 'Development Status :: 5 - Production/Stable', @@ -31,6 +32,7 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', ], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycares-3.0.0/setup_cares.py new/pycares-3.1.1/setup_cares.py --- old/pycares-3.0.0/setup_cares.py 2019-01-22 13:52:04.000000000 +0100 +++ new/pycares-3.1.1/setup_cares.py 2020-01-09 23:03:35.000000000 +0100 @@ -76,7 +76,6 @@ self.compiler.add_include_dir(os.path.join(self.cares_dir, 'src/config_android')) else: self.compiler.add_include_dir(os.path.join(self.cares_dir, 'src/config_linux')) - self.compiler.add_include_dir(os.path.join(self.cares_dir, 'src/config_linux')) self.compiler.add_library('dl') self.compiler.add_library('rt') elif sys.platform == 'darwin': @@ -96,6 +95,8 @@ self.compiler.add_library('socket') self.compiler.add_library('nsl') self.compiler.add_library('kstat') + elif sys.platform == 'cygwin': + self.compiler.add_include_dir(os.path.join(self.cares_dir, 'src/config_cygwin')) elif sys.platform == 'win32': if 'mingw' not in self.compiler.compiler_type: self.extensions[0].extra_link_args = ['/NODEFAULTLIB:libcmt'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycares-3.0.0/src/_cffi_src/build_cares.py new/pycares-3.1.1/src/_cffi_src/build_cares.py --- old/pycares-3.0.0/src/_cffi_src/build_cares.py 2019-01-22 13:52:29.000000000 +0100 +++ new/pycares-3.1.1/src/_cffi_src/build_cares.py 2020-01-09 23:03:35.000000000 +0100 @@ -29,6 +29,7 @@ struct in6_addr { uint8_t s6_addr[16]; + ...; }; struct timeval { @@ -488,7 +489,30 @@ ares_socklen_t size); int ares_inet_pton(int af, const char *src, void *dst); +""" + +CALLBACKS = """ +extern "Python" void _sock_state_cb(void *data, + ares_socket_t socket_fd, + int readable, + int writable); + +extern "Python" void _host_cb(void *arg, + int status, + int timeouts, + struct hostent *hostent); +extern "Python" void _nameinfo_cb(void *arg, + int status, + int timeouts, + char *node, + char *service); + +extern "Python" void _query_cb(void *arg, + int status, + int timeouts, + unsigned char *abuf, + int alen); """ INCLUDES = """ @@ -508,6 +532,6 @@ ffi = cffi.FFI() -ffi.cdef(PLATFORM_TYPES + TYPES + FUNCTIONS) +ffi.cdef(PLATFORM_TYPES + TYPES + FUNCTIONS + CALLBACKS) ffi.set_source('_cares', INCLUDES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycares-3.0.0/src/pycares/__init__.py new/pycares-3.1.1/src/pycares/__init__.py --- old/pycares-3.0.0/src/pycares/__init__.py 2019-02-15 00:12:16.000000000 +0100 +++ new/pycares-3.1.1/src/pycares/__init__.py 2020-01-09 23:03:35.000000000 +0100 @@ -85,12 +85,12 @@ _global_set = set() -@_ffi.callback("void (void *data, ares_socket_t socket_fd, int readable, int writable )") +@_ffi.def_extern() def _sock_state_cb(data, socket_fd, readable, writable): sock_state_cb = _ffi.from_handle(data) sock_state_cb(socket_fd, readable, writable) -@_ffi.callback("void (void *arg, int status, int timeouts, struct hostent *hostent)") +@_ffi.def_extern() def _host_cb(arg, status, timeouts, hostent): callback = _ffi.from_handle(arg) _global_set.discard(arg) @@ -103,7 +103,7 @@ callback(result, status) -@_ffi.callback("void (void *arg, int status, int timeouts, char *node, char *service)") +@_ffi.def_extern() def _nameinfo_cb(arg, status, timeouts, node, service): callback = _ffi.from_handle(arg) _global_set.discard(arg) @@ -116,7 +116,7 @@ callback(result, status) -@_ffi.callback("void (void *arg, int status, int timeouts, unsigned char *abuf, int alen)") +@_ffi.def_extern() def _query_cb(arg, status, timeouts, abuf, alen): callback, query_type = _ffi.from_handle(arg) _global_set.discard(arg) @@ -271,14 +271,14 @@ while True: if txt_reply_ptr == _ffi.NULL: if tmp_obj is not None: - result.append(tmp_obj) + result.append(ares_query_txt_result(tmp_obj)) break if txt_reply_ptr.record_start == 1: if tmp_obj is not None: - result.append(tmp_obj) - tmp_obj = ares_query_txt_result(txt_reply_ptr) + result.append(ares_query_txt_result(tmp_obj)) + tmp_obj = ares_query_txt_result_chunk(txt_reply_ptr) else: - new_chunk = ares_query_txt_result(txt_reply_ptr) + new_chunk = ares_query_txt_result_chunk(txt_reply_ptr) tmp_obj.text += new_chunk.text txt_reply_ptr = txt_reply_ptr.next _lib.ares_free_data(txt_reply[0]) @@ -355,12 +355,12 @@ # This must be kept alive while the channel is alive. self._sock_state_cb_handle = userdata - options.sock_state_cb = _sock_state_cb + options.sock_state_cb = _lib._sock_state_cb options.sock_state_cb_data = userdata optmask = optmask | _lib.ARES_OPT_SOCK_STATE_CB if lookups: - options.lookups = lookups + options.lookups = _ffi.new('char[]', ascii_bytes(lookups)) optmask = optmask | _lib.ARES_OPT_LOOKUPS if domains: @@ -491,7 +491,7 @@ userdata = _ffi.new_handle(callback) _global_set.add(userdata) - _lib.ares_gethostbyaddr(self._channel[0], address, _ffi.sizeof(address[0]), family, _host_cb, userdata) + _lib.ares_gethostbyaddr(self._channel[0], address, _ffi.sizeof(address[0]), family, _lib._host_cb, userdata) def gethostbyname(self, name, family, callback): if not callable(callback): @@ -499,7 +499,7 @@ userdata = _ffi.new_handle(callback) _global_set.add(userdata) - _lib.ares_gethostbyname(self._channel[0], parse_name(name), family, _host_cb, userdata) + _lib.ares_gethostbyname(self._channel[0], parse_name(name), family, _lib._host_cb, userdata) def query(self, name, query_type, callback): self._do_query(_lib.ares_query, name, query_type, callback) @@ -516,7 +516,7 @@ userdata = _ffi.new_handle((callback, query_type)) _global_set.add(userdata) - func(self._channel[0], parse_name(name), _lib.C_IN, query_type, _query_cb, userdata) + func(self._channel[0], parse_name(name), _lib.C_IN, query_type, _lib._query_cb, userdata) def set_local_ip(self, ip): addr4 = _ffi.new("struct in_addr*") @@ -553,7 +553,7 @@ userdata = _ffi.new_handle(callback) _global_set.add(userdata) - _lib.ares_getnameinfo(self._channel[0], _ffi.cast("struct sockaddr*", sa), _ffi.sizeof(sa[0]), flags, _nameinfo_cb, userdata) + _lib.ares_getnameinfo(self._channel[0], _ffi.cast("struct sockaddr*", sa), _ffi.sizeof(sa[0]), flags, _lib._nameinfo_cb, userdata) def set_local_dev(self, dev): _lib.ares_set_local_dev(self._channel[0], dev) @@ -675,8 +675,17 @@ __slots__ = ('text', 'ttl') type = 'TXT' + def __init__(self, txt_chunk): + self.text = maybe_str(txt_chunk.text) + self.ttl = txt_chunk.ttl + + +class ares_query_txt_result_chunk(AresResult): + __slots__ = ('text', 'ttl') + type = 'TXT' + def __init__(self, txt): - self.text = maybe_str(_ffi.string(txt.txt)) + self.text = _ffi.string(txt.txt) self.ttl = txt.ttl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycares-3.0.0/src/pycares/_version.py new/pycares-3.1.1/src/pycares/_version.py --- old/pycares-3.0.0/src/pycares/_version.py 2019-03-02 12:35:25.000000000 +0100 +++ new/pycares-3.1.1/src/pycares/_version.py 2020-01-09 23:03:35.000000000 +0100 @@ -1,2 +1,2 @@ -__version__ = '3.0.0' +__version__ = '3.1.1' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycares-3.0.0/src/pycares/errno.py new/pycares-3.1.1/src/pycares/errno.py --- old/pycares-3.0.0/src/pycares/errno.py 2019-01-22 13:52:29.000000000 +0100 +++ new/pycares-3.1.1/src/pycares/errno.py 2020-01-09 23:03:35.000000000 +0100 @@ -1,5 +1,6 @@ from ._cares import ffi as _ffi, lib as _lib +from .utils import maybe_str exported_pycares_symbols = [ @@ -40,7 +41,7 @@ def strerror(code): - return _ffi.string(_lib.ares_strerror(code)) + return maybe_str(_ffi.string(_lib.ares_strerror(code))) __all__ = exported_pycares_symbols + ['errorcode', 'strerror'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycares-3.0.0/src/pycares.egg-info/PKG-INFO new/pycares-3.1.1/src/pycares.egg-info/PKG-INFO --- old/pycares-3.0.0/src/pycares.egg-info/PKG-INFO 2019-03-02 12:39:09.000000000 +0100 +++ new/pycares-3.1.1/src/pycares.egg-info/PKG-INFO 2020-01-09 23:03:41.000000000 +0100 @@ -1,14 +1,12 @@ Metadata-Version: 2.1 Name: pycares -Version: 3.0.0 +Version: 3.1.1 Summary: Python interface for c-ares Home-page: http://github.com/saghul/pycares Author: Saúl Ibarra Corretgé Author-email: s...@saghul.net License: UNKNOWN -Description: - ==================================== - pycares: Python interface for c-ares +Description: pycares: Python interface for c-ares ==================================== .. image:: https://badge.fury.io/py/pycares.png @@ -20,19 +18,22 @@ .. image:: https://ci.appveyor.com/api/projects/status/vx1wbkfq3l7nm1m8?svg=true :target: https://ci.appveyor.com/project/saghul/pycares + .. image:: https://github.com/saghul/pycares/workflows/Test%20macOS/badge.svg + :target: https://github.com/saghul/pycares/actions) + pycares is a Python module which provides an interface to c-ares. `c-ares <http://c-ares.haxx.se>`_ is a C library that performs DNS requests and name resolutions asynchronously. Documentation - ============= + ------------- http://readthedocs.org/docs/pycares/ Bundled c-ares - ============== + -------------- pycares currently bundles c-ares and as of pycares 1.0.0 this is a strong requirement. Upstream c-ares is not willing to apply `a patch adding TTL support <http://c-ares.haxx.se/mail/c-ares-archive-2013-07/0005.shtml>`_. @@ -41,7 +42,7 @@ Installation - ============ + ------------ GNU/Linux, macOS, Windows, others: @@ -70,7 +71,7 @@ Running the test suite - ====================== + ---------------------- There are several ways of running the test ruite: @@ -85,7 +86,7 @@ Using it from the cli, a la dig - =============================== + ------------------------------- This module can be used directly from the command line in a similar fashion to dig (limited, of course): @@ -111,31 +112,30 @@ Author - ====== + ------ Saúl Ibarra Corretgé <s...@saghul.net> License - ======= + ------- Unless stated otherwise on-file pycares uses the MIT license, check LICENSE file. Supported Python versions - ========================= + ------------------------- Python >= 3.5 are supported. Both CPython and PyPy are supported. Contributing - ============ + ------------ If you'd like to contribute, fork the project, make a patch and send a pull request. Have a look at the surrounding code and please, make yours look alike :-) - Platform: POSIX Platform: Microsoft Windows Classifier: Development Status :: 5 - Production/Stable @@ -148,6 +148,8 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy +Description-Content-Type: text/x-rst Provides-Extra: idna diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycares-3.0.0/src/pycares.egg-info/SOURCES.txt new/pycares-3.1.1/src/pycares.egg-info/SOURCES.txt --- old/pycares-3.0.0/src/pycares.egg-info/SOURCES.txt 2019-03-02 12:39:09.000000000 +0100 +++ new/pycares-3.1.1/src/pycares.egg-info/SOURCES.txt 2020-01-09 23:03:41.000000000 +0100 @@ -85,6 +85,7 @@ deps/c-ares/src/setup_once.h deps/c-ares/src/windows_port.c deps/c-ares/src/config_android/ares_config.h +deps/c-ares/src/config_cygwin/ares_config.h deps/c-ares/src/config_darwin/ares_config.h deps/c-ares/src/config_freebsd/ares_config.h deps/c-ares/src/config_linux/ares_config.h diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycares-3.0.0/tests/tests.py new/pycares-3.1.1/tests/tests.py --- old/pycares-3.0.0/tests/tests.py 2019-02-15 00:12:16.000000000 +0100 +++ new/pycares-3.1.1/tests/tests.py 2020-01-09 23:03:35.000000000 +0100 @@ -203,9 +203,10 @@ self.channel.query('s-pulse.co.jp', pycares.QUERY_TYPE_TXT, cb) self.wait() self.assertNoError(self.errorno) - # s-pulse.co.jp. 3600 IN TXT "MS=ms18955624" - # s-pulse.co.jp. 3600 IN TXT "v=spf1 " "include:spf-bma.mpme.jp ip4:202.248.11.9 ip4:202.248.11.10 " "ip4:218.223.68.132 ip4:218.223.68.77 ip4:210.254.139.121 " "ip4:211.128.73.121 ip4:210.254.139.122 ip4:211.128.73.122 " "ip4:210.254.139.123 ip4:211.128.73.123 ip4:210.254.139.124 " "ip4:211.128.73.124 ip4:210.254.139.13 ip4:211.128.73.13 " "ip4:52.68.199.198 include:spf.betrend.com " "include:spf.protection.outlook.com " "~all" - self.assertEqual(len(self.result), 2) + # s-pulse.co.jp. 3600 IN TXT "MS=ms18955624" + # s-pulse.co.jp. 3600 IN TXT "amazonses:lOgEcA9DwKFkIusIbgjpvZ2kCxaVADMlaxq9hSO3k4o=" + # s-pulse.co.jp. 3600 IN TXT "v=spf1 " "include:spf-bma.mpme.jp ip4:202.248.11.9 ip4:202.248.11.10 " "ip4:218.223.68.132 ip4:218.223.68.77 ip4:210.254.139.121 " "ip4:211.128.73.121 ip4:210.254.139.122 ip4:211.128.73.122 " "ip4:210.254.139.123 ip4:211.128.73.123 ip4:210.254.139.124 " "ip4:211.128.73.124 ip4:210.254.139.13 ip4:211.128.73.13 " "ip4:52.68.199.198 include:spf.betrend.com " "include:spf.protection.outlook.com include:crmstyle.com " "~all" + self.assertEqual(len(self.result), 3) def test_query_txt_bytes1(self): self.result, self.errorno = None, None @@ -231,6 +232,21 @@ self.assertIsInstance(r.text, bytes) self.assertTrue(r.ttl >= 0) + def test_query_txt_multiple_chunked_with_non_ascii_content(self): + self.result, self.errorno = None, None + def cb(result, errorno): + self.result, self.errorno = result, errorno + self.channel.query('txt-non-ascii.dns-test.hmnid.ru', pycares.QUERY_TYPE_TXT, cb) + self.wait() + self.assertNoError(self.errorno) + # txt-non-ascii.dns-test.hmnid.ru. IN TXT "ascii string" "some\208misc\208stuff" + + self.assertEqual(len(self.result), 1) + r = self.result[0] + self.assertEqual(type(r), pycares.ares_query_txt_result) + self.assertIsInstance(r.text, bytes) + self.assertTrue(r.ttl >= 0) + def test_query_soa(self): self.result, self.errorno = None, None def cb(result, errorno): @@ -324,6 +340,15 @@ self.assertEqual(self.result, None) self.assertEqual(self.errorno, pycares.errno.ARES_ETIMEOUT) + def test_query_onion(self): + self.result, self.errorno = None, None + def cb(result, errorno): + self.result, self.errorno = result, errorno + self.channel.query('foo.onion', pycares.QUERY_TYPE_A, cb) + self.wait() + self.assertEqual(self.result, None) + self.assertEqual(self.errorno, pycares.errno.ARES_ENOTFOUND) + def test_channel_nameservers(self): self.result, self.errorno = None, None def cb(result, errorno): @@ -370,13 +395,6 @@ self.assertEqual(self.errorno, pycares.errno.ARES_ECONNREFUSED) self.assertRaises(ValueError, self.channel.set_local_ip, 'an invalid ip') - def test_channel_local_dev(self): - ''' - Comments in c-ares say this only works for root, and ares ignores - errors. So we won't test it. - ''' - pass - def test_channel_timeout(self): self.result, self.errorno = None, None def cb(result, errorno): @@ -398,18 +416,6 @@ self.result, self.errorno = None, None def cb(result, errorno): self.result, self.errorno = result, errorno - self.channel.query('xn--cardeosapeluqueros-r0b.com', pycares.QUERY_TYPE_MX, cb) - self.wait() - self.assertNoError(self.errorno) - for r in self.result: - self.assertEqual(type(r), pycares.ares_query_mx_result) - self.assertIsInstance(r.host, bytes) # it's not ASCII - self.assertTrue(r.ttl >= 0) - - def test_result_not_ascii2(self): - self.result, self.errorno = None, None - def cb(result, errorno): - self.result, self.errorno = result, errorno self.channel.query('ayesas.com', pycares.QUERY_TYPE_SOA, cb) self.wait() self.assertNoError(self.errorno) @@ -494,6 +500,45 @@ self.assertEqual(type(r), pycares.ares_query_a_result) self.assertNotEqual(r.host, None) + def test_lookup(self): + channel = pycares.Channel( + lookups="b", + timeout=1, + tries=1, + socket_receive_buffer_size=4096, + servers=["8.8.8.8", "8.8.4.4"], + tcp_port=53, + udp_port=53, + rotate=True, + ) + + def on_result(result, errorno): + self.result, self.errorno = result, errorno + + for domain in [ + "google.com", + "microsoft.com", + "apple.com", + "amazon.com", + "baidu.com", + "alipay.com", + "tencent.com", + ]: + self.result, self.errorno = None, None + self.channel.query(domain, pycares.QUERY_TYPE_A, on_result) + self.wait() + self.assertNoError(self.errorno) + self.assertTrue(self.result is not None and len(self.result) > 0) + for r in self.result: + self.assertEqual(type(r), pycares.ares_query_a_result) + self.assertNotEqual(r.host, None) + self.assertTrue(r.type == 'A') + self.assertTrue(r.ttl >= 0) + + def test_strerror_str(self): + for key in pycares.errno.errorcode: + self.assertTrue(type(pycares.errno.strerror(key)), str) + if __name__ == '__main__': unittest.main(verbosity=2)