Basilicofresco created this task.
Basilicofresco added projects: Pywikibot-core, Pywikibot-replace.py.
Herald added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION

Hi! I noticed that replace.py does not apply the exceptions "text-contains" listed in user-fixes.py.

I'm running Python 3.5.2 and an updated pywikibot-core on Win7.

Pywikibot: [https] r-pywikibot-core.git (6a84859, g7382, 2016/08/06, 00:29:37, n/a)
Release version: 3.0-dev
requests version: 2.9.1
  cacerts: C:\Users\Dave\AppData\Local\Programs\Python\Python35\lib\site-packages\requests\cacert.pem
    certificate test: ok
Python: 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)]
PYWIKIBOT2_DIR: Not set
PYWIKIBOT2_DIR_PWB: C:\pywikicore
PYWIKIBOT2_NO_USER_CONFIG: Not set
Config base dir: C:\pywikicore
Usernames for family "wikipedia":
        it: FrescoBot (no sysop configured)
        en: FrescoBot (no sysop configured)
        es: FrescoBot (no sysop configured)
Usernames for family "commons":
        commons: FrescoBot (no sysop configured)

For example this is a sample fix in my user-fixes.py:

fixes['test_exc'] = {
    'regex': True,
    'recursive': False,
    'msg': {
              'en': 'Bot: test',
              'it': 'Bot: test'
        },
    'replacements': [

('great', r'neat'),

],
    'exceptions': {
            'inside-tags': [
                        'hyperlink',
#                       'template',
                        'comment',
                        'timeline',
##                      'gallery',
                        'math',
                        'pre',
##                      'startspace',
                        'source', 
                        'nowiki'
                        ],
            'text-contains': [
                        r'test',
                        ]
        }
}

if I simply run replace.py with this fix on a page that contains only "this is a great test...", the bot tries to replace "great". The problem is that this page should be skipped. Is it my fault?


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

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

To: Basilicofresco
Cc: Aklapper, pywikibot-bugs-list, Basilicofresco, Mdupont, JJMC89, jayvdb
_______________________________________________
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to