liftoff / pyminifier

Pyminifier is a Python code minifier, obfuscator, and compressor.
GNU General Public License v3.0
1.43k stars 221 forks source link

Weird Indentation Error #100

Open Th3Tr1ckst3r opened 6 years ago

Th3Tr1ckst3r commented 6 years ago

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()

vlachoudis commented 6 years ago

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

operatorequals commented 6 years ago

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
mathieu-aubin commented 6 years ago

CRLF issue, maybe??

vlachoudis commented 6 years ago

No crlf issue, tabs instead of spaces for indentation