Summary
bin/fork_counter.py begins with a stray Y immediately before the copyright comment:
Y# Copyright 2011 Splunk, Inc.
Python parses that Y as a bare expression statement referencing an undefined name, so the module raises NameError the moment it is imported. The file is still syntactically valid, which is why linters and ast.parse do not flag it.
Reproduction
Against the current master copy of the file:
$ python3 -c "import importlib.util; s=importlib.util.spec_from_file_location('fc','bin/fork_counter.py'); m=importlib.util.module_from_spec(s); s.loader.exec_module(m)"
NameError: name 'Y' is not defined
ast.parse() on the same file returns cleanly — the defect is at execution, not parse time.
Scope, stated honestly
Removing the stray Y is necessary but not sufficient on Python 3. With it removed, the same import instead fails with:
ModuleNotFoundError: No module named 'Queue'
Queue was renamed to queue in Python 3, so this module is Python 2 code. On a Python 2 runtime the Y is the only blocker; on Python 3 it is the first of two. I have not attempted a Python 3 port, only the one-character fix.
Fix
Deleting the single leading Y character resolves the NameError. That change is included in PR #16, which was opened for unrelated documentation typos in the same directory and happens to cover this line. Happy to split it into a standalone PR if you would prefer the fix reviewed separately from the typo changes.
Found via an automated typo scan; the surrounding grammar fixes in that PR are cosmetic, but this one is a genuine runtime defect and seemed worth reporting on its own.
Summary
bin/fork_counter.pybegins with a strayYimmediately before the copyright comment:Python parses that
Yas a bare expression statement referencing an undefined name, so the module raisesNameErrorthe moment it is imported. The file is still syntactically valid, which is why linters andast.parsedo not flag it.Reproduction
Against the current
mastercopy of the file:ast.parse()on the same file returns cleanly — the defect is at execution, not parse time.Scope, stated honestly
Removing the stray
Yis necessary but not sufficient on Python 3. With it removed, the same import instead fails with:Queuewas renamed toqueuein Python 3, so this module is Python 2 code. On a Python 2 runtime theYis the only blocker; on Python 3 it is the first of two. I have not attempted a Python 3 port, only the one-character fix.Fix
Deleting the single leading
Ycharacter resolves theNameError. That change is included in PR #16, which was opened for unrelated documentation typos in the same directory and happens to cover this line. Happy to split it into a standalone PR if you would prefer the fix reviewed separately from the typo changes.Found via an automated typo scan; the surrounding grammar fixes in that PR are cosmetic, but this one is a genuine runtime defect and seemed worth reporting on its own.