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

[V3 Downloader] Error from invalid characters in repo name #2999

Closed
Flame442 opened this issue Sep 14, 2019 · 1 comment · Fixed by #3029
Closed

[V3 Downloader] Error from invalid characters in repo name #2999

Flame442 opened this issue Sep 14, 2019 · 1 comment · Fixed by #3029
Labels
Good First Issue Good for beginners to the project. Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.

Comments

@Flame442
Copy link
Member

Flame442 commented Sep 14, 2019

Command bugs

Command name

[p]repo add

What cog is this command from?

Downloader

What were you expecting to happen?

A warning message that the repo name is invalid when naming a repo something with invalid characters (such as : in windows)

What actually happened?

Error:

[2019-09-14 10:39:30] [ERROR] red: Exception in command 'repo add'
Traceback (most recent call last):
  File "<VENV>\lib\site-packages\redbot\cogs\downloader\downloader.py", line 233, in _repo_add
    repo = await self._repo_manager.add_repo(name=name, url=repo_url, branch=branch)
  File "<VENV>\lib\site-packages\redbot\cogs\downloader\repo_manager.py", line 586, in add_repo
    r = Repo(url=url, name=name, branch=branch, folder_path=self.repos_folder / name)
  File "<VENV>\lib\site-packages\redbot\cogs\downloader\repo_manager.py", line 66, in __init__
    self.folder_path.mkdir(parents=True, exist_ok=True)
  File "<Python>\lib\pathlib.py", line 1241, in mkdir
    self._accessor.mkdir(self, mode)
NotADirectoryError: [WinError 267] The directory name is invalid: '<datapath>\\cogs\\RepoManager\\repos\\:'

How can we reproduce this issue?

Run [p]repo add : aaaaa
Type "I agree" if prompted

@Flame442 Flame442 added the Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing. label Sep 14, 2019
@Jackenmen
Copy link
Member

Partly related to #2827 - if we would only allow characters A-z, numbers and underscores this would be solved.

@mikeshardmind mikeshardmind added the Good First Issue Good for beginners to the project. label Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Good for beginners to the project. Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants