datetime: /etc/timezone does not exist on Debian bookworm
It looks like this file has been removed on Debian bookworm. I confirmed this on multiple systems.
Feb 24 17:44:17 freedombox /usr/bin/plinth[25284]: Internal Server Error: /plinth/sys/datetime/
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/plinth/views.py", line 172, in dispatch
return super().dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/django/views/generic/base.py", line 98, in dispatch
return handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/django/views/generic/edit.py", line 133, in get
return self.render_to_response(self.get_context_data())
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/plinth/views.py", line 261, in get_context_data
context = super().get_context_data(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/django/views/generic/edit.py", line 66, in get_context_data
kwargs['form'] = self.get_form()
^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/plinth/views.py", line 206, in get_form
return super().get_form(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/django/views/generic/edit.py", line 33, in get_form
return form_class(**self.get_form_kwargs())
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/django/views/generic/edit.py", line 38, in get_form_kwargs
'initial': self.get_initial(),
^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/plinth/modules/datetime/views.py", line 27, in get_initial
status['time_zone'] = self.get_current_time_zone()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/plinth/modules/datetime/views.py", line 34, in get_current_time_zone
time_zone = path.read_text(encoding='utf-8').rstrip()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/pathlib.py", line 1059, in read_text
with self.open(mode='r', encoding=encoding, errors=errors) as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/pathlib.py", line 1045, in open
return io.open(self, mode, buffering, encoding, errors, newline)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/etc/timezone'