Bytes literal reported as requiring 3+ instead of 2.6+
See original GitHub issueDescribe the bug
A Python file containing a byte literal like b'foo' is reported to require Python versions greater than 3:
byte strings (b'..') require 3+
While this is true in some sense due to PEP3112 it’s also a fact that Python 2.6+ defines bytes as a synonym for str and accepts byte literals.
To Reproduce Analyze any Python file that defines a byte literal
Expected behavior Since the syntax for byte literals is allowed from Python 2.6+ I would expect the requirements to be Python 2.6+, not Python 3+
Environment (please complete the following information):
- Vermin version: 0.9.0
Additional context Nothing relevant to report
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
bytes vs bytearray in Python 2.6 and 3 - Stack Overflow
Now python 3.x is an entirely different story. As you might have suspected, it is weird why an str literal would mean a...
Read more >Strings - The Conservative Python 3 Porting Guide
Quoted string literals can be prefixed with b or u to get bytes or text, respectively. These prefixes work both in Python 2...
Read more >Screwing up Python compatibility: unicode(), str(), and bytes()
This means that if you write code to support bytes in 2.6, you are actually not writing code which is compatible with Python...
Read more >Strings in 3.X: Unicode and Binary Data - Learning Python
unicode string literal forms in 2.6 discussed ahead are gone in 3.0; use '...' in 3.0 instead, since all text strings are Unicode...
Read more >Porting Python 2 Code to Python 3 — Python 3.11.1 ...
This guide is meant to help you figure out how best to support both Python 2 & 3 simultaneously. If you are looking...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks @netromdk !
I’ve merged the fix into
masterbranch now, and uploaded version 0.9.1 to PyPi if you want to switch to using Python 3.x.