pyzmail icon indicating copy to clipboard operation
pyzmail copied to clipboard

indentation error in utils.py

Open Death916 opened this issue 6 years ago • 9 comments

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

Death916 avatar Jul 02 '18 02:07 Death916

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

d-ricke avatar Aug 17 '18 04:08 d-ricke

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

Greco1899 avatar Aug 19 '18 11:08 Greco1899

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 avatar Sep 19 '18 19:09 helixglobal

i have the same problem. can anyone help please.

zhanghaiping1 avatar Sep 21 '18 11:09 zhanghaiping1

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.

marko-knoebl avatar Nov 08 '18 09:11 marko-knoebl

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".

ReviewEdge avatar Jan 03 '19 22:01 ReviewEdge

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

ghost avatar Jan 26 '19 22:01 ghost

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.

pajiji avatar Feb 13 '19 18:02 pajiji

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!

sebidelamata avatar Jan 25 '20 20:01 sebidelamata