-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
errors just running the script on windows on python 3.7 #17
Comments
same, + the following when trying to list
|
I somehow missed the first report: I cannot reproduce that on Linux with Python 3.7.3. def read_path(stream):
path_len, = st_unpack('<I',stream.read(4))
print(path_len)
print(stream.read(8).rstrip(b'\0').decode('utf-8'))
stream.seek(-8, 1)
return stream.read(path_len).rstrip(b'\0').decode('utf-8').replace('/',os.path.sep) |
Before was And now |
Wait, how do you call the program? |
I just figured out that you get that error message if you don't pass any arguments to |
Thanks unpack, list and mount Unreal Engine 4 .pak archives positional arguments: optional arguments: |
It prints that help message for you when you try to pack a folder? Weird, it doesn't for me. Sorry, I don't have Windows, so I can't reproduce that problem. :(
|
It seems to be a weird bug with argument parsing. This only happens when you omit "python", and just run the script directly. The arguments are read, but the first argument doesn't get parsed properly, even though it's in argv.
args: Namespace(archive='test.pak', archive_version=3, check_integrity=False, command=Non argv: ['pack', 'test.pak', 'test']
args: Namespace(archive='test.pak', archive_version=3, check_integrity=False, command='pa argv: ['pack', 'test.pak', 'test'] Go to the line "if args.command is None:", and just above it add "args.command = argv[0]". That fixes it. |
Btw. I've also written a new tool now that doesn't require Python, but instead I provide a compiled Windows binary. It is faster, but has slightly different command line arguments and a feature for Windows users that don't want to use a terminal. That means you can write a text file that contains what you otherwise would write as the command line arguments, change the extension from .txt to .u4pak and drop that file onto u4pak.exe (or you can also associate the .u4pak extension with u4pak.exe so that a double-click will automatically open it with that). This should also keep the window open after it is done (until you press ENTER). Though I haven't tested it under Windows since I'm on Linux. |
Traceback (most recent call last):
File "u4pak.py", line 1683, in
main(sys.argv[1:])
File "u4pak.py", line 1570, in main
if args.command == 'list':
AttributeError: 'Namespace' object has no attribute 'command'
The text was updated successfully, but these errors were encountered: