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

BUG: Custom date format not working #113

Open
HeuristicPerson opened this issue Aug 8, 2021 · 1 comment
Open

BUG: Custom date format not working #113

HeuristicPerson opened this issue Aug 8, 2021 · 1 comment

Comments

@HeuristicPerson
Copy link

Hi, Manolo

It seems there is a bug in the custom date_format field implementation. When I try to use my own one (or even uncomment the default sample value provided in the original configuration), I'm getting a MissingSectionHeaderError as you can see below.

/appdata $ greg sync
Traceback (most recent call last):
  File "/usr/bin/greg", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.9/site-packages/greg/parser.py", line 138, in main
    function(vars(args))
  File "/usr/lib/python3.9/site-packages/greg/commands.py", line 150, in sync
    session = c.Session(args)
  File "/usr/lib/python3.9/site-packages/greg/classes.py", line 46, in __init__
    self.data_dir = self.retrieve_data_directory()
  File "/usr/lib/python3.9/site-packages/greg/classes.py", line 86, in retrieve_data_directory
    config.read([config_filename_global, self.config_filename_user])
  File "/usr/lib/python3.9/configparser.py", line 697, in read
    self._read(fp, filename)
  File "/usr/lib/python3.9/configparser.py", line 1082, in _read
    raise MissingSectionHeaderError(fpname, lineno, line) 
configparser.MissingSectionHeaderError: File contains no section headers.
file: '/home/appuser/.config/greg/greg.conf', line: 50
'date_format = %%y/%%m/%%d\n'

I'm using Python 3.9.5 under Alpine Linux 3.14.1 and I installed greg using pip3 install greg.

@manolomartinez
Copy link
Owner

Hi, sorry for the delay in getting back to you. I think the problem is with using slashes in the date_format placeholder. Which is admittedly very stupid, given that there are slashes in the example I give in greg.conf.

Does your own custom date format have slashes in it? If so, could you please try with another date_format, say, %%d_%%m_%%y, or whatever?

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