pyminifier icon indicating copy to clipboard operation
pyminifier copied to clipboard

Weird Indentation Error

Open Th3Tr1ckst3r opened this issue 7 years ago • 4 comments

So I'm a little lost with this error. For some reason, I get an indentation error on Windows, and I've checked my python 3 code, and it runs perfectly by itself, but not with pyminifier. I ran: pyminifier --obfuscate -o test123.py test.py, and I get an indentation error. I will include the output from cmd, as well as my code example so that way we can hopefully figure out the problem. I'd really appreciate the help,

CMD Output:

C:\Users\Misleading\Desktop>pyminifier --obfuscate -o test123.py test.py Traceback (most recent call last): File "C:\Users\Misleading\AppData\Local\Programs\Python\Python36-32\Scripts\pyminifier-script.py", line 11, in load_entry_point('pyminifier==2.2', 'console_scripts', 'pyminifier')() File "c:\users\misleading\appdata\local\programs\python\python36-32\lib\site-packages\pyminifier-2.2-py3.6.egg\pyminifier_main_.py", line 171, in main File "c:\users\misleading\appdata\local\programs\python\python36-32\lib\site-packages\pyminifier-2.2-py3.6.egg\pyminifier_init_.py", line 284, in pyminify File "c:\users\misleading\appdata\local\programs\python\python36-32\lib\site-packages\pyminifier-2.2-py3.6.egg\pyminifier\minification.py", line 413, in minify File "c:\users\misleading\appdata\local\programs\python\python36-32\lib\site-packages\pyminifier-2.2-py3.6.egg\pyminifier\minification.py", line 265, in join_multiline_pairs File "C:\Users\Misleading\AppData\Local\Programs\Python\Python36-32\lib\tokenize.py", line 578, in _tokenize ("tokenize", lnum, pos, line)) File "tokenize", line 10 example.start() ^ IndentationError: unindent does not match any outer indentation level

My Working Code Example:

import sys, threading

def Threader(): if sys.platform == "win32": example = threading.Thread(target=Example) example.start() else: exit()

def Example(): print("Hello World!") exit()

if name == "main": Threader()

Th3Tr1ckst3r avatar Jan 26 '18 04:01 Th3Tr1ckst3r

I have the same error when I am using "tabs" as indentation instead of spaces.

vlachoudis avatar Mar 15 '18 08:03 vlachoudis

Please use the ``` code blocks in markdown to properly markup code like below:


# This is Python code
print "5"
def p(x) : return x + 1

operatorequals avatar Mar 19 '18 09:03 operatorequals

CRLF issue, maybe??

mathieu-aubin avatar Apr 07 '18 23:04 mathieu-aubin

No crlf issue, tabs instead of spaces for indentation

vlachoudis avatar Apr 08 '18 05:04 vlachoudis