[GH-ISSUE #137] Undefined names #1601

Closed
opened 2026-03-01 17:52:06 +03:00 by kerem · 1 comment
Owner

Originally created by @cclauss on GitHub (Feb 4, 2019).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/137

flake8 testing of https://github.com/pirate/ArchiveBox on Python 3.7.1

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./archivebox/parse.py:87:145: F821 undefined name 'url'
                'title': match.group(4).replace(' — Readability', '').replace('http://www.readability.com/read?url=', '') or fetch_page_title(url),
                                                                                                                                                ^
./archivebox/peekable.py:82:20: F821 undefined name 'maxsize'
            stop = maxsize if (index.stop is None) else index.stop
                   ^
./archivebox/peekable.py:85:22: F821 undefined name 'maxsize'
            stop = (-maxsize - 1) if (index.stop is None) else index.stop
                     ^
./archivebox/peekable.py:96:43: F821 undefined name 'maxsize'
            n = min(max(start, stop) + 1, maxsize)
                                          ^
./archivebox/peekable.py:99:36: F821 undefined name 'islice'
                self._cache.extend(islice(self._it, n - cache_len))
                                   ^
./archivebox/peekable.py:111:32: F821 undefined name 'islice'
            self._cache.extend(islice(self._it, index + 1 - cache_len))
                               ^
6     F821 undefined name 'url'
6

E901,E999,F821,F822,F823 are the "showstopper" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. These 5 are different from most other flake8 issues which are merely "style violations" -- useful for readability but they do not effect runtime safety.

  • F821: undefined name name
  • F822: undefined name name in __all__
  • F823: local variable name referenced before assignment
  • E901: SyntaxError or IndentationError
  • E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree
Originally created by @cclauss on GitHub (Feb 4, 2019). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/137 [flake8](http://flake8.pycqa.org) testing of https://github.com/pirate/ArchiveBox on Python 3.7.1 $ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__ ``` ./archivebox/parse.py:87:145: F821 undefined name 'url' 'title': match.group(4).replace(' — Readability', '').replace('http://www.readability.com/read?url=', '') or fetch_page_title(url), ^ ./archivebox/peekable.py:82:20: F821 undefined name 'maxsize' stop = maxsize if (index.stop is None) else index.stop ^ ./archivebox/peekable.py:85:22: F821 undefined name 'maxsize' stop = (-maxsize - 1) if (index.stop is None) else index.stop ^ ./archivebox/peekable.py:96:43: F821 undefined name 'maxsize' n = min(max(start, stop) + 1, maxsize) ^ ./archivebox/peekable.py:99:36: F821 undefined name 'islice' self._cache.extend(islice(self._it, n - cache_len)) ^ ./archivebox/peekable.py:111:32: F821 undefined name 'islice' self._cache.extend(islice(self._it, index + 1 - cache_len)) ^ 6 F821 undefined name 'url' 6 ``` __E901,E999,F821,F822,F823__ are the "_showstopper_" [flake8](http://flake8.pycqa.org) issues that can halt the runtime with a SyntaxError, NameError, etc. These 5 are different from most other flake8 issues which are merely "style violations" -- useful for readability but they do not effect runtime safety. * F821: undefined name `name` * F822: undefined name `name` in `__all__` * F823: local variable name referenced before assignment * E901: SyntaxError or IndentationError * E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree
kerem closed this issue 2026-03-01 17:52:06 +03:00
Author
Owner

@pirate commented on GitHub (Feb 5, 2019):

Ah that's strange, I could've sworn I had flake8 enabled in my editor, but it seems to have turned itself off which is why I didn't catch these much sooner.

Fixed in the latest master: ae0c20d thanks!

<!-- gh-comment-id:460485301 --> @pirate commented on GitHub (Feb 5, 2019): Ah that's strange, I could've sworn I had flake8 enabled in my editor, but it seems to have turned itself off which is why I didn't catch these much sooner. Fixed in the latest master: ae0c20d thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#1601
No description provided.