NameError: global name 'descriptor' is not defined #461

Closed
liminspace opened this Issue Dec 23, 2014 · 16 comments

Projects

None yet

9 participants

@liminspace

There is error if use in windows.
File _winapi.py:220

@descriptor.setter
def descriptor(self, value):
    self._descriptor = descriptor
    self.lpSecurityDescriptor = ctypes.addressof(descriptor)

Maybe must be so:

@descriptor.setter
def descriptor(self, value):
    self._descriptor = value
    self.lpSecurityDescriptor = ctypes.addressof(value)
@liminspace

Please fix it and update version.

@ThiefMaster
Contributor

I'd love to see unittests for this kind of stuff... Also, using a decent IDE would show you that error immediately ;)

@liminspace

You are not seeing mistake in method "descriptor"? Variable "descriptor" does not exists in global namespace. There are simple things for which UnitTests are not necessary.

@ThiefMaster
Contributor

Yes I do see the mistake. My comment was more directed to the paramiko devs than you. Having unit tests for e.g. the pageant integration would avoid such errors ending up in a release (same for the python3 issue related to bytestrings/unicode in the pageant interface of the previous version)

@liminspace

I agree with You :)

@lndbrg
Contributor
lndbrg commented Dec 28, 2014

This is an open source product and you are always free to submit pull requests for improvements.

@perryjrandall
Contributor

There is currently CI that should catch this kind of error and ensure compatibility with python2.6 - 3.4
https://travis-ci.org/paramiko/paramiko
Though it wont prevent you from committing AFAIK

@liminspace

Maybe this error is happening in Windows only. Your CI is working in linux.

@bitprophet
Member

Unfortunately, Windows support is strictly on a user-driven basis as neither the developers' local platforms, nor the CI platform (Travis) support Windows. We'll usually merge pull requests that have multiple +1s from Windows users, & which are proven not to break POSIX platforms :)

@liminspace

Why this discussion, if there is an elementary error in the code that can be corrected in 5 seconds?

@hobbsd
hobbsd commented Jan 8, 2015

+1

@sanseihappa
Contributor

+1

@sorami
sorami commented Jan 24, 2015

+1

@perryjrandall
Contributor

@liminspace because talk is cheap XD

@mikedep333

+1
@ThiefMaster's fix works fine

@bitprophet
Member

Merging this with #469

@bitprophet bitprophet closed this Jan 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment