[tor-commits] [nyx/master] AttributeError when using --debug argument

atagar at torproject.org atagar at torproject.org
Mon Oct 26 02:04:35 UTC 2020


commit 6cd89c4e13239f170c07c559a2653b7e25e47744
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Oct 25 18:59:26 2020 -0700

    AttributeError when using --debug argument
    
    Python 3.8 removed platform.dist(), causing us to error with...
    
      Traceback (most recent call last):
        File "./run_nyx", line 14, in <module>
          nyx.main()
        File "/home/atagar/Desktop/nyx/nyx/__init__.py", line 199, in main
          nyx.starter.main()
        File "/home/atagar/Desktop/nyx/stem/util/conf.py", line 287, in wrapped
          return func(*args, config = config, **kwargs)
        File "/home/atagar/Desktop/nyx/nyx/starter.py", line 68, in main
          _setup_debug_logging(args)
        File "/home/atagar/Desktop/nyx/nyx/starter.py", line 174, in _setup_debug_logging
          platform = ' '.join(platform.dist()),
      AttributeError: module 'platform' has no attribute 'dist'
    
    Python doesn't have a builtin replacement, instead advising that users install
    the distro package...
    
      https://pypi.org/project/distro/
    
    This information isn't worth a new dependency so simply dropping it from our
    debug output.
---
 nyx/starter.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/nyx/starter.py b/nyx/starter.py
index 75f0f64..4b0d279 100644
--- a/nyx/starter.py
+++ b/nyx/starter.py
@@ -30,7 +30,7 @@ DEBUG_HEADER = """
 Nyx {nyx_version} Debug Dump
 Stem Version: {stem_version}
 Python Version: {python_version}
-Platform: {system} ({platform})
+Platform: {system}
 --------------------------------------------------------------------------------
 Nyx Configuration ({nyxrc_path}):
 {nyxrc_content}
@@ -168,7 +168,6 @@ def _setup_debug_logging(args):
     stem_version = stem.__version__,
     python_version = '.'.join(map(str, sys.version_info[:3])),
     system = platform.system(),
-    platform = ' '.join(platform.dist()),
     nyxrc_path = args.config,
     nyxrc_content = nyxrc_content,
   ))



More information about the tor-commits mailing list