aspineux / pyzmail

Pyzmail is a high level mail library for Python, providing functions to read, compose and send emails
60 stars 31 forks source link

indentation error in utils.py #18

Open Death916 opened 6 years ago

Death916 commented 6 years ago

started using python 3.7 and when i added pyzmail to my env and run a program using it i got this error:

Traceback (most recent call last): File "d:/code/emailtrade/getsignal.py", line 3, in <module> import pyzmail File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 668, in _load_unlocked File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible File "C:\Users\death\Miniconda3\envs\emailtrade\lib\site-packages\pyzmail-1.0.3-py3.7.egg\pyzmail\__init__.py", line 7, in <module> File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 963, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 906, in _find_spec File "<frozen importlib._bootstrap_external>", line 1280, in find_spec File "<frozen importlib._bootstrap_external>", line 1254, in _get_spec File "<frozen importlib._bootstrap_external>", line 1235, in _legacy_get_spec File "<frozen importlib._bootstrap>", line 441, in spec_from_loader File "<frozen importlib._bootstrap_external>", line 594, in spec_from_file_location File "C:\Users\death\Miniconda3\envs\emailtrade\lib\site-packages\pyzmail-1.0.3-py3.7.egg\pyzmail\utils.py", line 31 b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \ ^ IndentationError: unexpected indent

Does not happen if I use the 3.6 version installed using easy_install or pip

d-ricke commented 6 years ago

I seem to have had similar problems just running import pyzmail from idle.

Traceback (most recent call last): File "<pyshell#0>", line 1, in import pyzmail File "C:\Users\d_ric\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pyzmail__init__.py", line 7, in from . import utils File "C:\Users\d_ric\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pyzmail\utils.py", line 31 b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \ ^ IndentationError: unexpected indent

Greco1899 commented 6 years ago

Running Python 3.7.0, installed using easy_install, got this when running import pyzmail from IDLE.

Traceback (most recent call last): File "<pyshell#2>", line 1, in import pyzmail File "C:\Program Files\Python37\lib\site-packages\pyzmail__init__.py", line 7, in from . import utils File "C:\Program Files\Python37\lib\site-packages\pyzmail\utils.py", line 31 b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \ ^ IndentationError: unexpected indent

helixglobal commented 6 years ago

Running Python 3.7.0, installed using easy_install, got this when running import pyzmail from IDLE.

Traceback (most recent call last): File "<pyshell#2>", line 1, in import pyzmail File "C:\Program Files\Python37\lib\site-packages\pyzmailinit.py", line 7, in from . import utils File "C:\Program Files\Python37\lib\site-packages\pyzmail\utils.py", line 31 b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' ^ IndentationError: unexpected indent

zhanghaiping1 commented 6 years ago

i have the same problem. can anyone help please.

marko-knoebl commented 5 years ago

Apparently for some installations the utils.py file will end up with extra newlines.

Instead of this content:

invalid_chars_in_filename=b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f' \
                          b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \
                          b'<>:"/\\|?*\%\''

it will be like this:

invalid_chars_in_filename=b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f' \

                          b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \

                          b'<>:"/\\|?*\%\''

- resulting in a syntax error.

Not sure why this happens. It definitely only happens on some computers.

For now I've bypassed the issue by manually deleting the extra newlines from the file.

ReviewEdge commented 5 years ago

Apparently for some installations the utils.py file will end up with extra newlines.

Instead of this content:

invalid_chars_in_filename=b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f' \
                          b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \
                          b'<>:"/\\|?*\%\''

it will be like this:

invalid_chars_in_filename=b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f' \

                          b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \

                          b'<>:"/\\|?*\%\''
  • resulting in a syntax error.

Not sure why this happens. It definitely only happens on some computers.

For now I've bypassed the issue by manually deleting the extra newlines from the file.

Having the same issue, how were you able to find and edit this file? I can't get past the "pyzmail-1.0.3-py3.7.egg" file, and I'm looking for "venv\lib\site-packages\pyzmail-1.0.3-py3.7.egg\pyzmail\utils.py".

ghost commented 5 years ago

Writing to confirm suggestion made by @marko-knoebl is the fix. Experienced this issue across 3 completely different machines all on Python3.7.

pajiji commented 5 years ago

Apparently for some installations the utils.py file will end up with extra newlines. Instead of this content:

invalid_chars_in_filename=b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f' \
                          b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \
                          b'<>:"/\\|?*\%\''

it will be like this:

invalid_chars_in_filename=b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f' \

                          b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \

                          b'<>:"/\\|?*\%\''
  • resulting in a syntax error.

Not sure why this happens. It definitely only happens on some computers. For now I've bypassed the issue by manually deleting the extra newlines from the file.

Having the same issue, how were you able to find and edit this file? I can't get past the "pyzmail-1.0.3-py3.7.egg" file, and I'm looking for "venv\lib\site-packages\pyzmail-1.0.3-py3.7.egg\pyzmail\utils.py".

change .egg to .zip and access the utils.py file to edit.

sebidelamata commented 4 years ago

Apparently for some installations the utils.py file will end up with extra newlines.

Instead of this content:

invalid_chars_in_filename=b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f' \
                          b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \
                          b'<>:"/\\|?*\%\''

it will be like this:

invalid_chars_in_filename=b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f' \

                          b'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f' \

                          b'<>:"/\\|?*\%\''
  • resulting in a syntax error.

Not sure why this happens. It definitely only happens on some computers.

For now I've bypassed the issue by manually deleting the extra newlines from the file.

Just wanted to say this worked for me (deleting the new lines in the utils.py of the pyzmail package). Did not have any issues with .egg files just opened the utils.py file in PyCharm changed it and now it works.

Thanks so much!