From b07e34e0b892283b7b2bcb88e473806dff67dce0 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sat, 22 Sep 2018 18:54:55 -0700 Subject: [PATCH] Prefer https:// URLs when available --- .appveyor.yml | 4 ++-- LICENSE | 2 +- NEWS | 2 +- doc/src/advanced.rst | 20 ++++++++--------- doc/src/conf.py | 6 +++--- doc/src/connection.rst | 44 +++++++++++++++++++------------------- doc/src/cursor.rst | 16 +++++++------- doc/src/errorcodes.rst | 2 +- doc/src/extensions.rst | 22 +++++++++---------- doc/src/extras.rst | 12 +++++------ doc/src/faq.rst | 12 +++++------ doc/src/index.rst | 6 +++--- doc/src/install.rst | 12 +++++------ doc/src/module.rst | 6 +++--- doc/src/usage.rst | 36 +++++++++++++++---------------- lib/__init__.py | 6 +++--- lib/errorcodes.py | 2 +- lib/extensions.py | 2 +- lib/extras.py | 6 +++--- lib/tz.py | 2 +- psycopg/diagnostics_type.c | 2 +- psycopg/green.h | 2 +- psycopg/pqpath.c | 2 +- psycopg/typecast_binary.c | 4 ++-- scripts/make_errorcodes.py | 2 +- setup.py | 2 +- tests/test_cursor.py | 2 +- tests/test_quote.py | 4 ++-- tests/testutils.py | 2 +- 29 files changed, 121 insertions(+), 121 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index d85d3eff..a2d9c348 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -12,7 +12,7 @@ environment: matrix: # For Python versions available on Appveyor, see - # http://www.appveyor.com/docs/installed-software#python + # https://www.appveyor.com/docs/build-environment/ - {PYVER: "27", PYTHON_ARCH: "32"} - {PYVER: "27", PYTHON_ARCH: "64"} - {PYVER: "34", PYTHON_ARCH: "32"} @@ -82,7 +82,7 @@ init: - "%PYTHON%\\python -c \"import sys; print('64bit: ' + str(sys.maxsize > 2**32))\"" # Get & Install NASM - #- curl -L -o nasminst.exe http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win64/nasm-2.12.02-installer-x64.exe && start /wait nasminst.exe /S + #- curl -L -o nasminst.exe https://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win64/nasm-2.12.02-installer-x64.exe && start /wait nasminst.exe /S #- SET PATH="C:\Program Files (x86)\nasm;%PATH%" # Fix problem with VS2008 Express and 64bit builds diff --git a/LICENSE b/LICENSE index 8974d779..9029e70f 100644 --- a/LICENSE +++ b/LICENSE @@ -25,7 +25,7 @@ statement from all source files in the program, then also delete it here. You should have received a copy of the GNU Lesser General Public License along with psycopg2 (see the doc/ directory.) -If not, see . +If not, see . Alternative licenses diff --git a/NEWS b/NEWS index 6602d933..9037604c 100644 --- a/NEWS +++ b/NEWS @@ -357,7 +357,7 @@ Other changes: - Dropped support for Python 2.4. Please use Psycopg 2.4.x if you need it. - `~psycopg2.errorcodes` map updated to PostgreSQL 9.2. - Dropped Zope adapter from source repository. ZPsycopgDA now has its own - project at . + project at . What's new in psycopg 2.4.6 diff --git a/doc/src/advanced.rst b/doc/src/advanced.rst index 724cb281..62873e79 100644 --- a/doc/src/advanced.rst +++ b/doc/src/advanced.rst @@ -156,7 +156,7 @@ geometric type: .. |point| replace:: :sql:`point` -.. _point: http://www.postgresql.org/docs/current/static/datatype-geometric.html#DATATYPE-GEOMETRIC +.. _point: https://www.postgresql.org/docs/current/static/datatype-geometric.html#DATATYPE-GEOMETRIC The above function call results in the SQL command:: @@ -259,9 +259,9 @@ documentation), you should keep the connection in `~connection.autocommit` mode if you wish to receive or send notifications in a timely manner. .. |LISTEN| replace:: :sql:`LISTEN` -.. _LISTEN: http://www.postgresql.org/docs/current/static/sql-listen.html +.. _LISTEN: https://www.postgresql.org/docs/current/static/sql-listen.html .. |NOTIFY| replace:: :sql:`NOTIFY` -.. _NOTIFY: http://www.postgresql.org/docs/current/static/sql-notify.html +.. _NOTIFY: https://www.postgresql.org/docs/current/static/sql-notify.html Notifications are received after every query execution. If the user is interested in receiving notifications but not in performing any query, the @@ -375,7 +375,7 @@ completely non-blocking connection attempt: see the libpq documentation for |PQconnectStart|_. .. |PQconnectStart| replace:: `!PQconnectStart()` -.. _PQconnectStart: http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PQCONNECTSTARTPARAMS +.. _PQconnectStart: https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PQCONNECTSTARTPARAMS The same loop should be also used to perform nonblocking queries: after sending a query via `~cursor.execute()` or `~cursor.callproc()`, call @@ -484,14 +484,14 @@ psycopg2 scope, as the callback can be tied to the libraries' implementation details. You can check the `psycogreen`_ project for further informations and resources about the topic. -.. _coroutine: http://en.wikipedia.org/wiki/Coroutine +.. _coroutine: https://en.wikipedia.org/wiki/Coroutine .. _greenlet: https://pypi.org/project/greenlet/ -.. _green threads: http://en.wikipedia.org/wiki/Green_threads -.. _Eventlet: http://eventlet.net/ +.. _green threads: https://en.wikipedia.org/wiki/Green_threads +.. _Eventlet: https://eventlet.net/ .. _gevent: http://www.gevent.org/ -.. _SQLAlchemy: http://www.sqlalchemy.org/ +.. _SQLAlchemy: https://www.sqlalchemy.org/ .. _psycogreen: http://bitbucket.org/dvarrazzo/psycogreen/ -.. __: http://www.postgresql.org/docs/current/static/libpq-async.html +.. __: https://www.postgresql.org/docs/current/static/libpq-async.html .. warning:: @@ -536,7 +536,7 @@ Server version 9.4 adds a new feature called *Logical Replication*. - PostgreSQL `Streaming Replication Protocol`__ - .. __: http://www.postgresql.org/docs/current/static/protocol-replication.html + .. __: https://www.postgresql.org/docs/current/static/protocol-replication.html Logical replication Quick-Start diff --git a/doc/src/conf.py b/doc/src/conf.py index 867afb7c..fa22a91f 100644 --- a/doc/src/conf.py +++ b/doc/src/conf.py @@ -116,12 +116,12 @@ todo_include_todos = False rst_epilog = """ .. |DBAPI| replace:: DB API 2.0 -.. _DBAPI: http://www.python.org/dev/peps/pep-0249/ +.. _DBAPI: https://www.python.org/dev/peps/pep-0249/ .. _transaction isolation level: - http://www.postgresql.org/docs/current/static/transaction-iso.html + https://www.postgresql.org/docs/current/static/transaction-iso.html -.. _mx.DateTime: http://www.egenix.com/products/python/mxBase/mxDateTime/ +.. _mx.DateTime: https://www.egenix.com/products/python/mxBase/mxDateTime/ .. |MVCC| replace:: :abbr:`MVCC (Multiversion concurrency control)` """ diff --git a/doc/src/connection.rst b/doc/src/connection.rst index 2910f301..6111c60e 100644 --- a/doc/src/connection.rst +++ b/doc/src/connection.rst @@ -198,7 +198,7 @@ The ``connection`` class .. seealso:: the |PREPARE TRANSACTION|_ PostgreSQL command. .. |PREPARE TRANSACTION| replace:: :sql:`PREPARE TRANSACTION` - .. _PREPARE TRANSACTION: http://www.postgresql.org/docs/current/static/sql-prepare-transaction.html + .. _PREPARE TRANSACTION: https://www.postgresql.org/docs/current/static/sql-prepare-transaction.html .. index:: @@ -224,7 +224,7 @@ The ``connection`` class .. seealso:: the |COMMIT PREPARED|_ PostgreSQL command. .. |COMMIT PREPARED| replace:: :sql:`COMMIT PREPARED` - .. _COMMIT PREPARED: http://www.postgresql.org/docs/current/static/sql-commit-prepared.html + .. _COMMIT PREPARED: https://www.postgresql.org/docs/current/static/sql-commit-prepared.html .. index:: @@ -246,7 +246,7 @@ The ``connection`` class .. seealso:: the |ROLLBACK PREPARED|_ PostgreSQL command. .. |ROLLBACK PREPARED| replace:: :sql:`ROLLBACK PREPARED` - .. _ROLLBACK PREPARED: http://www.postgresql.org/docs/current/static/sql-rollback-prepared.html + .. _ROLLBACK PREPARED: https://www.postgresql.org/docs/current/static/sql-rollback-prepared.html .. index:: @@ -267,7 +267,7 @@ The ``connection`` class transactions initiated by a program using such driver should be unpacked correctly. - .. __: http://jdbc.postgresql.org/ + .. __: https://jdbc.postgresql.org/ Xids returned by `!tpc_recover()` also have extra attributes `~psycopg2.extensions.Xid.prepared`, `~psycopg2.extensions.Xid.owner`, @@ -277,7 +277,7 @@ The ``connection`` class .. seealso:: the |pg_prepared_xacts|_ system view. .. |pg_prepared_xacts| replace:: `pg_prepared_xacts` - .. _pg_prepared_xacts: http://www.postgresql.org/docs/current/static/view-pg-prepared-xacts.html + .. _pg_prepared_xacts: https://www.postgresql.org/docs/current/static/view-pg-prepared-xacts.html @@ -309,7 +309,7 @@ The ``connection`` class |PQcancel|_. .. |PQcancel| replace:: `!PQcancel()` - .. _PQcancel: http://www.postgresql.org/docs/current/static/libpq-cancel.html#LIBPQ-PQCANCEL + .. _PQcancel: https://www.postgresql.org/docs/current/static/libpq-cancel.html#LIBPQ-PQCANCEL .. versionadded:: 2.3 @@ -325,10 +325,10 @@ The ``connection`` class available for recover. .. |RESET| replace:: :sql:`RESET` - .. _RESET: http://www.postgresql.org/docs/current/static/sql-reset.html + .. _RESET: https://www.postgresql.org/docs/current/static/sql-reset.html .. |SET SESSION AUTHORIZATION| replace:: :sql:`SET SESSION AUTHORIZATION` - .. __: http://www.postgresql.org/docs/current/static/sql-set-session-authorization.html + .. __: https://www.postgresql.org/docs/current/static/sql-set-session-authorization.html .. versionadded:: 2.0.12 @@ -366,7 +366,7 @@ The ``connection`` class `autocommit` attribute. .. _isolation level: - http://www.postgresql.org/docs/current/static/transaction-iso.html + https://www.postgresql.org/docs/current/static/transaction-iso.html Arguments set to `!None` (the default for all) will not be changed. The parameters *isolation_level*, *readonly* and *deferrable* also @@ -376,11 +376,11 @@ The ``connection`` class |default_transaction_read_only|__, |default_transaction_deferrable|__. .. |default_transaction_isolation| replace:: :sql:`default_transaction_isolation` - .. __: http://www.postgresql.org/docs/current/static/runtime-config-client.html#GUC-DEFAULT-TRANSACTION-ISOLATION + .. __: https://www.postgresql.org/docs/current/static/runtime-config-client.html#GUC-DEFAULT-TRANSACTION-ISOLATION .. |default_transaction_read_only| replace:: :sql:`default_transaction_read_only` - .. __: http://www.postgresql.org/docs/current/static/runtime-config-client.html#GUC-DEFAULT-TRANSACTION-READ-ONLY + .. __: https://www.postgresql.org/docs/current/static/runtime-config-client.html#GUC-DEFAULT-TRANSACTION-READ-ONLY .. |default_transaction_deferrable| replace:: :sql:`default_transaction_deferrable` - .. __: http://www.postgresql.org/docs/current/static/runtime-config-client.html#GUC-DEFAULT-TRANSACTION-DEFERRABLE + .. __: https://www.postgresql.org/docs/current/static/runtime-config-client.html#GUC-DEFAULT-TRANSACTION-DEFERRABLE The function must be invoked with no transaction in progress. @@ -388,7 +388,7 @@ The ``connection`` class of the transaction parameters in the server. .. |SET TRANSACTION| replace:: :sql:`SET TRANSACTION` - .. _SET TRANSACTION: http://www.postgresql.org/docs/current/static/sql-set-transaction.html + .. _SET TRANSACTION: https://www.postgresql.org/docs/current/static/sql-set-transaction.html .. versionadded:: 2.4.2 @@ -534,7 +534,7 @@ The ``connection`` class is the encoding defined by the database. It should be one of the `characters set supported by PostgreSQL`__ - .. __: http://www.postgresql.org/docs/current/static/multibyte.html + .. __: https://www.postgresql.org/docs/current/static/multibyte.html .. index:: @@ -568,7 +568,7 @@ The ``connection`` class configuration parameters`__ such as ``log_statement``, ``client_min_messages``, ``log_min_duration_statement`` etc. - .. __: http://www.postgresql.org/docs/current/static/runtime-config-logging.html + .. __: https://www.postgresql.org/docs/current/static/runtime-config-logging.html .. attribute:: notifies @@ -612,7 +612,7 @@ The ``connection`` class .. seealso:: libpq docs for `PQbackendPID()`__ for details. - .. __: http://www.postgresql.org/docs/current/static/libpq-status.html#LIBPQ-PQBACKENDPID + .. __: https://www.postgresql.org/docs/current/static/libpq-status.html#LIBPQ-PQBACKENDPID .. versionadded:: 2.0.8 @@ -633,7 +633,7 @@ The ``connection`` class .. seealso:: libpq docs for `PQparameterStatus()`__ for details. - .. __: http://www.postgresql.org/docs/current/static/libpq-status.html#LIBPQ-PQPARAMETERSTATUS + .. __: https://www.postgresql.org/docs/current/static/libpq-status.html#LIBPQ-PQPARAMETERSTATUS .. versionadded:: 2.0.12 @@ -656,7 +656,7 @@ The ``connection`` class .. seealso:: libpq docs for `PQconninfo()`__ for details. - .. __: http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PQCONNINFO + .. __: https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PQCONNINFO .. versionadded:: 2.7 @@ -673,7 +673,7 @@ The ``connection`` class .. seealso:: libpq docs for `PQtransactionStatus()`__ for details. - .. __: http://www.postgresql.org/docs/current/static/libpq-status.html#LIBPQ-PQTRANSACTIONSTATUS + .. __: https://www.postgresql.org/docs/current/static/libpq-status.html#LIBPQ-PQTRANSACTIONSTATUS .. index:: @@ -688,7 +688,7 @@ The ``connection`` class .. seealso:: libpq docs for `PQprotocolVersion()`__ for details. - .. __: http://www.postgresql.org/docs/current/static/libpq-status.html#LIBPQ-PQPROTOCOLVERSION + .. __: https://www.postgresql.org/docs/current/static/libpq-status.html#LIBPQ-PQPROTOCOLVERSION .. versionadded:: 2.0.12 @@ -706,7 +706,7 @@ The ``connection`` class .. seealso:: libpq docs for `PQserverVersion()`__ for details. - .. __: http://www.postgresql.org/docs/current/static/libpq-status.html#LIBPQ-PQSERVERVERSION + .. __: https://www.postgresql.org/docs/current/static/libpq-status.html#LIBPQ-PQSERVERVERSION .. versionadded:: 2.0.12 @@ -743,7 +743,7 @@ The ``connection`` class `~psycopg2.extensions.lobject` to be instantiated. .. |lo_import| replace:: `!lo_import()` - .. _lo_import: http://www.postgresql.org/docs/current/static/lo-interfaces.html#LO-IMPORT + .. _lo_import: https://www.postgresql.org/docs/current/static/lo-interfaces.html#LO-IMPORT Available values for *mode* are: diff --git a/doc/src/cursor.rst b/doc/src/cursor.rst index 5a6935e6..057ccbf9 100644 --- a/doc/src/cursor.rst +++ b/doc/src/cursor.rst @@ -67,10 +67,10 @@ The ``cursor`` class |execute*|_ methods yet. .. |pg_type| replace:: :sql:`pg_type` - .. _pg_type: http://www.postgresql.org/docs/current/static/catalog-pg-type.html - .. _PQgetlength: http://www.postgresql.org/docs/current/static/libpq-exec.html#LIBPQ-PQGETLENGTH - .. _PQfsize: http://www.postgresql.org/docs/current/static/libpq-exec.html#LIBPQ-PQFSIZE - .. _NUMERIC: http://www.postgresql.org/docs/current/static/datatype-numeric.html#DATATYPE-NUMERIC-DECIMAL + .. _pg_type: https://www.postgresql.org/docs/current/static/catalog-pg-type.html + .. _PQgetlength: https://www.postgresql.org/docs/current/static/libpq-exec.html#LIBPQ-PQGETLENGTH + .. _PQfsize: https://www.postgresql.org/docs/current/static/libpq-exec.html#LIBPQ-PQFSIZE + .. _NUMERIC: https://www.postgresql.org/docs/current/static/datatype-numeric.html#DATATYPE-NUMERIC-DECIMAL .. |NUMERIC| replace:: :sql:`NUMERIC` .. versionchanged:: 2.4 @@ -129,7 +129,7 @@ The ``cursor`` class backward scroll (see the |declare-notes|__). .. |declare-notes| replace:: :sql:`DECLARE` notes - .. __: http://www.postgresql.org/docs/current/static/sql-declare.html#SQL-DECLARE-NOTES + .. __: https://www.postgresql.org/docs/current/static/sql-declare.html#SQL-DECLARE-NOTES .. note:: @@ -430,10 +430,10 @@ The ``cursor`` class more flexibility. .. |CREATE-TABLE| replace:: :sql:`CREATE TABLE` - .. __: http://www.postgresql.org/docs/current/static/sql-createtable.html + .. __: https://www.postgresql.org/docs/current/static/sql-createtable.html .. |INSERT-RETURNING| replace:: :sql:`INSERT ... RETURNING` - .. __: http://www.postgresql.org/docs/current/static/sql-insert.html + .. __: https://www.postgresql.org/docs/current/static/sql-insert.html .. attribute:: query @@ -620,7 +620,7 @@ The ``cursor`` class ... .. |COPY| replace:: :sql:`COPY` - .. __: http://www.postgresql.org/docs/current/static/sql-copy.html + .. __: https://www.postgresql.org/docs/current/static/sql-copy.html .. versionadded:: 2.0.6 diff --git a/doc/src/errorcodes.rst b/doc/src/errorcodes.rst index ab49afb6..510d0f22 100644 --- a/doc/src/errorcodes.rst +++ b/doc/src/errorcodes.rst @@ -39,7 +39,7 @@ From PostgreSQL documentation: .. seealso:: `PostgreSQL Error Codes table`__ - .. __: http://www.postgresql.org/docs/current/static/errcodes-appendix.html#ERRCODES-TABLE + .. __: https://www.postgresql.org/docs/current/static/errcodes-appendix.html#ERRCODES-TABLE An example of the available constants defined in the module: diff --git a/doc/src/extensions.rst b/doc/src/extensions.rst index 34d53a7e..3e28008f 100644 --- a/doc/src/extensions.rst +++ b/doc/src/extensions.rst @@ -94,7 +94,7 @@ introspection etc. The method uses the efficient |lo_export|_ libpq function. .. |lo_export| replace:: `!lo_export()` - .. _lo_export: http://www.postgresql.org/docs/current/static/lo-interfaces.html#LO-EXPORT + .. _lo_export: https://www.postgresql.org/docs/current/static/lo-interfaces.html#LO-EXPORT .. method:: seek(offset, whence=0) @@ -125,7 +125,7 @@ introspection etc. libpq function. .. |lo_truncate| replace:: `!lo_truncate()` - .. _lo_truncate: http://www.postgresql.org/docs/current/static/lo-interfaces.html#LO-TRUNCATE + .. _lo_truncate: https://www.postgresql.org/docs/current/static/lo-interfaces.html#LO-TRUNCATE .. versionadded:: 2.2.0 @@ -423,8 +423,8 @@ details. Used by Psycopg when adapting or casting unicode strings. See :ref:`unicode-handling`. - .. __: http://www.postgresql.org/docs/current/static/multibyte.html - .. __: http://docs.python.org/library/codecs.html#standard-encodings + .. __: https://www.postgresql.org/docs/current/static/multibyte.html + .. __: https://docs.python.org/library/codecs.html#standard-encodings @@ -490,7 +490,7 @@ Other functions .. seealso:: libpq docs for `PQlibVersion()`__. - .. __: http://www.postgresql.org/docs/current/static/libpq-misc.html#LIBPQ-PQLIBVERSION + .. __: https://www.postgresql.org/docs/current/static/libpq-misc.html#LIBPQ-PQLIBVERSION .. function:: make_dsn(dsn=None, \*\*kwargs) @@ -524,7 +524,7 @@ Other functions `connection URIs`__ are only supported from libpq 9.2). Raise `~psycopg2.ProgrammingError` if the *dsn* is not valid. - .. __: http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING + .. __: https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING Example:: @@ -538,7 +538,7 @@ Other functions .. seealso:: libpq docs for `PQconninfoParse()`__. - .. __: http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PQCONNINFOPARSE + .. __: https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PQCONNINFOPARSE .. function:: quote_ident(str, scope) @@ -552,7 +552,7 @@ Other functions .. seealso:: libpq docs for `PQescapeIdentifier()`__ - .. __: http://www.postgresql.org/docs/current/static/libpq-exec.html#LIBPQ-PQESCAPEIDENTIFIER + .. __: https://www.postgresql.org/docs/current/static/libpq-exec.html#LIBPQ-PQESCAPEIDENTIFIER .. method:: encrypt_password(password, user, scope=None, algorithm=None) @@ -637,7 +637,7 @@ methods. The level can be set to one of the following constants: .. seealso:: `Read Committed Isolation Level`__ in PostgreSQL documentation. - .. __: http://www.postgresql.org/docs/current/static/transaction-iso.html#XACT-READ-COMMITTED + .. __: https://www.postgresql.org/docs/current/static/transaction-iso.html#XACT-READ-COMMITTED .. data:: ISOLATION_LEVEL_REPEATABLE_READ @@ -661,7 +661,7 @@ methods. The level can be set to one of the following constants: .. seealso:: `Repeatable Read Isolation Level`__ in PostgreSQL documentation. - .. __: http://www.postgresql.org/docs/current/static/transaction-iso.html#XACT-REPEATABLE-READ + .. __: https://www.postgresql.org/docs/current/static/transaction-iso.html#XACT-REPEATABLE-READ .. data:: ISOLATION_LEVEL_SERIALIZABLE @@ -680,7 +680,7 @@ methods. The level can be set to one of the following constants: .. seealso:: `Serializable Isolation Level`__ in PostgreSQL documentation. - .. __: http://www.postgresql.org/docs/current/static/transaction-iso.html#XACT-SERIALIZABLE + .. __: https://www.postgresql.org/docs/current/static/transaction-iso.html#XACT-SERIALIZABLE .. data:: ISOLATION_LEVEL_DEFAULT diff --git a/doc/src/extras.rst b/doc/src/extras.rst index 15f35e80..e9117820 100644 --- a/doc/src/extras.rst +++ b/doc/src/extras.rst @@ -542,10 +542,10 @@ fields to JSON) you can use the `register_json()` function. The Python :py:mod:`json` module is used by default to convert Python objects to JSON and to parse data from the database. -.. _JSON: http://www.json.org/ +.. _JSON: https://www.json.org/ .. |pgjson| replace:: :sql:`json` .. |jsonb| replace:: :sql:`jsonb` -.. _pgjson: http://www.postgresql.org/docs/current/static/datatype-json.html +.. _pgjson: https://www.postgresql.org/docs/current/static/datatype-json.html In order to pass a Python object to the database as query argument you can use the `Json` adapter:: @@ -664,7 +664,7 @@ can be enabled using the `register_hstore()` function. .. |hstore| replace:: :sql:`hstore` -.. _hstore: http://www.postgresql.org/docs/current/static/hstore.html +.. _hstore: https://www.postgresql.org/docs/current/static/hstore.html @@ -686,7 +686,7 @@ after a table row type) into a Python named tuple, or into a regular tuple if :py:func:`collections.namedtuple` is not found. .. |CREATE TYPE| replace:: :sql:`CREATE TYPE` -.. _CREATE TYPE: http://www.postgresql.org/docs/current/static/sql-createtype.html +.. _CREATE TYPE: https://www.postgresql.org/docs/current/static/sql-createtype.html .. doctest:: @@ -800,7 +800,7 @@ PostgreSQL |range|_ types. Builtin |range| types are supported out-of-the-box; user-defined |range| types can be adapted using `register_range()`. .. |range| replace:: :sql:`range` -.. _range: http://www.postgresql.org/docs/current/static/rangetypes.html +.. _range: https://www.postgresql.org/docs/current/static/rangetypes.html .. autoclass:: Range @@ -809,7 +809,7 @@ user-defined |range| types can be adapted using `register_range()`. features: it doesn't perform normalization and doesn't implement all the operators__ supported by the database. - .. __: http://www.postgresql.org/docs/current/static/functions-range.html#RANGE-OPERATORS-TABLE + .. __: https://www.postgresql.org/docs/current/static/functions-range.html#RANGE-OPERATORS-TABLE `!Range` objects are immutable, hashable, and support the ``in`` operator (checking if an element is within the range). They can be tested for diff --git a/doc/src/faq.rst b/doc/src/faq.rst index 5824d2b4..432e994a 100644 --- a/doc/src/faq.rst +++ b/doc/src/faq.rst @@ -40,7 +40,7 @@ I receive the error *current transaction is aborted, commands ignored until end PostgreSQL supports nested transactions using the |SAVEPOINT|_ command). .. |SAVEPOINT| replace:: :sql:`SAVEPOINT` - .. _SAVEPOINT: http://www.postgresql.org/docs/current/static/sql-savepoint.html + .. _SAVEPOINT: https://www.postgresql.org/docs/current/static/sql-savepoint.html .. _faq-transaction-aborted-multiprocess: @@ -184,8 +184,8 @@ Transferring binary data from PostgreSQL 9.0 doesn't work. session before reading binary data; - upgrade the libpq library on the client to at least 9.0. - .. __: http://www.postgresql.org/docs/current/static/datatype-binary.html - .. __: http://www.postgresql.org/docs/current/static/runtime-config-client.html#GUC-BYTEA-OUTPUT + .. __: https://www.postgresql.org/docs/current/static/datatype-binary.html + .. __: https://www.postgresql.org/docs/current/static/runtime-config-client.html#GUC-BYTEA-OUTPUT .. _faq-array: @@ -318,7 +318,7 @@ I can't compile `!psycopg2`: the compiler says *error: libpq-fe.h: No such file :program:`pg_config` at install time and the libpq at runtime. .. |lo_truncate| replace:: `!lo_truncate()` - .. _lo_truncate: http://www.postgresql.org/docs/current/static/lo-interfaces.html#LO-TRUNCATE + .. _lo_truncate: https://www.postgresql.org/docs/current/static/lo-interfaces.html#LO-TRUNCATE .. _faq-import-mod_wsgi: @@ -332,5 +332,5 @@ Psycopg raises *ImportError: cannot import name tz* on import in mod_wsgi / ASP, use the WSGIPythonEggs__ directive. .. _egg: http://peak.telecommunity.com/DevCenter/PythonEggs - .. __: http://stackoverflow.com/questions/2192323/what-is-the-python-egg-cache-python-egg-cache - .. __: http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPythonEggs + .. __: https://stackoverflow.com/questions/2192323/what-is-the-python-egg-cache-python-egg-cache + .. __: https://modwsgi.readthedocs.io/en/develop/configuration-directives/WSGIPythonEggs.html diff --git a/doc/src/index.rst b/doc/src/index.rst index 7ae073d7..ecf9c383 100644 --- a/doc/src/index.rst +++ b/doc/src/index.rst @@ -24,9 +24,9 @@ Psycopg 2 is both Unicode and Python 3 friendly. .. _Psycopg: http://initd.org/psycopg/ -.. _PostgreSQL: http://www.postgresql.org/ -.. _Python: http://www.python.org/ -.. _libpq: http://www.postgresql.org/docs/current/static/libpq.html +.. _PostgreSQL: https://www.postgresql.org/ +.. _Python: https://www.python.org/ +.. _libpq: https://www.postgresql.org/docs/current/static/libpq.html .. rubric:: Contents diff --git a/doc/src/install.rst b/doc/src/install.rst index f4b00ec3..34845b0e 100644 --- a/doc/src/install.rst +++ b/doc/src/install.rst @@ -12,11 +12,11 @@ to use Psycopg on a different Python implementation (PyPy, Jython, IronPython) there is an experimental `porting of Psycopg for Ctypes`__, but it is not as mature as the C implementation yet. -.. _PostgreSQL: http://www.postgresql.org/ -.. _Python: http://www.python.org/ -.. _libpq: http://www.postgresql.org/docs/current/static/libpq.html -.. _CPython: http://en.wikipedia.org/wiki/CPython -.. _Ctypes: http://docs.python.org/library/ctypes.html +.. _PostgreSQL: https://www.postgresql.org/ +.. _Python: https://www.python.org/ +.. _libpq: https://www.postgresql.org/docs/current/static/libpq.html +.. _CPython: https://en.wikipedia.org/wiki/CPython +.. _Ctypes: https://docs.python.org/library/ctypes.html .. __: https://github.com/mvantellingen/psycopg2-ctypes @@ -152,7 +152,7 @@ using something like ``pip install -U pip``), then you can run: .. __: PyPI-binary_ .. _PyPI-binary: https://pypi.org/project/psycopg2-binary/ -.. _wheel: http://pythonwheels.com/ +.. _wheel: https://pythonwheels.com/ .. note:: diff --git a/doc/src/module.rst b/doc/src/module.rst index 1c998252..034c7bb0 100644 --- a/doc/src/module.rst +++ b/doc/src/module.rst @@ -50,11 +50,11 @@ The module interface respects the standard defined in the |DBAPI|_. using `environment variables`__. .. __: - .. _connstring: http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING + .. _connstring: https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING .. __: - .. _connparams: http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PARAMKEYWORDS + .. _connparams: https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PARAMKEYWORDS .. __: - .. _connenvvars: http://www.postgresql.org/docs/current/static/libpq-envars.html + .. _connenvvars: https://www.postgresql.org/docs/current/static/libpq-envars.html Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object diff --git a/doc/src/usage.rst b/doc/src/usage.rst index db8674c1..361f2bd5 100644 --- a/doc/src/usage.rst +++ b/doc/src/usage.rst @@ -198,8 +198,8 @@ called `SQL injection`_ and is known to be one of the most widespread forms of attack to database servers. Before continuing, please print `this page`__ as a memo and hang it onto your desk. -.. _SQL injection: http://en.wikipedia.org/wiki/SQL_injection -.. __: http://xkcd.com/327/ +.. _SQL injection: https://en.wikipedia.org/wiki/SQL_injection +.. __: https://xkcd.com/327/ Psycopg can `automatically convert Python objects to and from SQL literals`__: using this feature your code will be more robust and @@ -351,7 +351,7 @@ converted into `!Decimal`. This of course may imply a loss of precision. .. seealso:: `PostgreSQL numeric types - `__ + `__ .. index:: @@ -391,8 +391,8 @@ defined on the database connection (the `PostgreSQL encoding`__, available in >>> cur.execute("INSERT INTO test (num, data) VALUES (%s,%s);", (74, u)) -.. __: http://www.postgresql.org/docs/current/static/multibyte.html -.. __: http://docs.python.org/library/codecs.html#standard-encodings +.. __: https://www.postgresql.org/docs/current/static/multibyte.html +.. __: https://docs.python.org/library/codecs.html When reading data from the database, in Python 2 the strings returned are usually 8 bit `!str` objects encoded in the database client encoding:: @@ -465,7 +465,7 @@ type `!str`). Any object implementing the `Revised Buffer Protocol`__ should be usable as binary type. Received data is returned as `!buffer` (in Python 2) or `!memoryview` (in Python 3). -.. __: http://www.python.org/dev/peps/pep-3118/ +.. __: https://www.python.org/dev/peps/pep-3118/ .. versionchanged:: 2.4 only strings were supported before. @@ -494,8 +494,8 @@ or `!memoryview` (in Python 3). server configuration file or in the client session (using a query such as ``SET bytea_output TO escape;``) before receiving binary data. - .. __: http://www.postgresql.org/docs/current/static/datatype-binary.html - .. __: http://www.postgresql.org/docs/current/static/runtime-config-client.html#GUC-BYTEA-OUTPUT + .. __: https://www.postgresql.org/docs/current/static/datatype-binary.html + .. __: https://www.postgresql.org/docs/current/static/runtime-config-client.html#GUC-BYTEA-OUTPUT .. index:: @@ -527,7 +527,7 @@ the same way:: "SELECT '38 days 6027.425337 seconds';" .. seealso:: `PostgreSQL date/time types - `__ + `__ .. index:: @@ -622,7 +622,7 @@ Python lists are converted into PostgreSQL :sql:`ARRAY`\ s:: Furthermore :sql:`ANY` can also work with empty lists, whereas :sql:`IN ()` is a SQL syntax error. - .. __: http://www.postgresql.org/docs/current/static/functions-subquery.html#FUNCTIONS-SUBQUERY-ANY-SOME + .. __: https://www.postgresql.org/docs/current/static/functions-subquery.html#FUNCTIONS-SUBQUERY-ANY-SOME .. note:: @@ -846,7 +846,7 @@ lifetime extends well after `~connection.commit()`, calling .. |DECLARE| replace:: :sql:`DECLARE` -.. _DECLARE: http://www.postgresql.org/docs/current/static/sql-declare.html +.. _DECLARE: https://www.postgresql.org/docs/current/static/sql-declare.html @@ -876,7 +876,7 @@ forked processes`__, so when using a module such as `multiprocessing` or a forking web deploy method such as FastCGI make sure to create the connections *after* the fork. -.. __: http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNECT +.. __: https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNECT Connections shouldn't be shared either by different green threads: see :ref:`green-support` for further details. @@ -920,7 +920,7 @@ Please refer to the documentation of the single methods for details and examples. .. |COPY| replace:: :sql:`COPY` -.. __: http://www.postgresql.org/docs/current/static/sql-copy.html +.. __: https://www.postgresql.org/docs/current/static/sql-copy.html @@ -937,7 +937,7 @@ access to user data that is stored in a special large-object structure. They are useful with data values too large to be manipulated conveniently as a whole. -.. __: http://www.postgresql.org/docs/current/static/largeobjects.html +.. __: https://www.postgresql.org/docs/current/static/largeobjects.html Psycopg allows access to the large object using the `~psycopg2.extensions.lobject` class. Objects are generated using the @@ -948,9 +948,9 @@ Psycopg large object support efficient import/export with file system files using the |lo_import|_ and |lo_export|_ libpq functions. .. |lo_import| replace:: `!lo_import()` -.. _lo_import: http://www.postgresql.org/docs/current/static/lo-interfaces.html#LO-IMPORT +.. _lo_import: https://www.postgresql.org/docs/current/static/lo-interfaces.html#LO-IMPORT .. |lo_export| replace:: `!lo_export()` -.. _lo_export: http://www.postgresql.org/docs/current/static/lo-interfaces.html#LO-EXPORT +.. _lo_export: https://www.postgresql.org/docs/current/static/lo-interfaces.html#LO-EXPORT .. versionchanged:: 2.6 added support for large objects greated than 2GB. Note that the support is @@ -1014,5 +1014,5 @@ transactions produced by a Java program. For further details see the documentation for the above methods. -.. __: http://www.opengroup.org/bookstore/catalog/c193.htm -.. __: http://jdbc.postgresql.org/ +.. __: https://publications.opengroup.org/c193 +.. __: https://jdbc.postgresql.org/ diff --git a/lib/__init__.py b/lib/__init__.py index cbec98fd..b88d59c7 100644 --- a/lib/__init__.py +++ b/lib/__init__.py @@ -8,8 +8,8 @@ small and fast, and stable as a rock. Homepage: http://initd.org/projects/psycopg2 -.. _PostgreSQL: http://www.postgresql.org/ -.. _Python: http://www.python.org/ +.. _PostgreSQL: https://www.postgresql.org/ +.. _Python: https://www.python.org/ :Groups: * `Connections creation`: connect @@ -43,7 +43,7 @@ Homepage: http://initd.org/projects/psycopg2 # Note: the first internal import should be _psycopg, otherwise the real cause # of a failed loading of the C module may get hidden, see -# http://archives.postgresql.org/psycopg/2011-02/msg00044.php +# https://archives.postgresql.org/psycopg/2011-02/msg00044.php # Import the DBAPI-2.0 stuff into top-level module. diff --git a/lib/errorcodes.py b/lib/errorcodes.py index b8742f52..99a6ecd5 100644 --- a/lib/errorcodes.py +++ b/lib/errorcodes.py @@ -26,7 +26,7 @@ This module contains symbolic names for all PostgreSQL error codes. # # Based on: # -# http://www.postgresql.org/docs/current/static/errcodes-appendix.html +# https://www.postgresql.org/docs/current/static/errcodes-appendix.html # diff --git a/lib/extensions.py b/lib/extensions.py index 3661e6cd..3111d415 100644 --- a/lib/extensions.py +++ b/lib/extensions.py @@ -8,7 +8,7 @@ This module holds all the extensions to the DBAPI-2.0 provided by psycopg. - `adapt()` -- exposes the PEP-246_ compatible adapting mechanism used by psycopg to adapt Python types to PostgreSQL ones -.. _PEP-246: http://www.python.org/peps/pep-0246.html +.. _PEP-246: https://www.python.org/dev/peps/pep-0246/ """ # psycopg/extensions.py - DBAPI-2.0 extensions specific to psycopg # diff --git a/lib/extras.py b/lib/extras.py index 024d7f32..af59d2f1 100644 --- a/lib/extras.py +++ b/lib/extras.py @@ -404,7 +404,7 @@ class NamedTupleCursor(_cursor): class LoggingConnection(_connection): """A connection that logs all queries to a file or logger__ object. - .. __: http://docs.python.org/library/logging.html + .. __: https://docs.python.org/library/logging.html """ def initialize(self, logobj): @@ -638,8 +638,8 @@ class ReplicationCursor(_replicationCursor): class UUID_adapter(object): """Adapt Python's uuid.UUID__ type to PostgreSQL's uuid__. - .. __: http://docs.python.org/library/uuid.html - .. __: http://www.postgresql.org/docs/current/static/datatype-uuid.html + .. __: https://docs.python.org/library/uuid.html + .. __: https://www.postgresql.org/docs/current/static/datatype-uuid.html """ def __init__(self, uuid): diff --git a/lib/tz.py b/lib/tz.py index d593175c..97f3857c 100644 --- a/lib/tz.py +++ b/lib/tz.py @@ -44,7 +44,7 @@ class FixedOffsetTimezone(datetime.tzinfo): offset and name that instance will be returned. This saves memory and improves comparability. - .. __: http://docs.python.org/library/datetime.html#datetime-tzinfo + .. __: https://docs.python.org/library/datetime.html """ _name = None _offset = ZERO diff --git a/psycopg/diagnostics_type.c b/psycopg/diagnostics_type.c index 0af65265..e5e4f7c2 100644 --- a/psycopg/diagnostics_type.c +++ b/psycopg/diagnostics_type.c @@ -152,7 +152,7 @@ static const char diagnosticsType_doc[] = "Please refer to the `PostgreSQL documentation`__ for the meaning of all" " the attributes.\n\n" ".. |PQresultErrorField| replace:: `!PQresultErrorField()`\n" - ".. _PQresultErrorField: http://www.postgresql.org/docs/current/static/" + ".. _PQresultErrorField: https://www.postgresql.org/docs/current/static/" "libpq-exec.html#LIBPQ-PQRESULTERRORFIELD\n" ".. __: PQresultErrorField_\n"; diff --git a/psycopg/green.h b/psycopg/green.h index 4057ff7c..7d95f9c7 100644 --- a/psycopg/green.h +++ b/psycopg/green.h @@ -48,7 +48,7 @@ extern "C" { "See `~psycopg2.extras.wait_select()` for an example of a wait callback\n" \ "implementation.\n" \ "\n" \ -".. _Eventlet: http://eventlet.net/\n" \ +".. _Eventlet: https://eventlet.net/\n" \ ".. _gevent: http://www.gevent.org/\n" HIDDEN PyObject *psyco_set_wait_callback(PyObject *self, PyObject *obj); diff --git a/psycopg/pqpath.c b/psycopg/pqpath.c index 204a6b00..de2b9baa 100644 --- a/psycopg/pqpath.c +++ b/psycopg/pqpath.c @@ -79,7 +79,7 @@ strip_severity(const char *msg) /* Returns the Python exception corresponding to an SQLSTATE error code. A list of error codes can be found at: - http://www.postgresql.org/docs/current/static/errcodes-appendix.html */ + https://www.postgresql.org/docs/current/static/errcodes-appendix.html */ BORROWED static PyObject * exception_from_sqlstate(const char *sqlstate) { diff --git a/psycopg/typecast_binary.c b/psycopg/typecast_binary.c index e4839dab..8226d3f4 100644 --- a/psycopg/typecast_binary.c +++ b/psycopg/typecast_binary.c @@ -212,7 +212,7 @@ static const char hex_lut[128] = { /* Parse a bytea output buffer encoded in 'hex' format. * * the format is described in - * http://www.postgresql.org/docs/current/static/datatype-binary.html + * https://www.postgresql.org/docs/current/static/datatype-binary.html * * Parse the buffer in 'bufin', whose length is 'sizein'. * Return a new buffer allocated by PyMem_Malloc and set 'sizeout' to its size. @@ -262,7 +262,7 @@ exit: /* Parse a bytea output buffer encoded in 'escape' format. * * the format is described in - * http://www.postgresql.org/docs/current/static/datatype-binary.html + * https://www.postgresql.org/docs/current/static/datatype-binary.html * * Parse the buffer in 'bufin', whose length is 'sizein'. * Return a new buffer allocated by PyMem_Malloc and set 'sizeout' to its size. diff --git a/scripts/make_errorcodes.py b/scripts/make_errorcodes.py index aa5e4cd9..d85e6b83 100755 --- a/scripts/make_errorcodes.py +++ b/scripts/make_errorcodes.py @@ -130,7 +130,7 @@ def parse_errors_sgml(url): return classes, errors errors_sgml_url = \ - "http://www.postgresql.org/docs/%s/static/errcodes-appendix.html" + "https://www.postgresql.org/docs/%s/static/errcodes-appendix.html" errors_txt_url = \ "http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;" \ diff --git a/setup.py b/setup.py index 0241e24a..463e65f0 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,7 @@ try: except ImportError: import ConfigParser as configparser -# Take a look at http://www.python.org/dev/peps/pep-0440/ +# Take a look at https://www.python.org/dev/peps/pep-0440/ # for a consistent versioning pattern. PSYCOPG_VERSION = '2.8.dev0' diff --git a/tests/test_cursor.py b/tests/test_cursor.py index af44f9e5..37110db3 100755 --- a/tests/test_cursor.py +++ b/tests/test_cursor.py @@ -504,7 +504,7 @@ class CursorTests(ConnectingTestCase): def test_bad_subclass(self): # check that we get an error message instead of a segfault # for badly written subclasses. - # see http://stackoverflow.com/questions/22019341/ + # see https://stackoverflow.com/questions/22019341/ class StupidCursor(psycopg2.extensions.cursor): def __init__(self, *args, **kwargs): # I am stupid so not calling superclass init diff --git a/tests/test_quote.py b/tests/test_quote.py index fad6ceec..ee723506 100755 --- a/tests/test_quote.py +++ b/tests/test_quote.py @@ -46,8 +46,8 @@ class QuotingTestCase(ConnectingTestCase): The tests also check that no warning is raised ('escape_string_warning' should be on). - http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS - http://www.postgresql.org/docs/current/static/runtime-config-compatible.html + https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS + https://www.postgresql.org/docs/current/static/runtime-config-compatible.html """ def test_string(self): data = """some data with \t chars diff --git a/tests/testutils.py b/tests/testutils.py index 3bb72e20..11138f0e 100644 --- a/tests/testutils.py +++ b/tests/testutils.py @@ -50,7 +50,7 @@ else: # Silence warnings caused by the stubbornness of the Python unittest # maintainers -# http://bugs.python.org/issue9424 +# https://bugs.python.org/issue9424 if (not hasattr(unittest.TestCase, 'assert_') or unittest.TestCase.assert_ is not unittest.TestCase.assertTrue): # mavaff...