From 9874c46d385227245c7c29e2ac5a915c317df11b Mon Sep 17 00:00:00 2001 From: Adam Tse Date: Sun, 28 Oct 2018 14:59:54 +0000 Subject: [PATCH 1/5] Replaced comment-matching regex with an equivalent to works in Jython too. --- news/3662.bugfix | 1 + src/pip/_internal/req/req_file.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 news/3662.bugfix diff --git a/news/3662.bugfix b/news/3662.bugfix new file mode 100644 index 00000000000..760e6a454a2 --- /dev/null +++ b/news/3662.bugfix @@ -0,0 +1 @@ +This works around an issue with Jython's `re` implementation that would otherwise result in `RuntimeError: maximum recursion depth exceeded (Java StackOverflowError)` \ No newline at end of file diff --git a/src/pip/_internal/req/req_file.py b/src/pip/_internal/req/req_file.py index e7acf7cb8e3..8465017831b 100644 --- a/src/pip/_internal/req/req_file.py +++ b/src/pip/_internal/req/req_file.py @@ -23,7 +23,7 @@ __all__ = ['parse_requirements'] SCHEME_RE = re.compile(r'^(http|https|file):', re.I) -COMMENT_RE = re.compile(r'(^|\s)+#.*$') +COMMENT_RE = re.compile(r'^\s*#.*$') # Matches environment variable-style values in '${MY_VARIABLE_1}' with the # variable name consisting of only uppercase letters, digits or the '_' From 2d6756722dd91fb716bbe82df8df32de10fe2f8f Mon Sep 17 00:00:00 2001 From: Adam Tse Date: Sun, 28 Oct 2018 15:38:43 +0000 Subject: [PATCH 2/5] :This should now handle trailing comments. --- src/pip/_internal/req/req_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pip/_internal/req/req_file.py b/src/pip/_internal/req/req_file.py index 8465017831b..4f61f3cfd4f 100644 --- a/src/pip/_internal/req/req_file.py +++ b/src/pip/_internal/req/req_file.py @@ -23,7 +23,7 @@ __all__ = ['parse_requirements'] SCHEME_RE = re.compile(r'^(http|https|file):', re.I) -COMMENT_RE = re.compile(r'^\s*#.*$') +COMMENT_RE = re.compile(r'\s*#.*$') # Matches environment variable-style values in '${MY_VARIABLE_1}' with the # variable name consisting of only uppercase letters, digits or the '_' From 9c7bff3b1248be7b3f392c963fcb97f253c22445 Mon Sep 17 00:00:00 2001 From: Adam Tse Date: Sun, 28 Oct 2018 16:27:55 +0000 Subject: [PATCH 3/5] A working Jython-compatible regex this time. Co-Authored-By: Benoit Pierre --- src/pip/_internal/req/req_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pip/_internal/req/req_file.py b/src/pip/_internal/req/req_file.py index 4f61f3cfd4f..d7e40729d35 100644 --- a/src/pip/_internal/req/req_file.py +++ b/src/pip/_internal/req/req_file.py @@ -23,7 +23,7 @@ __all__ = ['parse_requirements'] SCHEME_RE = re.compile(r'^(http|https|file):', re.I) -COMMENT_RE = re.compile(r'\s*#.*$') +COMMENT_RE = re.compile(r'(^|\s+)#.*$') # Matches environment variable-style values in '${MY_VARIABLE_1}' with the # variable name consisting of only uppercase letters, digits or the '_' From 4c04e2275a00d33cca8829d9f37bd29626fc650e Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 9 Nov 2018 12:23:51 +0530 Subject: [PATCH 4/5] Update 3662.bugfix --- news/3662.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/3662.bugfix b/news/3662.bugfix index 760e6a454a2..2a94f55f317 100644 --- a/news/3662.bugfix +++ b/news/3662.bugfix @@ -1 +1 @@ -This works around an issue with Jython's `re` implementation that would otherwise result in `RuntimeError: maximum recursion depth exceeded (Java StackOverflowError)` \ No newline at end of file +Work around an issue with Jython's `re` implementation that resulted in a Java StackOverflowError. From 6599f990962f8566b9093649f34449d41c999b6d Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Mon, 27 May 2019 16:47:06 -0400 Subject: [PATCH 5/5] Rename 3662.bugfix to 3662.trivial --- news/{3662.bugfix => 3662.trivial} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename news/{3662.bugfix => 3662.trivial} (100%) diff --git a/news/3662.bugfix b/news/3662.trivial similarity index 100% rename from news/3662.bugfix rename to news/3662.trivial