Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snyk] Security upgrade werkzeug from 2.0.3 to 2.2.3 #280

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import re
import regex as re
import sys
import warnings
from os.path import abspath, dirname, join
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tool.black]
force-exclude = '.'
2 changes: 1 addition & 1 deletion pywikibot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import atexit
import datetime
import math
import re
import regex as re
import sys
import threading
from contextlib import suppress
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/backports.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __exit__(self, *args: Any) -> None:
Mapping,
Sequence,
)
from re import Match, Pattern
from regex import Match, Pattern
Dict = dict # type: ignore[misc]
FrozenSet = frozenset # type: ignore[misc]
List = list # type: ignore[misc]
Expand Down
1 change: 1 addition & 0 deletions pywikibot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,7 @@ def current_page(self, page: 'pywikibot.page.BasePage') -> None:
stdout(msg)

def user_confirm(self, question: str) -> bool:
return True
"""Obtain user response if bot option 'always' not enabled."""
if self.opt.always:
return True
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/bot_choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Distributed under the terms of the MIT license.
#
import re
import regex as re
from abc import ABC, abstractmethod
from textwrap import fill
from typing import Any, Optional
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/comms/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#
import atexit
import codecs
import re
import regex as re
import sys
from contextlib import suppress
from http import HTTPStatus, cookiejar
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import copy
import os
import platform
import re
import regex as re
import stat
import sys
import types
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/cosmetic_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#
# Distributed under the terms of the MIT license.
#
import re
import regex as re
from contextlib import suppress
from enum import IntEnum
from typing import Any, Union
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/data/api/_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Distributed under the terms of the MIT license.
#
import datetime
import re
import regex as re
from typing import Optional

import pywikibot
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/data/api/_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import os
import pickle
import pprint
import re
import regex as re
import traceback
from collections.abc import MutableMapping
from email.mime.nonmultipart import MIMENonMultipart
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/date.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
import calendar
import datetime
import re
import regex as re
from collections import abc, defaultdict
from contextlib import suppress
from functools import singledispatch
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
#
# Distributed under the terms of the MIT license.
#
import re
import regex as re
from typing import Any, Optional, Union

import pywikibot
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
import collections
import logging
import re
import regex as re
import string
import sys
import types
Expand Down
19 changes: 15 additions & 4 deletions pywikibot/fixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@
'HTML': {
'regex': True,
'msg': 'pywikibot-fixes-html',
"generator": "-start::! -start:project:! -start:template:! -start:category:!",
'replacements': [
# Everything case-insensitive (?i)
# Keep in mind that MediaWiki automatically converts <br> to <br />
# when rendering pages, so you might comment the next two lines out
# to save some time/edits.
(r'(?i)<br *>', r'<br />'),
(r'(?i)<br */?>', r'<br>'),
# linebreak with attributes
(r'(?i)<br ([^>/]+?)>', r'<br \1 />'),
(r'(?i)<br *([^>/]+?) */?>', r'<br \1>'),
(r'(?i)<b>(.*?)</b>', r"'''\1'''"),
(r'(?i)<strong>(.*?)</strong>', r"'''\1'''"),
(r'(?i)<i>(.*?)</i>', r"''\1''"),
Expand Down Expand Up @@ -78,6 +79,7 @@
],
'exceptions': {
'inside-tags': [
"keep",
'nowiki',
'comment',
'math',
Expand Down Expand Up @@ -185,6 +187,7 @@
'syntax': {
'regex': True,
'msg': 'pywikibot-fixes-syntax',
"generator": "-start::! -start:project:! -start:template:! -start:category:!",
'replacements': [
# external link in double brackets
(r'\[\[(?P<url>https?://[^\]]+?)\]\]', r'[\g<url>]'),
Expand All @@ -199,8 +202,8 @@
# external link and description separated by a dash.
# ATTENTION: while this is a mistake in most cases, there are some
# valid URLs that contain dashes!
(r'\[(?P<url>https?://[^\|\]\s]+?) *\| *(?P<label>[^\|\]]+?)\]',
r'[\g<url> \g<label>]'),
# (r'\[(?P<url>https?://[^\|\]\s]+?) *\| *(?P<label>[^\|\]]+?)\]',
# r'[\g<url> \g<label>]'),
# wiki link closed by single bracket.
# ATTENTION: There are some false positives, for example
# Brainfuck code examples or MS-DOS parameter instructions.
Expand All @@ -217,6 +220,7 @@
],
'exceptions': {
'inside-tags': [
"keep",
'nowiki',
'comment',
'math',
Expand Down Expand Up @@ -415,6 +419,7 @@
],
'exceptions': {
'inside-tags': [
"keep",
'comment',
'hyperlink',
],
Expand Down Expand Up @@ -582,6 +587,7 @@
'en': 'Robot: Fixing special page capitalisation',
'fa': 'ربات: تصحیح بزرگی و کوچکی حروف صفحه‌های ویژه',
},
"generator": "-start::! -start:project:! -start:template:! -start:category:!",
'replacements': [
('Special:Allpages', 'Special:AllPages'),
('Special:Blockip', 'Special:BlockIP'),
Expand All @@ -602,6 +608,11 @@
('Special:Userlogout', 'Special:UserLogout'),
('Special:Whatlinkshere', 'Special:WhatLinksHere'),
],
'exceptions': {
'inside-tags': [
"keep",
],
},
},
# yu top-level domain will soon be disabled, see
# https://lists.wikimedia.org/pipermail/wikibots-l/2009-February/000290.html
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import json
import os
import pkgutil
import re
import regex as re
from collections import abc, defaultdict
from contextlib import suppress
from pathlib import Path
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/page/_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# Distributed under the terms of the MIT license.
#
import re
import regex as re
import unicodedata
from html.entities import name2codepoint

Expand Down
4 changes: 2 additions & 2 deletions pywikibot/page/_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Distributed under the terms of the MIT license.
#
import itertools
import re
import regex as re
from collections import Counter, defaultdict
from contextlib import suppress
from itertools import islice
Expand Down Expand Up @@ -1979,7 +1979,7 @@ def undelete(self, reason: Optional[str] = None) -> None:
pywikibot.output('Undeleting {}.'.format(self.title(as_link=True)))
reason = pywikibot.input(
'Please enter a reason for the undeletion:')
self.site.undelete(self, reason, revision=undelete_revs)
self.site.undelete(self, reason)

def protect(self,
reason: Optional[str] = None,
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/page/_wikibase.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Distributed under the terms of the MIT license.
#
import json as jsonlib
import re
import regex as re
from collections import OrderedDict, defaultdict
from contextlib import suppress
from itertools import chain
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/pagegenerators/_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Distributed under the terms of the MIT license.
#
import itertools
import re
import regex as re
import sys
from datetime import timedelta
from functools import partial
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/pagegenerators/_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Distributed under the terms of the MIT license.
#
import datetime
import re
import regex as re
from collections import namedtuple
from functools import partial
from typing import Optional, Union
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/pagegenerators/_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import calendar
import codecs
import io
import re
import regex as re
import sys
from collections import abc
from functools import partial
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/proofreadpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# Distributed under the terms of the MIT license.
#
import json
import re
import regex as re
import time
from functools import partial
from http import HTTPStatus
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/scripts/generate_user_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
import codecs
import os
import re
import regex as re
import sys
from collections import namedtuple
from pathlib import Path
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/site/_apisite.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Distributed under the terms of the MIT license.
#
import datetime
import re
import regex as re
import time
import typing
from collections import OrderedDict, defaultdict, namedtuple
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/site/_basesite.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Distributed under the terms of the MIT license.
#
import functools
import re
import regex as re
import threading
from typing import Optional
from warnings import warn
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/site/_siteinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
import copy
import datetime
import re
import regex as re
from collections.abc import Container
from contextlib import suppress
from typing import Any, Optional, Union
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/site_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Distributed under the terms of the MIT license.
#
import json
import re
import regex as re
from contextlib import suppress
from html.parser import HTMLParser
from http import HTTPStatus
Expand Down
3 changes: 2 additions & 1 deletion pywikibot/textlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# Distributed under the terms of the MIT license.
#
import re
import regex as re
from collections import OrderedDict, namedtuple
from collections.abc import Sequence
from contextlib import suppress
Expand Down Expand Up @@ -304,6 +304,7 @@ def _create_default_regexes() -> None:
'table': re.compile(
r'(?:(?<=\n)|\A){\|[\S\s]*?\n\|}|%s' % _tag_pattern('table')),
'template': NESTED_TEMPLATE_REGEX,
'keep': re.compile(r'<div class="as-is">[\s\S]*?</div>'),
})


Expand Down
2 changes: 1 addition & 1 deletion pywikibot/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
import datetime
import math
import re
import regex as re
import types
from typing import Type, Union

Expand Down
2 changes: 1 addition & 1 deletion pywikibot/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import ipaddress
import os
import queue
import re
import regex as re
import stat
import subprocess
import sys
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/tools/_deprecate.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#
import collections
import inspect
import re
import regex as re
import sys
import types
from contextlib import suppress
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/tools/chars.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Distributed under the terms of the MIT license.
#
import re
import regex as re
import sys
from contextlib import suppress
from typing import Union
Expand Down
2 changes: 1 addition & 1 deletion pywikibot/tools/djvu.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Distributed under the terms of the MIT license.
#
import os
import re
import regex as re
import subprocess
from collections import Counter

Expand Down
2 changes: 1 addition & 1 deletion pywikibot/tools/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Distributed under the terms of the MIT license.
#
import math
import re
import regex as re

from pywikibot.logging import output
from pywikibot.tools import deprecated
Expand Down
Loading