vladimarius / imapy

Imapy: Imap for Humans
230 stars 22 forks source link

Instantiation of MailFolder class fails on regexp compilation in python 2.7 #2

Closed thegovyadina closed 8 years ago

thegovyadina commented 9 years ago

Program terminates before connection to server is established. There's an issue with regexp compilation in MailFolder.__init__() method. I got this only in 2.7. Python 3 doesn't raise an error here. UPDATE. Looks like this appears in 2.7.5 and earlier versions.

Traceback (most recent call last):
  File "/Users/x47/PycharmProjects/imapy/examples/basic.py", line 12, in <module>
    ssl=True,
  File "/Users/x47/PycharmProjects/imapy/imapy/connector.py", line 19, in connect
    imapy = imap.IMAP()
  File "/Users/x47/PycharmProjects/imapy/imapy/imap.py", line 67, in __init__
    self.mail_folder_class = MailFolder()
  File "/Users/x47/PycharmProjects/imapy/imapy/mail_folder.py", line 36, in __init__
    ''', re.VERBOSE)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 190, in compile
    return _compile(pattern, flags)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 242, in _compile
    raise error, v # invalid expression
sre_constants.error: nothing to repeat
vladimarius commented 9 years ago

I use cpython 2.7.6 for testing and i don't see this error. Are you using cpython or something else ?

thegovyadina commented 9 years ago

Yes, I use CPython. I tried 2.7.6 too and it worked fine. According to Python 2.7.6 release changelog they fixed some internal bugs in regexp engine. I guess, that's the reason.

woutervh commented 9 years ago

This is a bug in python, not imapy.