Skip to content
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

Unexpected keyword argument #171

Closed
jabraszek opened this issue Mar 24, 2017 · 17 comments
Closed

Unexpected keyword argument #171

jabraszek opened this issue Mar 24, 2017 · 17 comments

Comments

@jabraszek
Copy link

UBUNTU16VM:/tmp/customizer-master$ customizer -gui

  • Read Configuration file: /etc/customizer.conf
    Traceback (most recent call last):
    File "/usr/sbin/customizer", line 13, in
    import actions.extract as extract
    File "/usr/share/customizer/actions/extract.py", line 5, in
    import lib.misc as misc
    File "/usr/share/customizer/lib/misc.py", line 12, in
    import lib.config as config
    File "/usr/share/customizer/lib/config.py", line 45, in
    KERNEL = '{}'.format(conf.get('saved', 'KERNEL', fallback='default'))
    TypeError: get() got an unexpected keyword argument 'fallback'

UBUNTU16VM:/tmp/customizer-master$ python --version
Python 2.7.12

No errors while running make && sudo make install

@kamilion
Copy link
Owner

kamilion commented Mar 31, 2017

Hm, interesting. Can you tell me more about this vm? is it 32bit, 64bit? Is it a variant of ubuntu such as lubuntu or mint?
Also, what is the contents of /etc/customizer.conf right now, in this broken state?
This is what mine looks like:
https://github.com/kamilion/kamikazi-core/blob/master/buildscripts/xenial/customizer-mini.conf
https://github.com/kamilion/kamikazi-core/blob/master/buildscripts/xenial/customizer-rebuild.conf

@adbuerger
Copy link

Hello @kamilion I experience the same behavior on 64 bit Xubuntu 16.04.

No problems arise during building the deb package or it's installation (though I needed to install python-pyqt5 (for building) and isolinux (for installation of the package) in addition to the packages listed at https://github.com/kamilion/customizer/wiki/First-guide).

This i what happens when I want to run customizer-gui:

~ » sudo customizer-gui
Read Configuration file: /etc/customizer.conf
Traceback (most recent call last):
  File "/usr/sbin/customizer-gui", line 29, in <module>
    import lib.config as config
  File "/usr/share/customizer/lib/config.py", line 45, in <module>
    KERNEL = '{}'.format(conf.get('saved', 'KERNEL', fallback='default'))
TypeError: get() got an unexpected keyword argument 'fallback'

The contents of /etc/customizer.conf are:

# NOTES:
#
# The paths to files should include quotes otherwise if some
# special characters or spaces are included actions will fail!
#
# Changing the WORK_DIR while in the middle of customization
# process is a very bad idea! Clean and do it after that.

[preferences]
WORK_DIR = /home/customizer
LOCALES = C
RESOLUTION = 800x600
COMPRESSION = gzip
VRAM = 256

[saved]
ISO = 
DEB = 
HOOK = 

Can I provide you further information? My standard Python version is Python 2.7.12

Thanks for your answer!

@Guran
Copy link

Guran commented Apr 5, 2017

I ran nto the same problem and solved it by changing to python3.

The fallback argument to get() is python3 specific, see https://docs.python.org/2/library/configparser.html#ConfigParser.ConfigParser.get vs https://docs.python.org/3/library/configparser.html#configparser.ConfigParser.get.

I was using commit 562164c

@ChaoticSlacker
Copy link

Guran, what do you mean you solved it by changing to python3? Which installation method did you use? Following the first guide page I do not see an option to change to python3. Did you mean that you cloned the git and ran the installer.py program with python3?

@Guran
Copy link

Guran commented Apr 15, 2017

@ChaoticSlacker Yes I cloned the git repo. I used 562164c as it was the tip at that moment. I did not use installer.py, instead running the makefile directly. In makefile there is a variable PYTHON = python2 and a comment saying it can be changed to python3. Changing to python3 fixed this issue for me but I got other errors later. I'm at another computer atm so can't say exactly what error I got.

I ended up using the 4.1.4 release and that worked for me using make && make install, Maybe I needed to install some packages, but it was fairly straightforward from what I remember.

@intialonso
Copy link

Just ran into the same issue... :( tried @Guran sugestion but I got this when trying to run sudo customizer-gui:

Traceback (most recent call last): File "/usr/sbin/customizer-gui", line 29, in <module> import lib.config as config File "/usr/share/customizer/lib/config.py", line 46, in <module> PURGE_KERNEL = '{}'.format(conf.get('saved', 'PURGE_KERNEL', fallback=True)) File "/usr/lib/python3.5/configparser.py", line 797, in get d) File "/usr/lib/python3.5/configparser.py", line 393, in before_get self._interpolate_some(parser, option, L, value, section, defaults, 1) File "/usr/lib/python3.5/configparser.py", line 410, in _interpolate_some p = rest.find("%")
Using Ubuntu 17.04, and trying to build my LXQt remix.

@kamilion
Copy link
Owner

This seems to be occurring because PURGE_KERNEL isn't being populated in the config file, and I'm still tracking down why it isn't being added, but I have a couple ideas.

Workaround's simple:

KERNEL = default
PURGE_KERNEL = True

Add this to your /etc/customizer.conf under [preferences] and [saved].

Pretty sure the problem was introduced around
8245740
and
61da86a

Also, you can provide a kernel package name instead of 'default', like

KERNEL = linux-signed-image-generic-hwe-16.04
PURGE_KERNEL = False

@MickaelCruzDB
Copy link

Hi kamilion. I have the same error message even after editing the customizer.conf file. Any solution? Thanks!

@superjamie
Copy link

It seems this was introduced by bf33d66

This works fine:

git checkout bf33d661~1
make deb
sudo dpkg -i ../customizer*.deb
sudo customizer-gui

@astur91
Copy link

astur91 commented May 21, 2017

Hi! I have the same problem on 64-bit Ubuntu 16.04

after the comand 'customizer-gui':

> * Read Configuration file: /etc/customizer.conf
> Traceback (most recent call last):
>   File "/usr/sbin/customizer-gui", line 29, in <module>
>     import lib.config as config
>   File "/usr/share/customizer/lib/config.py", line 45, in <module>
>     KERNEL = '{}'.format(conf.get('saved', 'KERNEL', fallback='default'))
> TypeError: get() got an unexpected keyword argument 'fallback'

the /etc/customizer.conf file contains:

[preferences]
WORK_DIR = /home/customizer
LOCALES = C
RESOLUTION = 800x600
COMPRESSION = gzip
VRAM = 256

[saved]
ISO = 
DEB = 
HOOK = 

Is there any solution for this?
I have tried to modify the file and change the version of python but I have not worked for me

@kooczan
Copy link

kooczan commented May 22, 2017

I've got the same problem:

Read Configuration file: /etc/customizer.conf
Traceback (most recent call last):
File "/usr/sbin/customizer-gui", line 29, in
import lib.config as config
File "/usr/share/customizer/lib/config.py", line 45, in
KERNEL = '{}'.format(conf.get('saved', 'KERNEL', fallback='default'))
TypeError: get() got an unexpected keyword argument 'fallback'

We are impatiently waiting for solution of this issue...

@seyyah
Copy link

seyyah commented May 23, 2017

It works in my Ubuntu 16.04 LTS. Thanks for @superjamie. Comment: #171 (comment)

$ uname -a
Linux ge 4.4.0-75-generic #96-Ubuntu SMP Thu Apr 20 09:56:33 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

# I did what @superjamie said
$ git checkout bf33d661~1
$ make deb
$ sudo dpkg -i ../customizer*.deb
$ sudo customizer-gui

$ sudo customizer-gui 

@superjamie
Copy link

That just checks out an old version before this bug occurs. The idea of my post was to show the author the regression point.

kamilion added a commit that referenced this issue Jun 13, 2017
Think I might have fixed #171 with this.
@kamilion
Copy link
Owner

kamilion commented Jun 13, 2017

just a reminder, make PYTHON=python3 PYQT=5; sudo make install to move up to the same code on the modern interpreter and library versions.

Running python3 installer.py will also deal with it.

Havn't tested make PYTHON=python3 PYQT=5 deb myself.

Reopen the issue if I didn't fix it, I'll give it another shot.
For whatever reason, github hasn't been sending me notifications lately.

@superjamie
Copy link

Confirmed fixed here, thank you so much!

make PYTHON=python3 PYQT=5 deb works fine too.

@kamilion
Copy link
Owner

@superjamie Does the .deb have the correct dependencies?

@kamilion
Copy link
Owner

kamilion commented Jun 14, 2017

Looks like it does not have py3/qt5 dependencies declared, due to debian/control.
Guess that's the next thing to resolve, getting the makefile to reach in and flip between py2/3 and pyqt4/5.
The errors spewed from the changelog's formatting should be gone now during make deb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests