Skip to content

Inquire how to avoid "Error: need to escape, but no escapechar set" this problem #122

Closed

Description

@Tan3364

Hi, when I tried to use whole raw logfile datasets to the parser, I used the Drain, then it showed this bug.
I wanted to ask if I need to do anything before putting it in the Drain.
But I tried any given 2k datasets, it will not show this bug.
Traceback (most recent call last):
File "C:\Users\Lenovo\Desktop\logparser-main\logparser-main\logparser\Drain\Try.py", line 56, in
parser.parse(log_file)
File "C:\Users\Lenovo.conda\envs\GLBench\lib\site-packages\logparser\Drain\Drain.py", line 312, in parse
self.outputResult(logCluL)
File "C:\Users\Lenovo.conda\envs\GLBench\lib\site-packages\logparser\Drain\Drain.py", line 237, in outputResult
self.df_log.to_csv(
File "C:\Users\Lenovo\AppData\Roaming\Python\Python310\site-packages\pandas\core\generic.py", line 3772, in to_csv
return DataFrameRenderer(formatter).to_csv(
File "C:\Users\Lenovo\AppData\Roaming\Python\Python310\site-packages\pandas\io\formats\format.py", line 1186, in to_csv
csv_formatter.save()
File "C:\Users\Lenovo\AppData\Roaming\Python\Python310\site-packages\pandas\io\formats\csvs.py", line 259, in save
self._save()
File "C:\Users\Lenovo\AppData\Roaming\Python\Python310\site-packages\pandas\io\formats\csvs.py", line 264, in _save
self._save_body()
File "C:\Users\Lenovo\AppData\Roaming\Python\Python310\site-packages\pandas\io\formats\csvs.py", line 302, in _save_body
self._save_chunk(start_i, end_i)
File "C:\Users\Lenovo\AppData\Roaming\Python\Python310\site-packages\pandas\io\formats\csvs.py", line 313, in _save_chunk
libwriters.write_csv_rows(
_File "pandas_libs\writers.pyx", line 72, in pandas._libs.writers.write_csv_rows
csv.Error: need to escape, but no escapechar set

Process finished with exit code 1

Activity

  1. sebm123 commented on Dec 9, 2024

    @sebm123
    ****
  2. Tan3364 commented on Dec 17, 2024

    @Tan3364
    Author
    ****

    Hi, could you tell me the exact processing?

  3. zhujiem commented on Feb 19, 2025

    @zhujiem
    Member

    If you encouter the issue ``Error: need to escape..." during saving csv file, please follow the modification in this PR: #120.

    If you encouter other issues, please consider using the same dependency versions as below: https://github.com/logpai/logparser/tree/main/logparser/Drain#running

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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