Meno25 created this task.
Meno25 added projects: Pywikibot, Pywikibot-Scripts.
Restricted Application added subscribers: pywikibot-bugs-list, alaa, Aklapper.

TASK DESCRIPTION
  **Command line:**
  
    python pwb.py unusedfiles -lang:test -simulate
  
  **Output:**
  
    Retrieving 50 pages from wikipedia:test.
    
    
    >>> File:--.jpg <<<
    @@ -0,0 +1,3 @@
    +
    +
    + {{Orphan file}}
    
    Edit summary: Bot: tagging file as orphaned
    Do you want to accept these changes? ([y]es, [N]o, [a]ll, [q]uit): y
    SIMULATION: edit action blocked.
    Page [[File:--.jpg]] saved
    
    0 pages read
    1 pages written
    0 pages skipped
    Execution time: 6 seconds
    Write operation time: 6.0 seconds
    Script terminated by exception:
    
    ERROR: KeyError: 0
    Traceback (most recent call last):
      File "C:\Users\Mohammed\Downloads\core\pwb.py", line 495, in <module>
        main()
      File "C:\Users\Mohammed\Downloads\core\pwb.py", line 479, in main
        if not execute():
      File "C:\Users\Mohammed\Downloads\core\pwb.py", line 463, in execute
        run_python_file(filename, script_args, module)
      File "C:\Users\Mohammed\Downloads\core\pwb.py", line 143, in 
run_python_file
        exec(compile(source, filename, 'exec', dont_inherit=True),
      File ".\scripts\unusedfiles.py", line 182, in <module>
        main()
      File ".\scripts\unusedfiles.py", line 176, in main
        bot.run()
      File "C:\Users\Mohammed\Downloads\core\pywikibot\bot.py", line 1576, in 
run
        self.treat(page)
      File ".\scripts\unusedfiles.py", line 110, in treat
        uploader = image.get_file_history().pop(0)['user']
    KeyError: 0
    CRITICAL: Exiting due to uncaught exception <class 'KeyError'>
  
  **Output of version.py:**
  
    Pywikibot: [https] r-pywikibot-core (351e2a7, g15969, 2022/02/15, 07:28:55, 
master)
    Release version: 7.0.0.dev0
    setuptools version: 60.8.2
    mwparserfromhell version: 0.6.3
    wikitextparser version: n/a
    requests version: 2.27.1
        certificate test: ok
    Python: 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 
bit (AMD64)]
  
  **Notes:**
  
  - Needed templates are defined here 
<https://github.com/wikimedia/pywikibot/blob/4e522010449a227646e6ed2d0642ba6d5a8bbda4/scripts/unusedfiles.py#L40>
 and here 
<https://github.com/wikimedia/pywikibot/blob/4e522010449a227646e6ed2d0642ba6d5a8bbda4/scripts/unusedfiles.py#L50>
  - See also: T217054: Make all scripts run on testwiki without an error 
<https://phabricator.wikimedia.org/T217054>
  
  **Request:**
  
  - Please resolve this error. Thank you.

TASK DETAIL
  https://phabricator.wikimedia.org/T301768

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Meno25
Cc: Aklapper, alaa, pywikibot-bugs-list, Meno25, Jyoo1011, JohnsonLee01, SHEKH, 
Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, Mdupont, JJMC89, 
Dvorapa, Altostratus, Avicennasis, mys_721tx, jayvdb, Masti, Alchimista
_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to