JJMC89 added a comment.

  @atagar: When I run the below code with your patch (PS4), I don't see any 
warnings for using `NoPage`.
  
  name=t.py
    import pywikibot
    from pywikibot import NoPage  # same behavior if imported from 
pywikibot.exceptions
    from pywikibot.exceptions import NoPageError
    
    pywikibot.handle_args()
    site = pywikibot.Site()
    page = pywikibot.Page(site, 'Example')
    
    try:
        raise NoPage(page)
    except NoPageError as e:
        print('success: NoPageError caught NoPage:', e)
  
  
  
    $ python t.py -log:t.log
    success: NoPageError caught NoPage: Page [[en:Example]] doesn't exist.
    $ cat logs/t.log
    [...]
    2021-04-27 18:24:14             bot.py,  367 in     writelogheader: VERBOSE 
 === Pywikibot framework v6.1.1.dev0 -- Logging header ===
    2021-04-27 18:24:14             bot.py,  370 in     writelogheader: VERBOSE 
 COMMAND: ['t.py', '-log:t.log']
    2021-04-27 18:24:14             bot.py,  373 in     writelogheader: VERBOSE 
 DATE: 2021-04-28 01:24:14.810969 UTC
    2021-04-27 18:24:14             bot.py,  378 in     writelogheader: VERBOSE 
 VERSION: [ssh] pywikibot-core (20cf3df, g14708, 2021/04/23, 22:28:45, n/a)
    2021-04-27 18:24:14             bot.py,  384 in     writelogheader: VERBOSE 
 SYSTEM: posix.uname_result(sysname='Linux', nodename='DESKTOP-PNGJ3TJ', 
release='4.4.0-19041-Microsoft', version='#488-Microsoft Mon Sep 01 13:43:00 
PST 2020', machine='x86_64')
    [...]
    2021-04-27 18:24:14             bot.py,  431 in     writelogheader: VERBOSE 
 =========================================================
    2021-04-27 18:24:14        throttle.py,  147 in  checkMultiplicity: VERBOSE 
 Found 1 wikipedia:en processes running, including this one.
    2021-04-27 18:24:14        __init__.py, 1272 in             _flush: VERBOSE 
 Dropped throttle(s).
    2021-04-27 18:24:14            http.py,   79 in             _flush: VERBOSE 
 Closing network session.
    2021-04-27 18:24:14            http.py,   85 in             _flush: VERBOSE 
 Network session closed.

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

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

To: atagar, JJMC89
Cc: JJMC89, pywikibot-bugs-list, Xqt, Aklapper, Shalomori123, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Alter-paule, Beast1978, Un1tY, Khutuck, 
Zkhalido, Hook696, Kent7301, joker88john, Viztor, CucyNoiD, Wenyi, Gaboe420, 
Giuliamocci, Cpaulf30, Af420, Bsandipan, Tbscho, MayS, Lewizho99, Mdupont, 
Maathavan, Dvorapa, Altostratus, Avicennasis, mys_721tx, jayvdb, Masti, 
Alchimista
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to