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

Font setting error (on init) for Tabs and Debug Console after f035d4f3 #3096

Closed
bitraid opened this issue Oct 12, 2017 · 5 comments
Closed

Font setting error (on init) for Tabs and Debug Console after f035d4f3 #3096

bitraid opened this issue Oct 12, 2017 · 5 comments

Comments

@bitraid
Copy link
Contributor

@bitraid bitraid commented Oct 12, 2017

Let's assume a simple config.py:

c.fonts.monospace = '"xos4 Terminus"'
c.fonts.tabs = '14px monospace'
c.fonts.debug_console = '14px monospace'

I get this error:

Errors occurred while reading config.py: 
Unhandled exception: 'NoneType' object has no attribute 'replace' 
Traceback (most recent call last):
  File "/home/bitraid/bin/qutebrowser/qutebrowser/config/configfiles.py", line 406, in read_config_py
    exec(code, module.__dict__)
  File "/home/bitraid/.config/qutebrowser/config.py", line 3, in <module>
    c.fonts.debug_console = '14px monospace'
  File "/home/bitraid/bin/qutebrowser/qutebrowser/config/config.py", line 460, in __setattr__
    self._config.set_obj(name, value)
  File "/home/bitraid/bin/qutebrowser/qutebrowser/config/config.py", line 323, in set_obj
    self._set_value(self.get_opt(name), value)
  File "/home/bitraid/bin/qutebrowser/qutebrowser/config/config.py", line 257, in _set_value
    opt.typ.to_py(value)  # for validation
  File "/home/bitraid/bin/qutebrowser/qutebrowser/config/configtypes.py", line 1077, in to_py
    family = family.replace('"', '').replace("'", '')
AttributeError: 'NoneType' object has no attribute 'replace'

If i do a config-source after qutebrowser starts the values are read ok.

@The-Compiler

This comment has been minimized.

Copy link
Member

@The-Compiler The-Compiler commented Oct 12, 2017

Whoops... Looks like a v1.0.1 will happen rather sooner than later.

@The-Compiler

This comment has been minimized.

Copy link
Member

@The-Compiler The-Compiler commented Oct 12, 2017

Also affects autoconfig.yml:

Traceback (most recent call last):
  File "/usr/bin/qutebrowser", line 11, in <module>
    load_entry_point('qutebrowser==1.0.0', 'gui_scripts', 'qutebrowser')()
  File "/usr/lib/python3.6/site-packages/qutebrowser/qutebrowser.py", line 186, in main
    return app.run(args)
  File "/usr/lib/python3.6/site-packages/qutebrowser/app.py", line 100, in run
    configinit.early_init(args)
  File "/usr/lib/python3.6/site-packages/qutebrowser/config/configinit.py", line 61, in early_init
    configfiles.read_autoconfig()
  File "/usr/lib/python3.6/site-packages/qutebrowser/config/configfiles.py", line 423, in read_autoconfig
    config.instance.read_yaml()
  File "/usr/lib/python3.6/site-packages/qutebrowser/config/config.py", line 268, in read_yaml
    self._set_value(self.get_opt(name), value)
  File "/usr/lib/python3.6/site-packages/qutebrowser/config/config.py", line 257, in _set_value
    opt.typ.to_py(value)  # for validation
  File "/usr/lib/python3.6/site-packages/qutebrowser/config/configtypes.py", line 1077, in to_py
    family = family.replace('"', '').replace("'", '')
AttributeError: 'NoneType' object has no attribute 'replace'
@The-Compiler

This comment has been minimized.

Copy link
Member

@The-Compiler The-Compiler commented Oct 12, 2017

As a workaround, do this in a ~/.config/qutebrowser/config.py:

from qutebrowser.config import configtypes
configtypes.Font.monospace_fonts = c.fonts.monospace
config.load_autoconfig()
The-Compiler added a commit that referenced this issue Oct 12, 2017
The-Compiler added a commit that referenced this issue Oct 12, 2017
See #3096

(cherry picked from commit 4f870f9)
@The-Compiler

This comment has been minimized.

Copy link
Member

@The-Compiler The-Compiler commented Oct 12, 2017

Fixed in master and the v1.0.x branch now. Leaving this open for visibility for now, and I'm probably going to release a v1.0.1 later today.

@The-Compiler

This comment has been minimized.

Copy link
Member

@The-Compiler The-Compiler commented Oct 13, 2017

v1.0.1 is uploadinged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.