Skip to content

Case sensitivite filesystems and pycrypto dependency break module #65

@tsujamin

Description

@tsujamin

I am unable to use potr on my Macbook due to case insensitivity but preserving nature of HFS+.

File "/usr/local/lib/python2.7/site-packages/potr/__init__.py", line 21, in <module>
from potr import context
File "/usr/local/lib/python2.7/site-packages/potr/context.py", line 43, in <module>
from potr import crypt
File "/usr/local/lib/python2.7/site-packages/potr/crypt.py", line 25, in <module>
from potr.compatcrypto import SHA256, SHA1, SHA1HMAC, SHA256HMAC, \
File "/usr/local/lib/python2.7/site-packages/potr/compatcrypto/__init__.py", line 21, in <module>
from potr.compatcrypto.pycrypto import *
File "/usr/local/lib/python2.7/site-packages/potr/compatcrypto/pycrypto.py", line 18, in <module>
from Crypto import Cipher
ImportError: No module named Crypto

The issue appears to be caused by the importing of pycrypto in the uppercase form in the following lines

from Crypto import Cipher
from Crypto.Hash import SHA256 as _SHA256
from Crypto.Hash import SHA as _SHA1
from Crypto.Hash import HMAC as _HMAC
from Crypto.PublicKey import DSA
from Crypto.Random import random

It appears that when pip installs pycrypto, it names the module in the lower-cased convention such that the upper-case variant, used by potr, cannot be imported

>>> import Crypto
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named Crypto
>>> import crypto
>>>

For the moment I've renamed my local pycrypto to the upper-case, and I was going to submit a trivial PR to lower-case the imports in potr but I'm not well versed enough on running Python on other platforms to know whether this might introduce new issues.

I'm also not sure if this is technically a potr problem of a pycrypto problem, so I'm happy to move this issue if required.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions