Storyyeller / enjarify

Apache License 2.0
921 stars 111 forks source link

Allow relative path for APK file #4

Closed FranklinYu closed 7 years ago

FranklinYu commented 7 years ago

Currently on Windows, enjarify foo.apk or enjarify .\foo.apk won't work; enjarify \full\path\to\foo.apk works. Is this expected?

Storyyeller commented 7 years ago

I don't normally use Windows, but I do have an old Windows laptop, so I'll try it out later and see what I can do.

Storyyeller commented 7 years ago

I just tried it on Windows 10 with a fresh checkout of Enjarify, and both enjarify foo.apk and enjarify .\foo.apk worked. Could you explain more about what problem you are having and how to reproduce it?

FranklinYu commented 7 years ago

That's weird. The stack trace in my machine (latest Windows 10) is

Traceback (most recent call last):
  File "C:\Python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\some\path\enjarify-1.0.3\enjarify\main.py", line 107, in <module>
    main()
  File "C:\some\path\enjarify-1.0.3\enjarify\main.py", line 68, in main
    with zipfile.ZipFile(args.inputfile, 'r') as z:
  File "C:\Python36\lib\zipfile.py", line 1090, in __init__
    self.fp = io.open(file, filemode)
FileNotFoundError: [Errno 2] No such file or directory: 'foo.apk'

Any more info that may help? I tried both cmd.exe and PowerShell.

Storyyeller commented 7 years ago

Sorry, I have no idea. My computer is running Python 3.4.3, but I can't imagine there'd be a regression in 3.6. I'm just using ordinary cmd.exe.

This might be a stupid question, but are you sure foo.apk exists in the current directory?

FranklinYu commented 7 years ago

I was sure because I checked cmd.exe and PowerShell, but now I'm not, because I can't even io.open() it directly in Python (so maybe my Python is screwed). I will report back if I find anything related to this project.

FranklinYu commented 7 years ago

I got it. Sorry this issue is not related to enjarify at all. I made a python3.lnk on my %PATH% pointing to C:\Python36\python.exe, but by default it always starts at C:\Python36 no matter where it is called, because this makes sense for most application shortcuts. Removing the "Start in" property solves this issue.