Saturday, May 26, 2012

Play cannot start with "TypeError: stat() argument 1 must be (encoded string without NULL bytes), not str"

I suddenly come into the trouble that I cannot start play on my project. Here is the error message:


Traceback (most recent call last):
  File "j:\play\play", line 143, in <module>
    cmdloader.load_play_module(module)
  File "j:\play\framework\pym\play\cmdloader.py", line 31, in load_play_module
    if os.path.exists(commands):
  File "j:\play\python\lib\genericpath.py", line 18, in exists
    st = os.stat(path)
TypeError: stat() argument 1 must be (encoded string without NULL bytes), not str
I tried to do play clean but it got the same problem. I was very annoyed and even restart the machine, the same result!!!!
And when I come to other project it was all good. So I realized that something is run with this project instead of my system. I add a "print path" statement in the genericpath.py, and it prints out this sequences:
c:\w\_lgl\play-morphia
c:\w\_lgl\play-morphia\samples-and-tests\unit-tests\modules
j:\play\modules\crud\commands.py
K-*╬╠¤│R0È3ÓÕr,J╬╚,K-õñVö▬+└$x╣£ïR‼KRStØ*üz╠¶♀tô♀ì§4éK¾¶|3ôï‗ï+ïKRsï§<¾Æ§4y╣x╣ PK♥♦
     ♦ì⌂<                  META-INF/PK♥♦¶  K½~<♥        yR♠☻  T♠  -   net/sf/oval/collection/CollectionFactory.java┼S┴j▄0►=»┴ 0Ã$deoáùñöäðÊʶB↕z▼╦│Â↕Y2Æ╝ï)²¸Äõf‼¿│öÆÂ:YofÌ╝y#↨G»{‗♀ÄÓ┌║á¼± ↔aá\commands.py
Traceback (most recent call last):
  File "j:\play\play", line 143, in 
    cmdloader.load_play_module(module)
  File "j:\play\framework\pym\play\cmdloader.py", line 31, in load_play_module
    if os.path.exists(commands):
  File "j:\play\python\lib\genericpath.py", line 19, in exists
    st = os.stat(path)
TypeError: stat() argument 1 must be (encoded string without NULL bytes), not str

hmm... yes, I got it, it's the oval validation source in jar files I've downloaded into the modules folder when I was in intellij IDEA. That explains it. Getting rid of that jar file resolves the issue.

No comments:

Post a Comment