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

d2lbook create fails to initialize a new book #4

Open
mohamed-ali opened this issue Jul 26, 2019 · 1 comment
Open

d2lbook create fails to initialize a new book #4

mohamed-ali opened this issue Jul 26, 2019 · 1 comment

Comments

@mohamed-ali
Copy link
Contributor

mohamed-ali commented Jul 26, 2019

I am using python 3.7 with d2lbook 0.1.9.

$ python --version 
Python 3.7.2
$ pip freeze |grep d2lbook 
d2lbook==0.1.9

When I try to initialize a new project with the two example commands in the documentation, I get the following error message:

$ d2lbook create mybook

Error:

--- Logging error ---
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 1034, in emit
    msg = self.format(record)
  File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 880, in format
    return fmt.format(record)
  File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 619, in format
    record.message = record.getMessage()
  File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 380, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "/Users/SomeUser/Desktop/workspace/books/bin/d2lbook", line 10, in <module>
    sys.exit(main())
  File "/Users/SomeUser/Desktop/workspace/books/lib/python3.7/site-packages/d2lbook/main.py", line 17, in main
    config = Config('config.ini')
  File "/Users/SomeUser/Desktop/workspace/books/lib/python3.7/site-packages/d2lbook/config.py", line 8, in __init__
    logging.fatal('Failed to find the config', config_fname)
Message: 'Failed to find the config'
Arguments: ('config.ini',)
[d2lbook:config.py:L9] CRITICAL You can use "d2lbook create ." to create a default config
$ d2lbook create mybook --demo
--- Logging error ---
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 1034, in emit
    msg = self.format(record)
  File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 880, in format
    return fmt.format(record)
  File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 619, in format
    record.message = record.getMessage()
  File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 380, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "/Users/SomeUser/Desktop/workspace/books/bin/d2lbook", line 10, in <module>
    sys.exit(main())
  File "/Users/SomeUser/Desktop/workspace/books/lib/python3.7/site-packages/d2lbook/main.py", line 17, in main
    config = Config('config.ini')
  File "/Users/SomeUser/Desktop/workspace/books/lib/python3.7/site-packages/d2lbook/config.py", line 8, in __init__
    logging.fatal('Failed to find the config', config_fname)
Message: 'Failed to find the config'
Arguments: ('config.ini',)
[d2lbook:config.py:L9] CRITICAL You can use "d2lbook create ." to create a default config

My assumption is that if the config.ini doesn't exist it will be created automatically.

@mli Do you know how to fix this? Thanks.

@mli
Copy link
Member

mli commented Jul 27, 2019

Thanks for pointing it out. That's a missing feature.. We need to put the files in the demo/ folder into the pypi package. But I don't have a plan to fix it right now. It'll be wonder if you could contribute it:)

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

2 participants