Skip to content

Commit a517cb9

Browse files
authored
Make link to issue template url safe (#3508)
## Changes Make link to issue template url safe using Python's urllib ### Linked issues Introduced in #3498 - [x] Manually tested
1 parent f47722c commit a517cb9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/databricks/labs/ucx/source_code/python/python_ast.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
from __future__ import annotations
22

33
import builtins
4-
import sys
5-
from abc import ABC, abstractmethod
64
import logging
5+
import sys
76
import re
7+
import urllib.parse
8+
from abc import ABC, abstractmethod
89
from collections.abc import Iterable
910
from dataclasses import dataclass
1011
from typing import TypeVar, cast
@@ -99,7 +100,7 @@ def _definitely_failure(source_code: str, e: Exception) -> MaybeTree:
99100
"https://github.com/databrickslabs/ucx/issues/new?title=[BUG]:+Python+parse+error"
100101
"&labels=migrate/code,needs-triage,bug"
101102
"&body=%23+Current+behaviour%0A%0ACannot+parse+the+following+Python+code"
102-
f"%0A%0A%60%60%60+python%0A{source_code}%0A%60%60%60"
103+
f"%0A%0A%60%60%60+python%0A{urllib.parse.quote_plus(source_code)}%0A%60%60%60"
103104
)
104105
return MaybeTree(
105106
None,

0 commit comments

Comments
 (0)