Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'fileno' #64

Open
sphaero opened this issue May 7, 2015 · 1 comment
Open

AttributeError: 'NoneType' object has no attribute 'fileno' #64

sphaero opened this issue May 7, 2015 · 1 comment

Comments

@sphaero
Copy link

sphaero commented May 7, 2015

I can't seem to be able to access the file descriptor...

>>> from quick2wire.gpio import pins, In, Out
>>> pins.pin(0, direction=In)
quick2wire.gpio.Pin(0)
>>> pin = pins.pin(0, direction=In)
>>> dir(pin)
['__class__', '__delattr__', '__dict__', '__doc__', '__enter__', '__eq__', '__exit__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__trigger__', '__weakref__', '_bank', '_check_open', '_direction', '_file', '_index', '_interrupt', '_pin_path', '_pull', '_soc_pin_number', '_write', 'bank', 'close', 'closed', 'direction', 'fileno', 'get', 'index', 'interrupt', 'open', 'pull', 'set', 'soc_pin_number', 'value']
>>> pin.fileno()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.2/dist-packages/quick2wire/gpio.py", line 180, in fileno
    return self._file.fileno()
AttributeError: 'NoneType' object has no attribute 'fileno'
>>> 
@sphaero
Copy link
Author

sphaero commented May 7, 2015

guess you need to call open() first, which is a bit weird?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant