Initially reported in https://github.com/oVirt/ovirt-engine-sdk/issues/15 by cclauss Quoting: """ Legacy **print** statements are syntax errors in Python 3 but **print()** function works as expected in both Python 2 and Python 3. [flake8](http://flake8.pycqa.org) testing of https://github.com/oVirt/ovirt-engine-sdk on Python 3.7.1 $ **flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics** ``` ./automation/build.py:155:68: F821 undefined name 'version' print("SDK version \"%s\" doesn't match format \"%s\"." % (version, version_re.pattern)) ^ ./sdk/setup.py:52:13: F821 undefined name 'VERSION' version=VERSION, ^ ./sdk/examples/add_vm_snapshot.py:36:7: F821 undefined name 'logger' log=logger.getLogger(), ^ ./sdk/examples/upload_disk_snapshots.py:137:23: E999 SyntaxError: invalid syntax print r.status, r.reason, "Completed", "{:.0%}".format(pos / float(size)) ^ ./sdk/examples/attach_nfs_data_storage_domain.py:38:9: F821 undefined name 'logger' log=logger.getLogger(), ^ ./sdk/examples/download_disk_snapshots.py:93:40: E999 SyntaxError: invalid syntax print "Downloading disk snapshot %s" % disk_snapshot.id ^ ./sdk/examples/download_disk.py:131:35: F821 undefined name 'HttpException' except (EnvironmentError, HttpException): ^ 2 E999 SyntaxError: invalid syntax 5 F821 undefined name 'version' 7 ``` **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 """
In ./sdk/setup.py, the var `VERSION` is defined previously by the `exec()` function at line 36. So with regards to the issue reporting "./sdk/setup.py:52:13: F821 undefined name 'VERSION'", we could probably ignore it. A patch was posted to fix the others.
This bugzilla is included in oVirt 4.3.3 release, published on April 16th 2019. Since the problem described in this bug report should be resolved in oVirt 4.3.3 release, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report.