The following issues were found

tools/lib/file_helpers.py
1 issues
Unable to import 'atomicwrites'
Error

Line: 2 Column: 1

              import os
from atomicwrites import AtomicWriter


def atomic_write_in_dir(path, **kwargs):
  """Creates an atomic writer using a temporary file in the same directory
     as the destination file.
  """
  writer = AtomicWriter(path, **kwargs)

            

Reported by Pylint.

tools/lib/tests/test_caching.py
1 issues
Probable insecure usage of temp file/directory.
Security

Line: 6
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b108_hardcoded_tmp_directory.html

              import shutil
import unittest

os.environ["COMMA_CACHE"] = "/tmp/__test_cache__"
from tools.lib.url_file import URLFile, CACHE_DIR


class TestFileDownload(unittest.TestCase):


            

Reported by Bandit.

tools/lib/url_file.py
1 issues
Probable insecure usage of temp file/directory.
Security

Line: 17
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b108_hardcoded_tmp_directory.html

              K = 1000
CHUNK_SIZE = 1000 * K

CACHE_DIR = os.environ.get("COMMA_CACHE", "/tmp/comma_download_cache/")


def hash_256(link):
  hsh = str(sha256((link.split("?")[0]).encode('utf-8')).hexdigest())
  return hsh

            

Reported by Bandit.

common/cython_hacks.py
1 issues
Unable to import 'Cython.Distutils'
Error

Line: 3 Column: 1

              import os
import sysconfig
from Cython.Distutils import build_ext

def get_ext_filename_without_platform_suffix(filename):
  name, ext = os.path.splitext(filename)
  ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')

  if ext_suffix == ext:

            

Reported by Pylint.