Skip to content

UnicodeDecodeError while processing fdsn request log #54

@icarluccio

Description

@icarluccio

While processing the attached fdsn request log an error occurs on the first line.

fdsnws_requestLog.log.2024-12-30.gz

The error is reported below

Traceback (most recent call last):
  File "/usr/local/bin/eida_stats_aggregator", line 8, in <module>
    sys.exit(cli())
  File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/aggregator/aggregator.py", line 235, in cli
    statistics.parse_file(f)
  File "/usr/local/lib/python3.10/dist-packages/aggregator/aggregator.py", line 168, in parse_file
    with click.progressbar(logfile.readlines(), label=f"Parsing {filename}") as bar:
  File "/usr/lib/python3.10/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdf in position 10: invalid continuation byte

By removing the first line from the log file, the eida_stats_aggregator script runs successfully.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions