Comments (9)
@toothwalker Thanks for filing this. For-loops don't actually define their own scope so the reference to e
in the raise
call is legitimate. Are you actually seeing a pep8
error from this when you run tox -e pep8
?
Regardless of scoping, I don't like having the raise
call outside the except
block like this, so I'll fix it.
from pykmip.
Yes I was running "tox -e pep8" and got the following error:
kmip/services/kmip_client.py:228:15: F821 undefined name 'e'
I believe the problem isn't the "for" loop. It is that "e" isn't assigned until it enters the exception handler (except Exception as e).
from pykmip.
Huh, that's bizarre. I've been running pep8
on this code for a year and haven't seen that error. Out of curiosity, what version of Python are you running?
from pykmip.
Python 2.7.12 is the default. Python 3.5.2 is also on the machine. I haven't looked the scripts to see if it is explicitly calling for Python 3.FYI I'm running Linux Mint 18
from pykmip.
Correct me if I'm wrong. But it looks like you are using flake8 for pep8 tests. My flake8 is indeed using Python 3.
flake8 --version
2.5.4 (pep8: 1.7.0, pyflakes: 1.1.0, mccabe: 0.2.1) CPython 3.5.2 on Linux
from pykmip.
You're correct, we are using flake8
. When I look at the libraries installed for these runs (whether on my local system or in Travis), I see the following:
flake8
: 3.0.4
mccabe
: 0.5.2
pyflakes
: 1.2.3
And this all runs on Python 2.7.9 (at least for Travis). It's possible that you're seeing this error due to using older versions of these libraries.
from pykmip.
In the process of looking through this code again I remembered why the raise
statement is outside the loop. We only want to raise an exception if none of the potential endpoints can be connected to. If some fail, we just log the failure and keep trying. #201 simply removes the use of e
outside the except block, which should resolve your pep8
error, while still retaining original functionality.
from pykmip.
I upgrade flake8, pyflakes, and mccabe to the same versions as you. I still had the error...But your patch fixed it. Thank you.
from pykmip.
Glad to hear it. If you see any other errors like that pop up, definitely file more issues.
from pykmip.
Related Issues (20)
- sslv3 alert handshake failure HOT 1
- kmip 1.4 server -> pykmip client error with server_correlation_value in header HOT 2
- Error when trying to destroy an unrevoked key HOT 1
- The read operation timed out (PyKMIP Client)
- Constantly getting different SSL errors HOT 3
- PyKMIP on Windows platform
- Upload release wheels to pypi
- Error with SQLAlchemy 2.0.0rc1
- test_mac_with_cryptographic_failure fails HOT 1
- reading version.py causing issue while packaging product
- The master branch fails PEP8 checks
- Only Sqlite ? HOT 1
- Key Derivation throwing struct.error: unpack requires a buffer of 4 bytes HOT 4
- OSError: [Errno 107] Transport endpoint is not connected HOT 1
- Use of removed ssl.wrap_socket
- Request new release
- Self-Signed verification issue when using certificates on Windows with Python 3.8.6/3.7.9 HOT 2
- Hashicorp Vault KMIP client: kmip.core.exceptions.ReadValueError: Tried to read Base.tag HOT 7
- ipv6 support
- Signature Verification Issue Due to Missing Cryptography Backend Functions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pykmip.