Hello community, here is the log from the commit of package i18nspector for openSUSE:Factory checked in at 2019-01-08 12:28:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/i18nspector (Old) and /work/SRC/openSUSE:Factory/.i18nspector.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "i18nspector" Tue Jan 8 12:28:44 2019 rev:28 rq:663181 version:0.25.7 Changes: -------- --- /work/SRC/openSUSE:Factory/i18nspector/i18nspector.changes 2018-05-29 10:40:28.994317514 +0200 +++ /work/SRC/openSUSE:Factory/.i18nspector.new.28833/i18nspector.changes 2019-01-08 12:31:08.484098044 +0100 @@ -1,0 +2,9 @@ +Sun Jan 6 13:12:18 UTC 2019 - Kyrill Detinov <lazy.k...@opensuse.org> + +- Update to 0.25.7. + * Drop support for Python < 3.3.3. + * Fix “FutureWarning: Possible nested set” warnings. + * Improve the build system. + * Improve documentation. + +------------------------------------------------------------------- Old: ---- i18nspector-0.25.6.tar.gz i18nspector-0.25.6.tar.gz.asc New: ---- i18nspector-0.25.7.tar.gz i18nspector-0.25.7.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ i18nspector.spec ++++++ --- /var/tmp/diff_new_pack.DxQjBX/_old 2019-01-08 12:31:08.952097535 +0100 +++ /var/tmp/diff_new_pack.DxQjBX/_new 2019-01-08 12:31:08.956097530 +0100 @@ -1,7 +1,7 @@ # # spec file for package i18nspector # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,12 +12,12 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: i18nspector -Version: 0.25.6 +Version: 0.25.7 Release: 0 Summary: Tool for Checking gettext POT/PO/MO Files License: MIT @@ -26,7 +26,7 @@ Source0: https://github.com/jwilk/i18nspector/releases/download/%{version}/%{name}-%{version}.tar.gz Source1: https://github.com/jwilk/i18nspector/releases/download/%{version}/%{name}-%{version}.tar.gz.asc Source2: %{name}.keyring -BuildRequires: python3-devel > 3.2 +BuildRequires: python3-devel >= 3.3.3 # Requires for tests. BuildRequires: python3-curses BuildRequires: python3-nose @@ -37,7 +37,7 @@ Requires: python3-rply BuildArch: noarch %if 0%{?suse_version} && 0%{?suse_version} < 1230 -Requires: python3 > 3.2 +Requires: python3 >= 3.3.3 %endif %description ++++++ i18nspector-0.25.6.tar.gz -> i18nspector-0.25.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/.pylintrc new/i18nspector-0.25.7/.pylintrc --- old/i18nspector-0.25.6/.pylintrc 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/.pylintrc 2018-12-20 20:02:24.000000000 +0100 @@ -1,3 +1,6 @@ +[MASTER] +load-plugins = pylint.extensions.check_elif + [MESSAGES CONTROL] disable = bad-builtin, @@ -12,6 +15,7 @@ no-else-return, no-self-use, redefined-variable-type, + subprocess-popen-preexec-fn, superfluous-parens, too-few-public-methods, too-many-arguments, @@ -24,9 +28,13 @@ too-many-return-statements, too-many-statements, +[BASIC] +no-docstring-rgx = .* + [REPORTS] reports = no -msg-template = {C}: {path}:{line}: {symbol} [{obj}] {msg} +score = no +msg-template = {path}:{line}: {C}: {symbol} [{obj}] {msg} [FORMAT] max-line-length = 140 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/Makefile new/i18nspector-0.25.7/Makefile --- old/i18nspector-0.25.6/Makefile 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/Makefile 2018-12-20 20:02:24.000000000 +0100 @@ -19,38 +19,40 @@ # SOFTWARE. PYTHON = python3 -INSTALL = install +INSTALL = $(if $(shell command -v ginstall;),ginstall,install) PREFIX = /usr/local DESTDIR = -exe = i18nspector - bindir = $(PREFIX)/bin -basedir = $(PREFIX)/share/$(exe) +basedir = $(PREFIX)/share/i18nspector mandir = $(PREFIX)/share/man .PHONY: all all: ; .PHONY: install -install: +install: i18nspector # binary: $(INSTALL) -d -m755 $(DESTDIR)$(bindir) python_exe=$$($(PYTHON) -c 'import sys; print(sys.executable)') && \ sed \ -e "1 s@^#!.*@#!$$python_exe@" \ -e "s#^basedir_fallback = .*#basedir_fallback = '$(basedir)/'#" \ - $(exe) > $(DESTDIR)$(bindir)/$(exe) - chmod 0755 $(DESTDIR)$(bindir)/$(exe) + $(<) > $(<).tmp + install $(<).tmp $(DESTDIR)$(bindir)/$(<) + rm $(<).tmp # library + data: ( find lib data -type f ! -name '*.py[co]' ) \ | xargs -t -I {} $(INSTALL) -p -D -m644 {} $(DESTDIR)$(basedir)/{} -ifeq "$(wildcard doc/$(exe).1)" "" +ifeq "$(DESTDIR)" "" + umask 022 && $(PYTHON) -m compileall -q $(basedir)/lib/ +endif +ifeq "$(wildcard doc/*.1)" "" # run "$(MAKE) -C doc" to build the manpage else # manual page: - $(INSTALL) -p -D -m644 doc/$(exe).1 $(DESTDIR)$(mandir)/man1/$(exe).1 + $(INSTALL) -p -D -m644 doc/$(<).1 $(DESTDIR)$(mandir)/man1/$(<).1 endif .PHONY: test @@ -61,5 +63,9 @@ clean: find . -type f -name '*.py[co]' -delete find . -type d -name '__pycache__' -delete + rm -f .coverage + rm -f *.tmp + +.error = GNU make is required # vim:ts=4 sts=4 sw=4 noet diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/data/string-formats new/i18nspector-0.25.7/data/string-formats --- old/i18nspector-0.25.6/data/string-formats 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/data/string-formats 2018-12-20 20:02:24.000000000 +0100 @@ -5,7 +5,7 @@ # https://www.gnu.org/software/gawk/manual/html_node/Printf.html boost = %d -# http://www.boost.org/doc/libs/release/libs/format/doc/format.html +# https://www.boost.org/doc/libs/1_68_0/libs/format/doc/format.html c = %d # http://man7.org/linux/man-pages/man3/printf.3.html @@ -34,7 +34,7 @@ # https://techbase.kde.org/Development/Tutorials/Localization/i18n kde-kuit = %1 -# http://api.kde.org/frameworks-api/frameworks5-apidocs/ki18n/html/prg_guide.html +# https://api.kde.org/frameworks/ki18n/html/prg_guide.html librep = %d # http://librep.sourceforge.net/librep-manual.html#Formatted%20Output @@ -43,16 +43,16 @@ # http://www.lispworks.com/documentation/HyperSpec/Body/22_c.htm lua = %d -# http://www.lua.org/manual/5.2/manual.html#pdf-string.format +# https://www.lua.org/manual/5.2/manual.html#pdf-string.format objc = %d -# https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html +# https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html object-pascal = %d # https://www.freepascal.org/docs-html/rtl/sysutils/format.html perl = %d -# http://perldoc.perl.org/functions/sprintf.html +# https://perldoc.perl.org/functions/sprintf.html perl-brace = {var} # https://metacpan.org/pod/Locale::TextDomain @@ -69,10 +69,10 @@ # https://docs.python.org/3/library/string.html#formatstrings qt = %1 -# http://doc.qt.io/qt-5/qstring.html#arg +# https://doc.qt.io/qt-5/qstring.html#arg qt-plural = %n -# http://doc.qt.io/qt-5/i18n-source-translation.html#handling-plurals +# https://doc.qt.io/qt-5/i18n-source-translation.html#handling-plurals scheme = ~A # https://people.csail.mit.edu/jaffer/slib/Format-Specification.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/data/tags new/i18nspector-0.25.7/data/tags --- old/i18nspector-0.25.6/data/tags 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/data/tags 2018-12-20 20:02:24.000000000 +0100 @@ -930,7 +930,7 @@ The only C format directive that the message uses is ``%n``. It is very atypical to use it alone in a C format string. references = - http://doc.qt.io/qt-5/i18n-source-translation.html#handling-plurals + https://doc.qt.io/qt-5/i18n-source-translation.html#handling-plurals printf(3) [range-flag-without-plural-string] @@ -1091,7 +1091,7 @@ * using ISO 2022 escape sequences, or * using UTF-8 despite declaring an 8-bit encoding. references = - http://www.unicode.org/faq/utf_bom.html#bom6 + https://www.unicode.org/faq/utf_bom.html#bom6 [unusual-character-in-translation] severity = important @@ -1103,7 +1103,7 @@ * using ISO 2022 escape sequences, or * using UTF-8 despite declaring an 8-bit encoding. references = - http://www.unicode.org/faq/utf_bom.html#bom6 + https://www.unicode.org/faq/utf_bom.html#bom6 [unusual-plural-forms] severity = serious diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/doc/Makefile new/i18nspector-0.25.7/doc/Makefile --- old/i18nspector-0.25.6/doc/Makefile 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/doc/Makefile 2018-12-20 20:02:24.000000000 +0100 @@ -20,7 +20,7 @@ export LC_ALL=C -rst2man = $(or $(shell which rst2man),rst2man.py) +rst2man = $(notdir $(shell command -v rst2man || echo rst2man.py)) exe = i18nspector .PHONY: all @@ -42,4 +42,6 @@ clean: rm -f tags.rst $(exe).1 *.tmp +.error = GNU make is required + # vim:ts=4 sts=4 sw=4 noet diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/doc/README new/i18nspector-0.25.7/doc/README --- old/i18nspector-0.25.6/doc/README 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/doc/README 2018-12-20 20:02:24.000000000 +0100 @@ -11,7 +11,7 @@ The following software is needed to run i18nspector: -* Python ≥ 3.3; +* Python ≥ 3.3.3; * polib_ ≥ 1.0.0, a gettext catalogs manipulation library; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/doc/changelog new/i18nspector-0.25.7/doc/changelog --- old/i18nspector-0.25.6/doc/changelog 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/doc/changelog 2018-12-20 20:02:24.000000000 +0100 @@ -1,3 +1,22 @@ +i18nspector (0.25.7) unstable; urgency=low + + * Drop support for Python < 3.3.3. + + Fix “FutureWarning: Possible nested set” warnings. + Thanks to Helge Kreutzmann for the bug report. + https://bugs.debian.org/916928 + https://bugs.python.org/issue30349 + * Improve the build system: + + Remove the coverage file when cleaning. + + Use install(1) to install the executable. + + Use ginstall(1), instead of install(1), if it exists. + + Add checks against BSD make. (Only GNU make is supported.) + + Byte-compile Python code on install. + * Improve documentation: + + Use HTTPS for doc.qt.io. + + Use HTTPS for www.unicode.org. + + -- Jakub Wilk <jw...@jwilk.net> Thu, 20 Dec 2018 20:02:15 +0100 + i18nspector (0.25.6) unstable; urgency=low * Drop support for Python 3.2. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/doc/i18nspector.1 new/i18nspector-0.25.7/doc/i18nspector.1 --- old/i18nspector-0.25.6/doc/i18nspector.1 2018-05-18 22:12:34.000000000 +0200 +++ new/i18nspector-0.25.7/doc/i18nspector.1 2018-12-20 20:02:26.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH I18NSPECTOR 1 "2018-05-18" "i18nspector 0.25.6" "" +.TH I18NSPECTOR 1 "2018-12-20" "i18nspector 0.25.7" "" .SH NAME i18nspector \- checking tool for gettext POT, PO and MO files . @@ -1987,7 +1987,7 @@ .INDENT 0.0 .INDENT 3.5 .nf -\fI\%http://doc.qt.io/qt\-5/i18n\-source\-translation.html#handling\-plurals\fP +\fI\%https://doc.qt.io/qt\-5/i18n\-source\-translation.html#handling\-plurals\fP \fBprintf\fP(3) .fi .sp @@ -2311,7 +2311,7 @@ .INDENT 0.0 .INDENT 3.5 .nf -\fI\%http://www.unicode.org/faq/utf_bom.html#bom6\fP +\fI\%https://www.unicode.org/faq/utf_bom.html#bom6\fP .fi .sp .UNINDENT @@ -2338,7 +2338,7 @@ .INDENT 0.0 .INDENT 3.5 .nf -\fI\%http://www.unicode.org/faq/utf_bom.html#bom6\fP +\fI\%https://www.unicode.org/faq/utf_bom.html#bom6\fP .fi .sp .UNINDENT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/doc/manpage.rst new/i18nspector-0.25.7/doc/manpage.rst --- old/i18nspector-0.25.6/doc/manpage.rst 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/doc/manpage.rst 2018-12-20 20:02:24.000000000 +0100 @@ -7,7 +7,7 @@ ---------------------------------------------- :manual section: 1 -:version: i18nspector 0.25.6 +:version: i18nspector 0.25.7 :date: |date| Synopsis diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/doc/tags.rst new/i18nspector-0.25.7/doc/tags.rst --- old/i18nspector-0.25.6/doc/tags.rst 2018-05-18 22:12:33.000000000 +0200 +++ new/i18nspector-0.25.7/doc/tags.rst 2018-12-20 20:02:26.000000000 +0100 @@ -1255,7 +1255,7 @@ References: - | http://doc.qt.io/qt-5/i18n-source-translation.html#handling-plurals + | https://doc.qt.io/qt-5/i18n-source-translation.html#handling-plurals | **printf**\ (3) Severity, certainty: @@ -1474,7 +1474,7 @@ References: - | http://www.unicode.org/faq/utf_bom.html#bom6 + | https://www.unicode.org/faq/utf_bom.html#bom6 Severity, certainty: @@ -1490,7 +1490,7 @@ References: - | http://www.unicode.org/faq/utf_bom.html#bom6 + | https://www.unicode.org/faq/utf_bom.html#bom6 Severity, certainty: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/i18nspector new/i18nspector-0.25.7/i18nspector --- old/i18nspector-0.25.6/i18nspector 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/i18nspector 2018-12-20 20:02:24.000000000 +0100 @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # encoding=UTF-8 -# Copyright © 2012-2017 Jakub Wilk <jw...@jwilk.net> +# Copyright © 2012-2018 Jakub Wilk <jw...@jwilk.net> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -58,7 +58,7 @@ message = 'polib >= {ver} is required'.format(ver=version_str) error(message) -require_python(3, 3) +require_python(3, 3, 3) require_polib(1, 0, 0) # ---------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/lib/check/__init__.py new/i18nspector-0.25.7/lib/check/__init__.py --- old/i18nspector-0.25.6/lib/check/__init__.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/lib/check/__init__.py 2018-12-20 20:02:24.000000000 +0100 @@ -73,7 +73,7 @@ header_fields_with_dedicated_checks.update(fields) return identity -class Checker(object, metaclass=abc.ABCMeta): +class Checker(metaclass=abc.ABCMeta): _patched_environment = None @@ -107,7 +107,7 @@ @abc.abstractmethod def tag(self, tagname, *extra): - return + pass def check(self): # If a file passed to polib doesn't exist, it will “helpfully” treat it @@ -145,7 +145,7 @@ except polib4us.moparser.SyntaxError as exc: self.tag('invalid-mo-file', tags.safestr(exc)) return - except IOError as exc: + except OSError as exc: message = str(exc) if exc.errno is not None: self.tag('os-error', tags.safestr(exc.strerror)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/lib/check/msgformat/__init__.py new/i18nspector-0.25.7/lib/check/msgformat/__init__.py --- old/i18nspector-0.25.6/lib/check/msgformat/__init__.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/lib/check/msgformat/__init__.py 2018-12-20 20:02:24.000000000 +0100 @@ -25,14 +25,14 @@ import abc import types -class Checker(object, metaclass=abc.ABCMeta): +class Checker(metaclass=abc.ABCMeta): def __init__(self, parent): self.parent = parent @abc.abstractproperty def backend(self): - return + pass def tag(self, tagname, *extra): return self.parent.tag(tagname, *extra) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/lib/cli.py new/i18nspector-0.25.7/lib/cli.py --- old/i18nspector-0.25.6/lib/cli.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/lib/cli.py 2018-12-20 20:02:24.000000000 +0100 @@ -39,7 +39,7 @@ from lib import tags from lib import terminal -__version__ = '0.25.6' +__version__ = '0.25.7' def initialize_terminal(): if sys.stdout.isatty(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/lib/encodings.py new/i18nspector-0.25.7/lib/encodings.py --- old/i18nspector-0.25.6/lib/encodings.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/lib/encodings.py 2018-12-20 20:02:24.000000000 +0100 @@ -26,7 +26,6 @@ import codecs import configparser import encodings.aliases as encoding_aliases -import errno import functools import itertools import os @@ -56,10 +55,8 @@ path = os.path.join(paths.datadir, 'charmaps', encoding.upper()) try: file = open(path, 'rb') - except IOError as exc: - if exc.errno == errno.ENOENT: - raise EncodingLookupError(encoding) - raise + except FileNotFoundError: + raise EncodingLookupError(encoding) with file: decoding_table = file.read() decoding_table = decoding_table.decode('UTF-8') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/lib/intexpr.py new/i18nspector-0.25.7/lib/intexpr.py --- old/i18nspector-0.25.6/lib/intexpr.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/lib/intexpr.py 2018-12-20 20:02:24.000000000 +0100 @@ -142,7 +142,7 @@ # CVE-2014-1604, CVE-2014-1938 return pg.build() -class Parser(object): +class Parser(): def __init__(self): self._lexer = create_lexer() @@ -155,7 +155,7 @@ from lib import misc # pylint: disable=wrong-import-position -class BaseEvaluator(object): +class BaseEvaluator(): def __init__(self, node): self._ctxt = types.SimpleNamespace() @@ -668,9 +668,9 @@ return (0, 1) def _visit_name(self, node): # pylint: disable=unused-argument - return + pass -class Expression(object): +class Expression(): def __init__(self, node): if not isinstance(node, ast.Expr): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/lib/ling.py new/i18nspector-0.25.7/lib/ling.py --- old/i18nspector-0.25.6/lib/ling.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/lib/ling.py 2018-12-20 20:02:24.000000000 +0100 @@ -51,7 +51,7 @@ class FixingLanguageEncodingFailed(LanguageError): pass -class Language(object): +class Language(): def __init__(self, language_code, territory_code=None, encoding=None, modifier=None): self.language_code = language_code diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/lib/moparser.py new/i18nspector-0.25.7/lib/moparser.py --- old/i18nspector-0.25.6/lib/moparser.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/lib/moparser.py 2018-12-20 20:02:24.000000000 +0100 @@ -1,4 +1,4 @@ -# Copyright © 2013-2017 Jakub Wilk <jw...@jwilk.net> +# Copyright © 2013-2018 Jakub Wilk <jw...@jwilk.net> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -40,7 +40,7 @@ class SyntaxError(Exception): # pylint: disable=redefined-builtin pass -class Parser(object): +class Parser(): def __init__(self, path, *, encoding=None, check_for_duplicates=False, klass=None): self._encoding = encoding @@ -49,8 +49,8 @@ with open(path, 'rb') as file: contents = file.read() view = memoryview(contents) + view = view.cast('c') if len(view) > 0: - view = view.cast('c') assert isinstance(view[0], bytes) self._view = view if klass is None: @@ -143,15 +143,13 @@ pass if encoding is None: encoding = 'ASCII' - else: - if not encodings.is_ascii_compatible_encoding(encoding): - encoding = 'ASCII' + elif not encodings.is_ascii_compatible_encoding(encoding): + encoding = 'ASCII' self._encoding = encoding - else: - if msgids == self._last_msgid: - raise SyntaxError('duplicate message definition') - elif msgid < self._last_msgid: - raise SyntaxError('messages are not sorted') + elif msgids == self._last_msgid: + raise SyntaxError('duplicate message definition') + elif msgid < self._last_msgid: + raise SyntaxError('messages are not sorted') self._last_msgid = msgid # pylint: disable=attribute-defined-outside-init assert encoding is not None msgid, *msgctxt = msgid.split(b'\x04', 1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/lib/polib4us.py new/i18nspector-0.25.7/lib/polib4us.py --- old/i18nspector-0.25.6/lib/polib4us.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/lib/polib4us.py 2018-12-20 20:02:24.000000000 +0100 @@ -63,7 +63,7 @@ # - atypical comment parsing # - parsing of empty files: https://bitbucket.org/izi/polib/issues/59 -class Codecs(object): +class Codecs(): _iterlines = re.compile(r'[^\n]*(?:\n|\Z)').findall _atypical_comment = re.compile(r'#[^ .:,|~]').match @@ -109,7 +109,6 @@ def pofile_find_patch(): def pofile_find(self, *args, **kwargs): del self, args, kwargs - return polib.POFile.find = pofile_find # polib.unescape() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/lib/strformat/c.py new/i18nspector-0.25.7/lib/strformat/c.py --- old/i18nspector-0.25.6/lib/strformat/c.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/lib/strformat/c.py 2018-12-20 20:02:24.000000000 +0100 @@ -152,21 +152,21 @@ message = 'precision too large' -class VariableWidth(object): +class VariableWidth(): type = 'int' def __init__(self, parent): self.parent = parent -class VariablePrecision(object): +class VariablePrecision(): type = 'int' def __init__(self, parent): self.parent = parent -class FormatString(object): +class FormatString(): def __init__(self, s): self._items = items = [] @@ -214,14 +214,13 @@ else: n = self._next_arg_index self._next_arg_index += 1 + elif self._next_arg_index is None: + pass + elif self._next_arg_index == 1: + assert not self._argument_map + self._next_arg_index = None else: - if self._next_arg_index is None: - pass - elif self._next_arg_index == 1: - assert not self._argument_map - self._next_arg_index = None - else: - raise IndexError + raise IndexError if n > NL_ARGMAX: raise OverflowError(n) self._argument_map[n] += [value] @@ -268,7 +267,7 @@ def __len__(self): return len(self._items) -class Conversion(object): +class Conversion(): type = None integer = None @@ -306,7 +305,7 @@ '%' + length + conversion, '%' + plength + conversion ) - tp = i.int_types.get(plength or '') + tp = i.int_types.get(plength or '') # pylint: disable=no-member assert tp is not None tp = tp[conversion in i.uint_cvt] if conversion == 'n': diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/lib/strformat/pybrace.py new/i18nspector-0.25.7/lib/strformat/pybrace.py --- old/i18nspector-0.25.6/lib/strformat/pybrace.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/lib/strformat/pybrace.py 2018-12-20 20:02:24.000000000 +0100 @@ -30,7 +30,7 @@ (?: \d+ | [^\W\d]\w* ) (?: [.] [^\W\d]\w* | - [[] [^]]+ []] + \[ [^]]+ \] )* ''' @@ -111,7 +111,7 @@ # -------------------------------------------------------------------------- -class FormatString(object): +class FormatString(): def __init__(self, s): self._argument_map = collections.defaultdict(list) @@ -178,7 +178,7 @@ # -------------------------------------------------------------------------- -class Field(object): +class Field(): def __init__(self, parent, match): s = match.string[slice(*match.span())] @@ -271,7 +271,7 @@ raise ConversionError(s) self.types = frozenset(tp) -class NestedField(object): +class NestedField(): types = frozenset({'str', 'int', 'float'}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/lib/strformat/python.py new/i18nspector-0.25.7/lib/strformat/python.py --- old/i18nspector-0.25.6/lib/strformat/python.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/lib/strformat/python.py 2018-12-20 20:02:24.000000000 +0100 @@ -1,4 +1,4 @@ -# Copyright © 2015-2016 Jakub Wilk <jw...@jwilk.net> +# Copyright © 2015-2018 Jakub Wilk <jw...@jwilk.net> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -86,14 +86,14 @@ # -------------------------------------------------------------------------- -class VariableWidth(object): +class VariableWidth(): type = 'int' def __init__(self, parent): self.parent = parent -class VariablePrecision(object): +class VariablePrecision(): type = 'int' @@ -102,7 +102,7 @@ # -------------------------------------------------------------------------- -class FormatString(object): +class FormatString(): def __init__(self, s): self._items = items = [] @@ -153,7 +153,7 @@ j, ch = next_si() else: width = 0 - while ch >= '0' and ch <= '9': + while '0' <= ch <= '9': width *= 10 width += int(ch) j, ch = next_si() @@ -166,7 +166,7 @@ j, ch = next_si() else: prec = 0 - while ch >= '0' and ch <= '9': + while '0' <= ch <= '9': prec *= 10 prec += int(ch) j, ch = next_si() @@ -233,7 +233,7 @@ # -------------------------------------------------------------------------- -class Conversion(object): +class Conversion(): def __init__(self, parent, s, *, key, flags, width, var_width, prec, var_prec, length, conv): assert s[-1] == conv, '{0} != {1}'.format(s[-1], conv) @@ -260,11 +260,10 @@ except IndexError: raise ArgumentIndexingMixture(s) width = ... - else: - if width > SSIZE_MAX: - # The limit is INT_MAX in Python 2.X and SSIZE_MAX in Python 3.X; - # but INT_MAX == SSIZE_MAX on mainstream 32-bit architectures. - raise WidthRangeError(s, width) + elif width > SSIZE_MAX: + # The limit is INT_MAX in Python 2.X and SSIZE_MAX in Python 3.X; + # but INT_MAX == SSIZE_MAX on mainstream 32-bit architectures. + raise WidthRangeError(s, width) if var_prec: assert prec is None try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/lib/tags.py new/i18nspector-0.25.7/lib/tags.py --- old/i18nspector-0.25.6/lib/tags.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/lib/tags.py 2018-12-20 20:02:24.000000000 +0100 @@ -32,7 +32,7 @@ from lib import terminal @functools.total_ordering -class OrderedObject(object): +class OrderedObject(): _parent = None @@ -65,7 +65,7 @@ def __str__(self): return str(self._name) -class OrderedGroup(object): +class OrderedGroup(): def __init__(self, name, *items): self._child_type = ct = type(name, (OrderedObject,), dict(_parent=self)) @@ -124,7 +124,7 @@ kwargs = {k: _escape(v) for k, v in kwargs.items()} return safestr(template.format(*args, **kwargs)) -class Tag(object): +class Tag(): def __init__(self, **kwargs): self.description = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/lib/terminal.py new/i18nspector-0.25.7/lib/terminal.py --- old/i18nspector-0.25.6/lib/terminal.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/lib/terminal.py 2018-12-20 20:02:24.000000000 +0100 @@ -1,4 +1,4 @@ -# Copyright © 2012-2016 Jakub Wilk <jw...@jwilk.net> +# Copyright © 2012-2018 Jakub Wilk <jw...@jwilk.net> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -60,7 +60,8 @@ ''' s = _curses.tigetstr('setaf') or b'' s = _strip_delay(s) - s = _curses.tparm(s, i) + if s: # work-around for https://bugs.debian.org/902630 + s = _curses.tparm(s, i) return s.decode() def attr_reset(): @@ -85,20 +86,6 @@ except _curses.error: _curses = _dummy_curses return - try: - _curses.tparm(b'x') - except TypeError: - # curses.tparm() is broken in early versions of Python 3.2: - # https://bugs.python.org/issue10570 - _curses = _dummy_curses - return - try: - _curses.tigetstr('x') - except TypeError: - # curses.tigetstr() is broken in PyPy 3: - # https://bitbucket.org/pypy/pypy/issues/1997 - _curses = _dummy_curses - return for key, value in vars(_curses).items(): if key.startswith('COLOR_'): key = key[6:].lower() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/private/check-rst new/i18nspector-0.25.7/private/check-rst --- old/i18nspector-0.25.6/private/check-rst 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/private/check-rst 2018-12-20 20:02:24.000000000 +0100 @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright © 2016-2017 Jakub Wilk <jw...@jwilk.net> +# Copyright © 2016-2018 Jakub Wilk <jw...@jwilk.net> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -20,14 +20,19 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -here=$(dirname "$0") +set -e -u +here=${0%/*} +here=${here#./} +root="$here/../" +root=${root#private/../} rst2xml=$(command -v rst2xml) \ || rst2xml=$(command -v rst2xml.py) \ || { printf 'rst2xml not found\n' >&2; exit 1; } -options='--input-encoding=UTF-8 --output-encoding=UTF-8 --strict' +rst2xml=${rst2xml##*/} +options='--input-encoding=UTF-8 --strict' if [ $# -eq 0 ] then - grep -rwl 'ft=rst' doc/ + grep -rwl 'ft=rst' "${root}doc" else printf '%s\n' "$@" fi | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/private/online-build-po-corpus new/i18nspector-0.25.7/private/online-build-po-corpus --- old/i18nspector-0.25.6/private/online-build-po-corpus 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/private/online-build-po-corpus 2018-12-20 20:02:24.000000000 +0100 @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Copyright © 2012-2017 Jakub Wilk <jw...@jwilk.net> +# Copyright © 2012-2018 Jakub Wilk <jw...@jwilk.net> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -37,7 +37,7 @@ def is_po_path(path): return path.endswith(('.po', '.pot')) -class Fetcher(object): +class Fetcher(): def __init__(self, urlbase): self._urlbase = urlbase @@ -90,7 +90,7 @@ finally: os.chdir(orig_cwd) -default_mirror = 'http://deb.debian.org/debian' +default_mirror = 'https://deb.debian.org/debian' default_dist = 'stable' default_areas = 'main' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/private/online-check-gettext-data new/i18nspector-0.25.7/private/online-check-gettext-data --- old/i18nspector-0.25.6/private/online-check-gettext-data 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/private/online-check-gettext-data 2018-12-20 20:02:24.000000000 +0100 @@ -33,14 +33,11 @@ # Remove superfluous parentheses around the plural formula: return re.sub(r'\bplural=\((.*?)\);$', r'plural=\1;', s) -def urlopen(url): - return urllib.request.urlopen(url, cadefault=True) - def do_plurals(): regexp = re.compile(r'\s+{\s*"([a-zA-Z_]+)".*"(nplurals.*?)"') url = 'https://git.savannah.gnu.org/cgit/gettext.git/plain/gettext-tools/src/plural-table.c' okay = set() - with urlopen(url) as file: + with urllib.request.urlopen(url) as file: for line in file: line = line.decode('ASCII').rstrip() match = regexp.match(line) @@ -75,7 +72,7 @@ def do_languages(): url = 'https://git.savannah.gnu.org/cgit/gettext.git/plain/gettext-tools/src/msginit.c' okay = set() - with urlopen(url) as file: + with urllib.request.urlopen(url) as file: contents = file.read() match = re.compile(br'locales_with_principal_territory\s*\[\]\s*=\s*[{](.*?)[}]', re.DOTALL).search(contents) if match is None: @@ -122,7 +119,7 @@ def do_string_formats(): url = 'https://git.savannah.gnu.org/cgit/gettext.git/plain/gettext-tools/src/message.c' - with urlopen(url) as file: + with urllib.request.urlopen(url) as file: contents = file.read() match = re.compile(br'\sformat_language\s*\[NFORMATS\]\s*=\s*[{](.*?)[}]', re.DOTALL).search(contents) if match is None: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/private/run-pylint new/i18nspector-0.25.7/private/run-pylint --- old/i18nspector-0.25.6/private/run-pylint 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/private/run-pylint 2018-12-20 20:02:24.000000000 +0100 @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright © 2015-2017 Jakub Wilk <jw...@jwilk.net> +# Copyright © 2015-2018 Jakub Wilk <jw...@jwilk.net> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -45,11 +45,10 @@ set -- --extension-pkg-whitelist="${whitelist#,}" --ignored-modules="${ignored#,}" "$@" log=$(mktemp -t pylint.XXXXXX) "$PYTHON" -m pylint "$@" > "$log" || [ $? != 1 ] -! grep '^\w:' "$log" \ -| grep -v ': missing-docstring \[\w' \ -| grep -v -P '^\w: (?!lib/).+: missing-docstring ' \ +! grep -P '^\S+:' "$log" \ +| grep -v -P '^(?!lib/).+: missing-docstring ' \ | grep -v ": redefined-builtin \\[.*\\] Redefining built-in 'input'" \ -| grep -v -P "^\w: tests/.+: wrong-import-order \\[.*\\] external import \"import lib[.].+\" comes before \"from . import tools\"" \ +| grep -v -P "^tests/.+: wrong-import-order \\[.*\\] external import \"import lib[.].+\" comes before \"from . import tools\"" \ | LC_ALL=C sort -k2 \ | grep '.' || exit 1 rm "$log" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/private/update-timezones new/i18nspector-0.25.7/private/update-timezones --- old/i18nspector-0.25.6/private/update-timezones 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/private/update-timezones 2018-12-20 20:02:24.000000000 +0100 @@ -33,7 +33,7 @@ sys.path[0] += '/..' basedir = sys.path[0] -import lib.gettext as gettext +from lib import gettext def get_tzdata_version(): version = pytz.OLSON_VERSION diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/tests/blackbox_tests/__init__.py new/i18nspector-0.25.7/tests/blackbox_tests/__init__.py --- old/i18nspector-0.25.6/tests/blackbox_tests/__init__.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/tests/blackbox_tests/__init__.py 2018-12-20 20:02:24.000000000 +0100 @@ -19,7 +19,6 @@ # SOFTWARE. import difflib -import errno import inspect import io import multiprocessing as mp @@ -77,7 +76,7 @@ # ---------------------------------------- -class ETag(object): +class ETag(): _ellipsis = '<...>' _split = re.compile('({})'.format(re.escape(_ellipsis))).split @@ -329,18 +328,16 @@ # <path>.tags: try: file = open(path + '.tags', encoding='UTF-8') - except IOError as exc: - if exc.errno != errno.ENOENT: - raise + except FileNotFoundError: + pass else: with file: return _parse_test_header_file(file, path, comments_only=False) # <path>.gen: try: file = open(path + '.gen', encoding='UTF-8', errors='ignore') - except IOError as exc: - if exc.errno != errno.ENOENT: - raise + except FileNotFoundError: + pass else: with file: return _parse_test_header_file(file, path, comments_only=True) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/tests/fuzzing/mo-parser/test.py new/i18nspector-0.25.7/tests/fuzzing/mo-parser/test.py --- old/i18nspector-0.25.6/tests/fuzzing/mo-parser/test.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/tests/fuzzing/mo-parser/test.py 2018-12-20 20:02:24.000000000 +0100 @@ -28,11 +28,13 @@ sys.path[0] += '/../../..' -import tests.tools as tools +import tests.tools import lib.moparser as M +temporary_file = tests.tools.temporary_file + def parser_for_bytes(data): - with tools.temporary_file(suffix='.mo') as file: + with temporary_file(suffix='.mo') as file: file.write(data) file.flush() return M.Parser(file.name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/tests/test_ling.py new/i18nspector-0.25.7/tests/test_ling.py --- old/i18nspector-0.25.6/tests/test_ling.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/tests/test_ling.py 2018-12-20 20:02:24.000000000 +0100 @@ -427,7 +427,7 @@ assert_equal(str(lang), l) try: file = open('/usr/share/i18n/SUPPORTED', encoding='ASCII') - except IOError as exc: + except OSError as exc: raise nose.SkipTest(exc) locales = set() with file: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/tests/test_strformat_c.py new/i18nspector-0.25.7/tests/test_strformat_c.py --- old/i18nspector-0.25.6/tests/test_strformat_c.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/tests/test_strformat_c.py 2018-12-20 20:02:24.000000000 +0100 @@ -1,4 +1,4 @@ -# Copyright © 2014-2017 Jakub Wilk <jw...@jwilk.net> +# Copyright © 2014-2018 Jakub Wilk <jw...@jwilk.net> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -21,14 +21,7 @@ import os import struct import sys - -try: - import unittest.mock as mock -except ImportError: - try: - import mock - except ImportError: - mock = None +import unittest.mock import nose from nose.tools import ( @@ -63,13 +56,9 @@ else: raise nose.SkipTest('Test specific to Linux with glibc') -if mock is not None: - small_NL_ARGMAX = mock.patch('lib.strformat.c.NL_ARGMAX', 42) - # Setting NL_ARGMAX to a small number makes the *_index_out_of_range() tests - # much faster. -else: - def small_NL_ARGMAX(func): - return func +small_NL_ARGMAX = unittest.mock.patch('lib.strformat.c.NL_ARGMAX', 42) +# Setting NL_ARGMAX to a small number makes the *_index_out_of_range() tests +# much faster. def test_lone_percent(): with assert_raises(M.Error): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.25.6/tests/test_strformat_pybrace.py new/i18nspector-0.25.7/tests/test_strformat_pybrace.py --- old/i18nspector-0.25.6/tests/test_strformat_pybrace.py 2018-05-18 22:03:00.000000000 +0200 +++ new/i18nspector-0.25.7/tests/test_strformat_pybrace.py 2018-12-20 20:02:24.000000000 +0100 @@ -1,4 +1,4 @@ -# Copyright © 2016 Jakub Wilk <jw...@jwilk.net> +# Copyright © 2016-2018 Jakub Wilk <jw...@jwilk.net> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -18,18 +18,9 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -import functools import struct +import unittest.mock -try: - import unittest.mock as mock -except ImportError: - try: - import mock - except ImportError: - mock = None - -import nose from nose.tools import ( assert_equal, assert_is, @@ -44,17 +35,9 @@ with assert_raises(struct.error): struct.pack('=i', M.SSIZE_MAX + 1) -if mock is not None: - small_SSIZE_MAX = mock.patch('lib.strformat.pybrace.SSIZE_MAX', 42) - # Setting SSIZE_ARGMAX to a small number makes it possible to test for - # a very large number of arguments without running out of memory. -else: - def small_SSIZE_MAX(func): - @functools.wraps(func) - def wrapper(*args, **kwargs): - del args, kwargs - raise nose.SkipTest('mock module missing') - return wrapper +small_SSIZE_MAX = unittest.mock.patch('lib.strformat.pybrace.SSIZE_MAX', 42) +# Setting SSIZE_ARGMAX to a small number makes it possible to test for +# a very large number of arguments without running out of memory. def test_lone_lcb(): with assert_raises(M.Error):