diff --git a/postgresql/__init__.py b/postgresql/__init__.py index 60ce8e5..1af6316 100644 --- a/postgresql/__init__.py +++ b/postgresql/__init__.py @@ -10,8 +10,6 @@ for information about Python. """ __all__ = [ - '__author__', - '__date__', '__version__', '__docformat__', 'version', @@ -27,11 +25,10 @@ # Optional. try: - from .project import version_info, version, \ - author as __author__, date as __date__ - __version__ = version + from .project import version_info, version except ImportError: pass +__version__ = version # Avoid importing these until requested. _pg_iri = _pg_driver = _pg_param = None diff --git a/postgresql/bin/pg_dotconf.py b/postgresql/bin/pg_dotconf.py index 31306e9..06599a6 100644 --- a/postgresql/bin/pg_dotconf.py +++ b/postgresql/bin/pg_dotconf.py @@ -39,8 +39,8 @@ def command(args): for line in sf: pl = configfile.parse_line(line) if pl is not None: - if comment not in line[pl[0].start]: - settings[line[pl[0]]] = unquote(line[pl[1]]) + if configfile.comment not in line[:pl[0].start]: + settings[line[pl[0]]] = configfile.unquote(line[pl[1]]) prev = None for p in ca[1:]: diff --git a/postgresql/project.py b/postgresql/project.py index 34ddf3a..8b60687 100644 --- a/postgresql/project.py +++ b/postgresql/project.py @@ -8,5 +8,5 @@ meaculpa = 'python-postgres' abstract = 'Driver and tools library for PostgreSQL' -version_info = (1, 3, 1) +version_info = (1, 3, 2) version = '.'.join(map(str, version_info)) diff --git a/postgresql/protocol/element3.py b/postgresql/protocol/element3.py index e5a9578..1f8579e 100644 --- a/postgresql/protocol/element3.py +++ b/postgresql/protocol/element3.py @@ -263,7 +263,7 @@ def extract_command(self): Strip all the *surrounding* digits and spaces from the command tag, and return that string. """ - return self.data.strip(b'\c\n\t 0123456789') or None + return self.data.strip(b'\r\n\t 0123456789') or None class Null(EmptyMessage): """ diff --git a/postgresql/python/command.py b/postgresql/python/command.py index 18685c2..e040659 100644 --- a/postgresql/python/command.py +++ b/postgresql/python/command.py @@ -57,7 +57,17 @@ from gettext import gettext as _ from traceback import print_exception -from pkgutil import get_loader as module_loader +from importlib.util import find_spec + +def module_loader(name): + """ + Return the loader of the named module, or None if it cannot be found. + (Replaces pkgutil.get_loader, which was removed in Python 3.14.) + """ + spec = find_spec(name) + if spec is None: + return None + return spec.loader class single_loader(object): """ @@ -220,7 +230,7 @@ def __init__(self, *args, **kw): self.register_backslash(r'\?', self.showhelp, "Show this help message.") self.register_backslash(r'\set', self.bs_set, - "Configure environment variables. \set without arguments to show all") + "Configure environment variables. \\set without arguments to show all") self.register_backslash(r'\E', self.bs_E, "Edit a file or a temporary script.") self.register_backslash(r'\i', self.bs_i, diff --git a/postgresql/types/__init__.py b/postgresql/types/__init__.py index 690e19f..12b2543 100644 --- a/postgresql/types/__init__.py +++ b/postgresql/types/__init__.py @@ -610,7 +610,7 @@ def column_names(self, get0 = get0, get1 = get1): def transform(self, *args, **kw): """ Make a new Row after processing the values with the callables associated - with the values either by index, \*args, or my column name, \*\*kw. + with the values either by index, *args, or my column name, **kw. >>> r=Row.from_sequence({'col1':0,'col2':1}, (1,'two')) >>> r.transform(str) diff --git a/readthedocs.yml b/readthedocs.yml deleted file mode 100644 index d75e54a..0000000 --- a/readthedocs.yml +++ /dev/null @@ -1,5 +0,0 @@ -build: - image: latest - -python: - version: 3.7