question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I see some of your programming constraints make in interrupt prematurely.

  • Like an instance where it could not find WhatsApp directory and interrupts. What I suggest you do is in your init.py or main.py you first write some checks and if required make those directories.
import os
if(not os.path.isdir('WhatsApp'):
   os.mkdir('WhatsApp')
Traceback (most recent call last):
  File "c:\users\yuvraj\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\yuvraj\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Yuvraj\AppData\Local\Programs\Python\Python39\Scripts\wtsexporter.exe\__main__.py", line 7, in <module>
  File "c:\users\yuvraj\appdata\local\programs\python\python39\lib\site-packages\Whatsapp_Chat_Exporter\__main__.py", line 122, in main
    vcard(db, data)
  File "c:\users\yuvraj\appdata\local\programs\python\python39\lib\site-packages\Whatsapp_Chat_Exporter\extract.py", line 244, in vcard
    os.mkdir(base)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'WhatsApp/vCards'
  • Avoid permission denied: You can wait for some time before deleting the folder so that it gets free from any process using it.
import time
time.sleep(3)
Gathering vCards...(67/67)
Traceback (most recent call last):
  File "c:\users\yuvraj\appdata\local\programs\python\python39\lib\shutil.py", line 806, in move
    os.rename(src, real_dst)
PermissionError: [WinError 5] Access is denied: 'WhatsApp' -> 'result/WhatsApp'
  • Still better for any non crucial operation like deleting temp folders do that in
try:
   # to delete folder
except:
   pass

because your code cascades into being totally dead on an exception

Traceback (most recent call last):
  File "c:\users\yuvraj\appdata\local\programs\python\python39\lib\shutil.py", line 806, in move
    os.rename(src, real_dst)
PermissionError: [WinError 5] Access is denied: 'WhatsApp' -> 'result/WhatsApp'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\yuvraj\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\yuvraj\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Yuvraj\AppData\Local\Programs\Python\Python39\Scripts\wtsexporter.exe\__main__.py", line 7, in <module>
  File "c:\users\yuvraj\appdata\local\programs\python\python39\lib\site-packages\Whatsapp_Chat_Exporter\__main__.py", line 126, in main
    shutil.move(options.media, f"{options.output}/")
  File "c:\users\yuvraj\appdata\local\programs\python\python39\lib\shutil.py", line 818, in move
    rmtree(src)
  File "c:\users\yuvraj\appdata\local\programs\python\python39\lib\shutil.py", line 740, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "c:\users\yuvraj\appdata\local\programs\python\python39\lib\shutil.py", line 622, in _rmtree_unsafe
    onerror(os.rmdir, path, sys.exc_info())
  File "c:\users\yuvraj\appdata\local\programs\python\python39\lib\shutil.py", line 620, in _rmtree_unsafe
    os.rmdir(path)
OSError: [WinError 145] The directory is not empty: 'WhatsApp'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
YuvrajRaghuvanshiScommented, Feb 28, 2022

It all seem to work, great job!

1reaction
KnugiHKcommented, Feb 22, 2022

Included in release 0.8.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Suggestion Definition & Meaning - Merriam-Webster
a · the act or process of suggesting ; b · something (as a thought or plan) that is suggested.
Read more >
SUGGESTION | definition in the Cambridge English Dictionary
an idea, possible plan, or action that is mentioned for other people to consider: [ C ] She made some helpful suggestions on...
Read more >
Suggestion - Definition, Meaning & Synonyms - Vocabulary.com
A suggestion is an idea someone proposes. You can accept or reject a suggestion. When someone gives an order — like in the...
Read more >
Suggestion Definition & Meaning - Dictionary.com
A suggestion is a proposal, piece of advice, or idea for consideration. Suggestion is the noun form the verb suggest. Suggestion is often...
Read more >
Suggestion definition and meaning | Collins English Dictionary
1. a suggesting or being suggested · 2. something suggested · 3. the process by which an idea is brought to the mind...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found