]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Remove blib2to3 grammar cache logging (#3193)
authorRichard Si <63936253+ichard26@users.noreply.github.com>
Sat, 30 Jul 2022 03:28:43 +0000 (23:28 -0400)
committerGitHub <noreply@github.com>
Sat, 30 Jul 2022 03:28:43 +0000 (20:28 -0700)
As error logs are emitted often (they happen when Black's cache
directory is created after blib2to3 tries to write its cache) and cause
issues to be filed by users who think Black isn't working correctly.

These errors are expected for now and aren't a cause for concern so
let's remove them to stop worrying users (and new issues from being
opened). We can improve the blib2to3 caching mechanism to write its
cache at the end of a successful command line invocation later.

CHANGES.md
src/blib2to3/pgen2/driver.py

index e027b2cae714deb9c04c8903fc309711dc888e55..a30ac7f25e19a4f7971fc9ebab90d1de5367d301 100644 (file)
@@ -54,6 +54,8 @@
 
 - Change from deprecated `asyncio.get_event_loop()` to create our event loop which
   removes DeprecationWarning (#3164)
+- Remove logging from internal `blib2to3` library since it regularily emits error logs
+  about failed caching that can and should be ignored (#3193)
 
 ### Packaging
 
index 8fe820651da728ac423fb8823753f829b2a9abd7..daf271dfa9ab50d8b22c58405b694edfff3ede41 100644 (file)
@@ -263,14 +263,13 @@ def load_grammar(
         logger = logging.getLogger(__name__)
     gp = _generate_pickle_name(gt) if gp is None else gp
     if force or not _newer(gp, gt):
-        logger.info("Generating grammar tables from %s", gt)
         g: grammar.Grammar = pgen.generate_grammar(gt)
         if save:
-            logger.info("Writing grammar tables to %s", gp)
             try:
                 g.dump(gp)
-            except OSError as e:
-                logger.info("Writing failed: %s", e)
+            except OSError:
+                # Ignore error, caching is not vital.
+                pass
     else:
         g = grammar.Grammar()
         g.load(gp)