mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-31 08:32:32 +00:00
cli[patch]: Modified regular expression (#19449)
- **Description:** Modified regular expression to add support for unicode chars and simplify pattern Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
This commit is contained in:
parent
7d36ee38b7
commit
4babefcb2f
@ -155,7 +155,7 @@ def _get_repo_path(gitstring: str, ref: Optional[str], repo_dir: Path) -> Path:
|
||||
removed_protocol = gitstring.split("://")[-1]
|
||||
removed_basename = re.split(r"[/:]", removed_protocol, 1)[-1]
|
||||
removed_extras = removed_basename.split("#")[0]
|
||||
foldername = re.sub(r"[^a-zA-Z0-9_]", "_", removed_extras)
|
||||
foldername = re.sub(r"\W", "_", removed_extras)
|
||||
|
||||
directory_name = f"{foldername}_{hashed}"
|
||||
return repo_dir / directory_name
|
||||
|
Loading…
Reference in New Issue
Block a user