FacebookChatStatistics icon indicating copy to clipboard operation
FacebookChatStatistics copied to clipboard

Error while generating PDF file from a group chat

Open notdavidcameron opened this issue 2 years ago • 8 comments

Hello,

The script seems to have issues with generating plots from group chats. It works fine with private conversations, but I get this whenever I try to generate one from a chat with many people in it:

==================================== Plots =====================================
Traceback (most recent call last):
  File "C:\Users\zzubo\Desktop\fb\FacebookChatStatistics-master\facebook_chat_statistics.py", line 187, in <module>
    main()
  File "C:\Users\zzubo\Desktop\fb\FacebookChatStatistics-master\facebook_chat_statistics.py", line 61, in main
    with PdfPages(filename) as pdf:
  File "C:\Users\zzubo\AppData\Local\Programs\Python\Python310\lib\site-packages\matplotlib\backends\backend_pdf.py", line 2686, in __init__
    self._file = PdfFile(filename, metadata=metadata)
  File "C:\Users\zzubo\AppData\Local\Programs\Python\Python310\lib\site-packages\matplotlib\backends\backend_pdf.py", line 654, in __init__
    fh, opened = cbook.to_filehandle(filename, "wb", return_opened=True)
  File "C:\Users\zzubo\AppData\Local\Programs\Python\Python310\lib\site-packages\matplotlib\cbook\__init__.py", line 451, in to_filehandle
    fh = open(fname, flag, encoding=encoding)
OSError: [Errno 22] Invalid argument: 'xxx_20210819_20211214.pdf'

xxx being list of names of people in said group chat. Is there a quick fix I could do myself? I'm not knowledgeable at all in python. Thanks!

notdavidcameron avatar Dec 15 '21 14:12 notdavidcameron