Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-coloredlogs for 
openSUSE:Factory checked in at 2021-11-17 01:14:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-coloredlogs (Old)
 and      /work/SRC/openSUSE:Factory/.python-coloredlogs.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-coloredlogs"

Wed Nov 17 01:14:34 2021 rev:9 rq:931858 version:15.0.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-coloredlogs/python-coloredlogs.changes    
2020-08-04 20:22:13.097000104 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-coloredlogs.new.1890/python-coloredlogs.changes
  2021-11-17 01:15:48.810192266 +0100
@@ -1,0 +2,38 @@
+Tue Nov 16 13:00:38 UTC 2021 - ecsos  <ec...@opensuse.org>
+
+- Update to 15.0.1
+  - Bug fix: Restore :class:`.StandardErrorHandler` functionality
+  - The :class:`.StandardErrorHandler` class is responsible for dynamically
+    resolving (looking up the value of) sys.stderr for each logged message 
instead
+    of once when :func:`coloredlogs.install()` is called.
+  - This was unintentionally broken by changes in `release 14.1`_.
+  - _Release 15.0.1: 
https://github.com/xolox/python-coloredlogs/compare/15.0...15.0.1
+- Update to 15.0
+  - Don't enable system logging on MacOS and Windows anymore.
+  - This is backwards incompatible (which is why I'm bumping the major version
+    number) however the old behavior has been reported to be rather problematic
+    (see :func:`~coloredlogs.syslog.is_syslog_supported()` for details) so this
+    seems like the best choice.
+  - _Release 15.0: 
https://github.com/xolox/python-coloredlogs/compare/14.2...15.0
+- Update to 14.3
+  * Merged pull request `#89`_ which enhances :func:`coloredlogs.install()` to
+    preserve the filters on handlers that are replaced by :pypi:`coloredlogs`.
+  * _Release 14.3: 
https://github.com/xolox/python-coloredlogs/compare/14.2...14.3
+  * _#89: https://github.com/xolox/python-coloredlogs/pull/89
+- Update to 14.2
+  * Honor the ``$NO_COLOR`` environment variable as suggested in issue `#88`_.
+  * _Release 14.2: 
https://github.com/xolox/python-coloredlogs/compare/14.1...14.2
+  * _#88: https://github.com/xolox/python-coloredlogs/issues/88
+- Update to 14.1
+  **Bug fixes:**
+  - Don't allow interactive terminal detection to disable colored text when
+    colored text is being forced by the caller (reported in issue `#84`_).
+  - Automatically disable colored text when logging output is being redirected 
to
+    a file in such a way that it actually works ???? (reported in issue 
`#100`_).
+  **Other changes:**
+  - Start testing on PyPy 3 (because why not?)
+  - _Release 14.1: 
https://github.com/xolox/python-coloredlogs/compare/14.0...14.1
+  - _#84: https://github.com/xolox/python-coloredlogs/issues/84
+  - _#100: https://github.com/xolox/python-coloredlogs/issues/100
+
+-------------------------------------------------------------------
@@ -77 +114,0 @@
-

Old:
----
  coloredlogs-14.0.tar.gz

New:
----
  coloredlogs-15.0.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-coloredlogs.spec ++++++
--- /var/tmp/diff_new_pack.Uei4pB/_old  2021-11-17 01:15:49.346192292 +0100
+++ /var/tmp/diff_new_pack.Uei4pB/_new  2021-11-17 01:15:49.350192292 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-coloredlogs
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 # Copyright (c) 2016, Martin Hauke <mar...@gmx.de>
 #
 # All modifications and additions to the file contributed by third parties
@@ -19,7 +19,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-coloredlogs
-Version:        14.0
+Version:        15.0.1
 Release:        0
 Summary:        Colored terminal output for Python's logging module
 License:        MIT

++++++ coloredlogs-14.0.tar.gz -> coloredlogs-15.0.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/coloredlogs-14.0/CHANGELOG.rst 
new/coloredlogs-15.0.1/CHANGELOG.rst
--- old/coloredlogs-14.0/CHANGELOG.rst  2020-02-16 21:50:46.000000000 +0100
+++ new/coloredlogs-15.0.1/CHANGELOG.rst        2021-06-11 12:22:15.000000000 
+0200
@@ -11,6 +11,68 @@
 .. _Keep a Changelog: http://keepachangelog.com/
 .. _semantic versioning: http://semver.org/
 
+`Release 15.0.1`_ (2021-06-11)
+------------------------------
+
+Bug fix: Restore :class:`.StandardErrorHandler` functionality
+
+The :class:`.StandardErrorHandler` class is responsible for dynamically
+resolving (looking up the value of) sys.stderr for each logged message instead
+of once when :func:`coloredlogs.install()` is called.
+
+This was unintentionally broken by changes in `release 14.1`_.
+
+.. _Release 15.0.1: 
https://github.com/xolox/python-coloredlogs/compare/15.0...15.0.1
+
+`Release 15.0`_ (2020-12-10)
+----------------------------
+
+Don't enable system logging on MacOS and Windows anymore.
+
+This is backwards incompatible (which is why I'm bumping the major version
+number) however the old behavior has been reported to be rather problematic
+(see :func:`~coloredlogs.syslog.is_syslog_supported()` for details) so this
+seems like the best choice.
+
+.. _Release 15.0: 
https://github.com/xolox/python-coloredlogs/compare/14.2...15.0
+
+`Release 14.3`_ (2020-12-10)
+----------------------------
+
+Merged pull request `#89`_ which enhances :func:`coloredlogs.install()` to
+preserve the filters on handlers that are replaced by :pypi:`coloredlogs`.
+
+.. _Release 14.3: 
https://github.com/xolox/python-coloredlogs/compare/14.2...14.3
+.. _#89: https://github.com/xolox/python-coloredlogs/pull/89
+
+`Release 14.2`_ (2020-12-10)
+----------------------------
+
+Honor the ``$NO_COLOR`` environment variable as suggested in issue `#88`_.
+
+.. _Release 14.2: 
https://github.com/xolox/python-coloredlogs/compare/14.1...14.2
+.. _#88: https://github.com/xolox/python-coloredlogs/issues/88
+
+`Release 14.1`_ (2020-12-10)
+----------------------------
+
+**Bug fixes:**
+
+- Don't allow interactive terminal detection to disable colored text when
+  colored text is being forced by the caller (reported in issue `#84`_).
+
+- Automatically disable colored text when logging output is being redirected to
+  a file in such a way that it actually works ???? (reported in issue `#100`_).
+
+**Other changes:**
+
+- Start testing on PyPy 3 (because why not?)
+
+.. _Release 14.1: 
https://github.com/xolox/python-coloredlogs/compare/14.0...14.1
+.. _#84: https://github.com/xolox/python-coloredlogs/issues/84
+.. _#100: https://github.com/xolox/python-coloredlogs/issues/100
+
+
 `Release 14.0`_ (2020-02-16)
 ----------------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/coloredlogs-14.0/PKG-INFO 
new/coloredlogs-15.0.1/PKG-INFO
--- old/coloredlogs-14.0/PKG-INFO       2020-02-16 21:51:08.000000000 +0100
+++ new/coloredlogs-15.0.1/PKG-INFO     2021-06-11 12:22:41.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: coloredlogs
-Version: 14.0
+Version: 15.0.1
 Summary: Colored terminal output for Python's logging module
 Home-page: https://coloredlogs.readthedocs.io
 Author: Peter Odding
@@ -19,10 +19,10 @@
         module. The ColoredFormatter_ class inherits from `logging.Formatter`_ 
and uses
         `ANSI escape sequences`_ to render your logging messages in color. It 
uses only
         standard colors so it should work on any UNIX terminal. It's currently 
tested
-        on Python 2.7, 3.5+ and PyPy. On Windows `coloredlogs` automatically 
tries to
-        enable native ANSI support (on up-to-date Windows 10 installations) 
and falls
-        back on using colorama_ (if installed). Here is a screen shot of the 
demo that
-        is printed when the command ``coloredlogs --demo`` is executed:
+        on Python 2.7, 3.5+ and PyPy (2 and 3). On Windows `coloredlogs` 
automatically
+        tries to enable native ANSI support (on up-to-date Windows 10 
installations)
+        and falls back on using colorama_ (if installed). Here is a screen 
shot of the
+        demo that is printed when the command ``coloredlogs --demo`` is 
executed:
         
         .. image:: 
https://coloredlogs.readthedocs.io/en/latest/_images/defaults.png
         
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/coloredlogs-14.0/README.rst 
new/coloredlogs-15.0.1/README.rst
--- old/coloredlogs-14.0/README.rst     2020-02-16 21:50:46.000000000 +0100
+++ new/coloredlogs-15.0.1/README.rst   2020-12-10 00:56:36.000000000 +0100
@@ -11,10 +11,10 @@
 module. The ColoredFormatter_ class inherits from `logging.Formatter`_ and uses
 `ANSI escape sequences`_ to render your logging messages in color. It uses only
 standard colors so it should work on any UNIX terminal. It's currently tested
-on Python 2.7, 3.5+ and PyPy. On Windows `coloredlogs` automatically tries to
-enable native ANSI support (on up-to-date Windows 10 installations) and falls
-back on using colorama_ (if installed). Here is a screen shot of the demo that
-is printed when the command ``coloredlogs --demo`` is executed:
+on Python 2.7, 3.5+ and PyPy (2 and 3). On Windows `coloredlogs` automatically
+tries to enable native ANSI support (on up-to-date Windows 10 installations)
+and falls back on using colorama_ (if installed). Here is a screen shot of the
+demo that is printed when the command ``coloredlogs --demo`` is executed:
 
 .. image:: https://coloredlogs.readthedocs.io/en/latest/_images/defaults.png
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/coloredlogs-14.0/coloredlogs/__init__.py 
new/coloredlogs-15.0.1/coloredlogs/__init__.py
--- old/coloredlogs-14.0/coloredlogs/__init__.py        2020-02-16 
21:50:46.000000000 +0100
+++ new/coloredlogs-15.0.1/coloredlogs/__init__.py      2021-06-11 
12:22:15.000000000 +0200
@@ -1,7 +1,7 @@
 # Colored terminal output for Python's logging module.
 #
 # Author: Peter Odding <pe...@peterodding.com>
-# Last Change: February 16, 2020
+# Last Change: June 11, 2021
 # URL: https://coloredlogs.readthedocs.io
 
 """
@@ -45,6 +45,13 @@
 ``$COLOREDLOGS_FIELD_STYLES``  :data:`DEFAULT_FIELD_STYLES`  see 
:func:`parse_encoded_styles()`
 =============================  ============================  
==================================
 
+If the environment variable `$NO_COLOR`_ is set (the value doesn't matter, even
+an empty string will do) then :func:`coloredlogs.install()` will take this as a
+hint that colors should not be used (unless the ``isatty=True`` override was
+passed by the caller).
+
+.. _$NO_COLOR: https://no-color.org/
+
 Examples of customization
 =========================
 
@@ -207,7 +214,7 @@
 from humanfriendly.text import format, split
 
 # Semi-standard module versioning.
-__version__ = '14.0'
+__version__ = '15.0.1'
 
 DEFAULT_LOG_LEVEL = logging.INFO
 """The default log level for :mod:`coloredlogs` (:data:`logging.INFO`)."""
@@ -370,6 +377,9 @@
        with the `fmt` and `datefmt` keyword arguments (or their computed
        defaults).
 
+       The environment variable ``$NO_COLOR`` is taken as a hint by
+       auto-detection that colors should not be used.
+
     4. :func:`HostNameFilter.install()`, :func:`ProgramNameFilter.install()`
        and :func:`UserNameFilter.install()` are called to enable the use of
        additional fields in the log format.
@@ -384,7 +394,7 @@
     """
     logger = kw.get('logger') or logging.getLogger()
     reconfigure = kw.get('reconfigure', True)
-    stream = kw.get('stream', None)
+    stream = kw.get('stream') or sys.stderr
     style = check_style(kw.get('style') or DEFAULT_FORMAT_STYLE)
     # Get the log level from an argument, environment variable or default and
     # convert the names of log levels to numbers to enable numeric comparison.
@@ -408,12 +418,7 @@
         # We ignore the value `None' because it means the caller didn't opt in
         # to system logging and `False' because it means the caller explicitly
         # opted out of system logging.
-        #
-        # We never enable system logging on Windows because it is my impression
-        # that SysLogHandler isn't intended to be used on Windows; I've had
-        # reports of coloredlogs spewing extremely verbose errno 10057 warning
-        # messages to the console (once for each log message I suppose).
-        if syslog_enabled not in (None, False) and not on_windows():
+        if syslog_enabled not in (None, False):
             from coloredlogs.syslog import enable_system_logging
             if syslog_enabled is True:
                 # If the caller passed syslog=True then we leave the choice of
@@ -425,16 +430,36 @@
                 enable_system_logging(level=syslog_enabled)
         # Figure out whether we can use ANSI escape sequences.
         use_colors = kw.get('isatty', None)
-        if use_colors or use_colors is None:
-            # Try to enable Windows native ANSI support or Colorama.
-            if on_windows():
+        # In the following indented block the expression (use_colors is None)
+        # can be read as "auto detect is enabled and no reason has yet been
+        # found to automatically disable color support".
+        if use_colors or (use_colors is None):
+            # Respect the user's choice not to have colors.
+            if use_colors is None and 'NO_COLOR' in os.environ:
+                # For details on this see https://no-color.org/.
+                use_colors = False
+            # Try to enable Windows native ANSI support or Colorama?
+            if (use_colors or use_colors is None) and on_windows():
+                # This can fail, in which case ANSI escape sequences would end
+                # up being printed to the terminal in raw form. This is very
+                # user hostile, so to avoid this happening we disable color
+                # support on failure.
                 use_colors = enable_ansi_support()
-            # Disable ANSI escape sequences if 'stream' isn't connected to a 
terminal.
-            if use_colors or use_colors is None:
+            # When auto detection is enabled, and so far we encountered no
+            # reason to disable color support, then we will enable color
+            # support if 'stream' is connected to a terminal.
+            if use_colors is None:
                 use_colors = terminal_supports_colors(stream)
-        # Create a stream handler.
-        handler = logging.StreamHandler(stream) if stream else 
StandardErrorHandler()
+        # Create a stream handler and make sure to preserve any filters
+        # the current handler may have (if an existing handler is found).
+        filters = handler.filters if handler else None
+        if stream is sys.stderr:
+            handler = StandardErrorHandler()
+        else:
+            handler = logging.StreamHandler(stream)
         handler.setLevel(level)
+        if filters:
+            handler.filters = filters
         # Prepare the arguments to the formatter, allowing the caller to
         # customize the values of `fmt', `datefmt' and `style' as desired.
         formatter_options = dict(fmt=kw.get('fmt'), datefmt=kw.get('datefmt'))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/coloredlogs-14.0/coloredlogs/syslog.py 
new/coloredlogs-15.0.1/coloredlogs/syslog.py
--- old/coloredlogs-14.0/coloredlogs/syslog.py  2020-02-15 00:18:02.000000000 
+0100
+++ new/coloredlogs-15.0.1/coloredlogs/syslog.py        2020-12-10 
14:08:39.000000000 +0100
@@ -1,7 +1,7 @@
 # Easy to use system logging for Python's logging module.
 #
 # Author: Peter Odding <pe...@peterodding.com>
-# Last Change: April 17, 2017
+# Last Change: December 10, 2020
 # URL: https://coloredlogs.readthedocs.io
 
 """
@@ -32,6 +32,10 @@
 import socket
 import sys
 
+# External dependencies.
+from humanfriendly import coerce_boolean
+from humanfriendly.compat import on_macos, on_windows
+
 # Modules included in our package.
 from coloredlogs import (
     DEFAULT_LOG_LEVEL,
@@ -126,9 +130,16 @@
               connection to the system logging daemon fails :data:`None` is
               returned.
 
+    As of release 15.0 this function uses :func:`is_syslog_supported()` to
+    check whether system logging is supported and appropriate before it's
+    enabled.
+
     .. note:: When the logger's effective level is too restrictive it is
               relaxed (refer to `notes about log levels`_ for details).
     """
+    # Check whether system logging is supported / appropriate.
+    if not is_syslog_supported():
+        return None
     # Provide defaults for omitted arguments.
     programname = programname or find_program_name()
     logger = logger or logging.getLogger()
@@ -216,6 +227,57 @@
         return 'localhost', logging.handlers.SYSLOG_UDP_PORT
 
 
+def is_syslog_supported():
+    """
+    Determine whether system logging is supported.
+
+    :returns:
+
+        :data:`True` if system logging is supported and can be enabled,
+        :data:`False` if system logging is not supported or there are good
+        reasons for not enabling it.
+
+    The decision making process here is as follows:
+
+    Override
+     If the environment variable ``$COLOREDLOGS_SYSLOG`` is set it is evaluated
+     using :func:`~humanfriendly.coerce_boolean()` and the resulting value
+     overrides the platform detection discussed below, this allows users to
+     override the decision making process if they disagree / know better.
+
+    Linux / UNIX
+     On systems that are not Windows or MacOS (see below) we assume UNIX which
+     means either syslog is available or sending a bunch of UDP packets to
+     nowhere won't hurt anyone...
+
+    Microsoft Windows
+     Over the years I've had multiple reports of :pypi:`coloredlogs` spewing
+     extremely verbose errno 10057 warning messages to the console (once for
+     each log message I suppose) so I now assume it a default that
+     "syslog-style system logging" is not generally available on Windows.
+
+    Apple MacOS
+     There's cPython issue `#38780`_ which seems to result in a fatal exception
+     when the Python interpreter shuts down. This is (way) worse than not
+     having system logging enabled. The error message mentioned in `#38780`_
+     has actually been following me around for years now, see for example:
+
+     - https://github.com/xolox/python-rotate-backups/issues/9 mentions Docker
+       images implying Linux, so not strictly the same as `#38780`_.
+
+     - https://github.com/xolox/python-npm-accel/issues/4 is definitely related
+       to `#38780`_ and is what eventually prompted me to add the
+       :func:`is_syslog_supported()` logic.
+
+    .. _#38780: https://bugs.python.org/issue38780
+    """
+    override = os.environ.get("COLOREDLOGS_SYSLOG")
+    if override is not None:
+        return coerce_boolean(override)
+    else:
+        return not (on_windows() or on_macos())
+
+
 def match_syslog_handler(handler):
     """
     Identify system logging handlers.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/coloredlogs-14.0/coloredlogs/tests.py 
new/coloredlogs-15.0.1/coloredlogs/tests.py
--- old/coloredlogs-14.0/coloredlogs/tests.py   2020-02-16 21:50:46.000000000 
+0100
+++ new/coloredlogs-15.0.1/coloredlogs/tests.py 2021-06-11 12:22:15.000000000 
+0200
@@ -1,7 +1,7 @@
 # Automated tests for the `coloredlogs' package.
 #
 # Author: Peter Odding <pe...@peterodding.com>
-# Last Change: February 16, 2020
+# Last Change: June 11, 2021
 # URL: https://coloredlogs.readthedocs.io
 
 """Automated tests for the `coloredlogs` package."""
@@ -18,7 +18,7 @@
 
 # External dependencies.
 from humanfriendly.compat import StringIO
-from humanfriendly.terminal import ANSI_COLOR_CODES, ansi_style, ansi_wrap
+from humanfriendly.terminal import ANSI_COLOR_CODES, ANSI_CSI, ansi_style, 
ansi_wrap
 from humanfriendly.testing import PatchedAttribute, PatchedItem, TestCase, 
retry
 from humanfriendly.text import format, random_string
 
@@ -46,7 +46,7 @@
     walk_propagation_tree,
 )
 from coloredlogs.demo import demonstrate_colored_logging
-from coloredlogs.syslog import SystemLogging, match_syslog_handler
+from coloredlogs.syslog import SystemLogging, is_syslog_supported, 
match_syslog_handler
 from coloredlogs.converter import (
     ColoredCronMailer,
     EIGHT_COLOR_PALETTE,
@@ -185,6 +185,13 @@
         # https://travis-ci.org/xolox/python-coloredlogs/jobs/325245853
         retry(lambda: check_contents(system_log_file, expected_message, True))
 
+    def test_system_logging_override(self):
+        """Make sure the :class:`coloredlogs.syslog.is_syslog_supported` 
respects the override."""
+        with PatchedItem(os.environ, 'COLOREDLOGS_SYSLOG', 'true'):
+            assert is_syslog_supported() is True
+        with PatchedItem(os.environ, 'COLOREDLOGS_SYSLOG', 'false'):
+            assert is_syslog_supported() is False
+
     def test_syslog_shortcut_simple(self):
         """Make sure that ``coloredlogs.install(syslog=True)`` works."""
         system_log_file = self.find_system_log()
@@ -389,6 +396,77 @@
             assert severity in last_line
             assert PLAIN_TEXT_PATTERN.match(last_line)
 
+    def test_dynamic_stderr_lookup(self):
+        """Make sure coloredlogs.install() uses StandardErrorHandler when 
possible."""
+        coloredlogs.install()
+        # Redirect sys.stderr to a temporary buffer.
+        initial_stream = StringIO()
+        initial_text = "Which stream will receive this text?"
+        with PatchedAttribute(sys, 'stderr', initial_stream):
+            logging.info(initial_text)
+        assert initial_text in initial_stream.getvalue()
+        # Redirect sys.stderr again, to a different destination.
+        subsequent_stream = StringIO()
+        subsequent_text = "And which stream will receive this other text?"
+        with PatchedAttribute(sys, 'stderr', subsequent_stream):
+            logging.info(subsequent_text)
+        assert subsequent_text in subsequent_stream.getvalue()
+
+    def test_force_enable(self):
+        """Make sure ANSI escape sequences can be forced (bypassing 
auto-detection)."""
+        interpreter = subprocess.Popen([
+            sys.executable, "-c", ";".join([
+                "import coloredlogs, logging",
+                "coloredlogs.install(isatty=True)",
+                "logging.info('Hello world')",
+            ]),
+        ], stderr=subprocess.PIPE)
+        stdout, stderr = interpreter.communicate()
+        assert ANSI_CSI in stderr.decode('UTF-8')
+
+    def test_auto_disable(self):
+        """
+        Make sure ANSI escape sequences are not emitted when logging output is 
being redirected.
+
+        This is a regression test for 
https://github.com/xolox/python-coloredlogs/issues/100.
+
+        It works as follows:
+
+        1. We mock an interactive terminal using 'capturer' to ensure that this
+           test works inside test drivers that capture output (like pytest).
+
+        2. We launch a subprocess (to ensure a clean process state) where
+           stderr is captured but stdout is not, emulating issue #100.
+
+        3. The output captured on stderr contained ANSI escape sequences after
+           this test was written and before the issue was fixed, so now this
+           serves as a regression test for issue #100.
+        """
+        with CaptureOutput():
+            interpreter = subprocess.Popen([
+                sys.executable, "-c", ";".join([
+                    "import coloredlogs, logging",
+                    "coloredlogs.install()",
+                    "logging.info('Hello world')",
+                ]),
+            ], stderr=subprocess.PIPE)
+            stdout, stderr = interpreter.communicate()
+            assert ANSI_CSI not in stderr.decode('UTF-8')
+
+    def test_env_disable(self):
+        """Make sure ANSI escape sequences can be disabled using 
``$NO_COLOR``."""
+        with PatchedItem(os.environ, 'NO_COLOR', 'I like monochrome'):
+            with CaptureOutput() as capturer:
+                subprocess.check_call([
+                    sys.executable, "-c", ";".join([
+                        "import coloredlogs, logging",
+                        "coloredlogs.install()",
+                        "logging.info('Hello world')",
+                    ]),
+                ])
+                output = capturer.get_text()
+                assert ANSI_CSI not in output
+
     def test_html_conversion(self):
         """Check the conversion from ANSI escape sequences to HTML."""
         # Check conversion of colored text.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/coloredlogs-14.0/coloredlogs.egg-info/PKG-INFO 
new/coloredlogs-15.0.1/coloredlogs.egg-info/PKG-INFO
--- old/coloredlogs-14.0/coloredlogs.egg-info/PKG-INFO  2020-02-16 
21:51:08.000000000 +0100
+++ new/coloredlogs-15.0.1/coloredlogs.egg-info/PKG-INFO        2021-06-11 
12:22:40.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: coloredlogs
-Version: 14.0
+Version: 15.0.1
 Summary: Colored terminal output for Python's logging module
 Home-page: https://coloredlogs.readthedocs.io
 Author: Peter Odding
@@ -19,10 +19,10 @@
         module. The ColoredFormatter_ class inherits from `logging.Formatter`_ 
and uses
         `ANSI escape sequences`_ to render your logging messages in color. It 
uses only
         standard colors so it should work on any UNIX terminal. It's currently 
tested
-        on Python 2.7, 3.5+ and PyPy. On Windows `coloredlogs` automatically 
tries to
-        enable native ANSI support (on up-to-date Windows 10 installations) 
and falls
-        back on using colorama_ (if installed). Here is a screen shot of the 
demo that
-        is printed when the command ``coloredlogs --demo`` is executed:
+        on Python 2.7, 3.5+ and PyPy (2 and 3). On Windows `coloredlogs` 
automatically
+        tries to enable native ANSI support (on up-to-date Windows 10 
installations)
+        and falls back on using colorama_ (if installed). Here is a screen 
shot of the
+        demo that is printed when the command ``coloredlogs --demo`` is 
executed:
         
         .. image:: 
https://coloredlogs.readthedocs.io/en/latest/_images/defaults.png
         
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/coloredlogs-14.0/coloredlogs.egg-info/requires.txt 
new/coloredlogs-15.0.1/coloredlogs.egg-info/requires.txt
--- old/coloredlogs-14.0/coloredlogs.egg-info/requires.txt      2020-02-16 
21:51:08.000000000 +0100
+++ new/coloredlogs-15.0.1/coloredlogs.egg-info/requires.txt    2021-06-11 
12:22:40.000000000 +0200
@@ -1,4 +1,4 @@
-humanfriendly>=7.1
+humanfriendly>=9.1
 
 [cron]
 capturer>=2.4
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/coloredlogs-14.0/requirements.txt 
new/coloredlogs-15.0.1/requirements.txt
--- old/coloredlogs-14.0/requirements.txt       2020-02-16 21:50:46.000000000 
+0100
+++ new/coloredlogs-15.0.1/requirements.txt     2020-12-10 14:08:39.000000000 
+0100
@@ -1 +1 @@
-humanfriendly >= 7.1
+humanfriendly >= 9.1

Reply via email to