d0c-s4vage/gramfuzz

Python3 : NameError: name 'NEWLINE' is not defined

ami-navon opened this issue · 2 comments

Throws exception "Python3 : NameError: name 'NEWLINE' is not defined" when running

$ python example.py -g python27 -n 1 -s 13337 --max-recursion 7

Output:

...
  File "../gramfuzz/utils.py", line 35, in val
    val = val.build(pre, shortest=shortest)
  File "../gramfuzz/fields.py", line 445, in build
    res.append(utils.val(x, pre, shortest=shortest))
  File "../gramfuzz/utils.py", line 35, in val
    val = val.build(pre, shortest=shortest)
  File "grams/python27.py", line 40, in build
    return NEWLINE().build(pre, shortest=shortest)
NameError: name 'NEWLINE' is not defined

Running with --max-recursion of 6 or lower works ok:

$ python3 example.py -g python27 -n 1 -s 13337 --max-recursion 6

Thanks for reporting the issue!

Fixed! Below is the output of running python example.py -g python27 -n 1 -s 13337 --max-recursion 6:

if (  )  if "JuckeQoBcmAKZjv"  else {  } :
    pass
    pass
    
elif lambda : "fodVOOAsmYcqbW" :pass
elif "" :pass
elif lambda : NbtIPof :pass
elif lambda : {  } :
    pass
    pass
    pass
    pass
    
for 0 , (  ) , [  ]  , "hpTHeSqCktCRkjTu"  in (  ) , :
    pass
    pass
    
import DxPRcK;
pass; exec "QhUZp" in (  ) ; print  >> {  } ;
class oKPgkk():
    pass
    pass
    pass
    pass
    pass
    pass
    pass
    pass
    pass
    pass
    
try:pass
except hUuc  as [  ]  :
    pass
    pass
    pass
    pass
    pass
    pass
    pass
    pass
    pass
    
except "GStHO"  as [  ]  :pass
import jULuZ; global jeTBr, cjebfajF, yoaqMzwOJ, bqaVUh, wYgqaQt, UlmOSGb, KwM, ahwOcgjg, DznI, QlAzmzrq; del {  } ; exec [  ]  in {  } , {  } ; continue; from . import  * ; return ; 2147483648  >>= [  ]  ; raise ; print [  ]  , ; import FZYeZNkjM