livefs-editor icon indicating copy to clipboard operation
livefs-editor copied to clipboard

object not callable

Open JerryGeis opened this issue 1 year ago • 4 comments

I am trying to use livefs-edit and get an error

livefs-edit ubuntu-22.04.3-live-server-amd64.iso test.iso --cp grub.cfg /boot/grub/grub.cfg Traceback (most recent call last): File "/usr/local/bin/livefs-edit", line 8, in sys.exit(main()) TypeError: 'module' object is not callable

All I want to do is replace the grub.cfg file on the ubuntu live server cd.

I did "pip3 install livefs-editor", and then ran the above command. What do I do with this error ?

Jerry

JerryGeis avatar Nov 28 '23 15:11 JerryGeis

OK - I found something to help with the above error: Change /usr/local/bin/livefs-edit last line to this sys.exit(main.main(sys.argv[1:]))

but now when I run I get this:

livefs-edit ubuntu-22.04.3-live-server-amd64.iso test.iso --cp grub.cfg /boot/grub/grub.cfg running cp with arguments {'source': 'grub.cfg', 'dest': '/boot/grub/grub.cfg'} Traceback (most recent call last): File "/usr/local/bin/livefs-edit", line 8, in sys.exit(main.main(sys.argv[1:])) File "/usr/local/lib/python3.10/dist-packages/livefs_edit/main.py", line 66, in main func(ctxt, **kw) File "/usr/local/lib/python3.10/dist-packages/livefs_edit/actions.py", line 105, in cp shutil.copy(ctxt.p(source), ctxt.p(dest)) File "/usr/lib/python3.10/shutil.py", line 417, in copy copyfile(src, dst, follow_symlinks=follow_symlinks) File "/usr/lib/python3.10/shutil.py", line 254, in copyfile with open(src, 'rb') as fsrc: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpzuccifq1/grub.cfg'

Jerry

JerryGeis avatar Nov 28 '23 15:11 JerryGeis

I was getting the same issue, but looks like calling it like this works:

python3 -m livefs_edit ./ubuntu-22.04.3-live-server-amd64.iso ./test.iso

TechSupportJosh avatar Nov 28 '23 15:11 TechSupportJosh

I get this now.

python3 -m livefs_edit ./ubuntu-22.04.3-live-server-amd64.iso ./test.iso --cp /home/silentm/CDROM.iso/Ubuntu.22.04/grub.cfg /boot/grub/grub.cfg running cp with arguments {'source': '/home/silentm/CDROM.iso/Ubuntu.22.04/grub.cfg', 'dest': '/boot/grub/grub.cfg'} no changes!

and no test.iso

Jerry

JerryGeis avatar Nov 28 '23 15:11 JerryGeis

If I remove the path - then I get an error

python3 -m livefs_edit ./ubuntu-22.04.3-live-server-amd64.iso ./test.iso --cp grub.cfg /boot/grub/grub.cfg running cp with arguments {'source': 'grub.cfg', 'dest': '/boot/grub/grub.cfg'} Traceback (most recent call last): File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.10/dist-packages/livefs_edit/main.py", line 75, in main(sys.argv[1:]) File "/usr/local/lib/python3.10/dist-packages/livefs_edit/main.py", line 66, in main func(ctxt, **kw) File "/usr/local/lib/python3.10/dist-packages/livefs_edit/actions.py", line 105, in cp shutil.copy(ctxt.p(source), ctxt.p(dest)) File "/usr/lib/python3.10/shutil.py", line 417, in copy copyfile(src, dst, follow_symlinks=follow_symlinks) File "/usr/lib/python3.10/shutil.py", line 254, in copyfile with open(src, 'rb') as fsrc: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpdpp3t2m6/grub.cfg'

Jerry

JerryGeis avatar Nov 28 '23 15:11 JerryGeis