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

Getting odd error on Windows #51

Closed
Callero opened this issue Oct 20, 2015 · 5 comments
Closed

Getting odd error on Windows #51

Callero opened this issue Oct 20, 2015 · 5 comments
Assignees
Labels

Comments

@Callero
Copy link

Callero commented Oct 20, 2015

'''Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

from bitmath import *
Traceback (most recent call last):
File "", line 1, in
File "build\bdist.win32\egg\bitmath__init__.py", line 67, in
ImportError: No module named fcntl'''

@Callero
Copy link
Author

Callero commented Oct 20, 2015

Solved!
Seems the module makes Unix style file locking calls using fcntl.

This thread was helpful:
http://stackoverflow.com/questions/1422368/fcntl-substitute-on-windows

@tbielawa
Copy link
Owner

@Callero ACK. congrats, you're our first confirmed Win* user!

Thanks for pointing this out to me. Though the problem in that SO thread was for file-locking, that's not exactly the case in this module. Specifically, in these highlighted lines here:

https://github.com/tbielawa/bitmath/blob/master/bitmath/__init__.py#L65-L68

The fcntl library is actually used much later in the module for calculating system disk capacities (reference: https://bitmath.readthedocs.org/en/latest/module.html#bitmath-query-device-capacity )

I think what I can do for you for now is add a conditional around those imports so they only evaluate on supported *NIX systems.

Following that quick-patch I'll open a new issue on the tracker to see if I can implement Win* support for device capacity reading. I think AWS has cheap enough Windows instances to test on.

@tbielawa
Copy link
Owner

Throwing a patch together right now that will fix your import error. Do note however that the query_device_capacity function will be unavailable until I can implement support for the proper system calls on windows.

@tbielawa
Copy link
Owner

@Callero if you would like to be notified of when windows support is available for the query_device_capacity function, please add yourself to the referenced issue: #52

@Callero
Copy link
Author

Callero commented Oct 21, 2015

Wow, lightning reactions there =)
Thanks!

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

No branches or pull requests

2 participants