8000 resolve #7242 configuration load error message by kalefranz · Pull Request #7243 · conda/conda · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

resolve #7242 configuration load error message #7243

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

Merged
merged 4 commits into from
Aug 2, 2018

Conversation

kalefranz
Copy link
Contributor

resolve #7242

@kalefranz kalefranz added this to the 4.6.0 milestone May 2, 2018
@kalefranz kalefranz requested a review from a team as a code owner May 2, 2018 16:55
"" % (mark.line, mark.column))
except ReaderError as err:
raise ConfigurationLoadError(filepath, " reason: invalid yaml at position %s"
"" % err.position)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Granted, line, column and position should always be integers, but in regards to #6759 / https://github.com/conda/conda/blob/4.6.0a2/conda/__init__.py#L48, I'd prefer every CondaError message to be a static string, e.g., either use

class ConfigurationLoadError(ConfigurationError):
    def __init__(self, path, message_addition='', **kwargs):
[...]
                raise ConfigurationLoadError(filepath,
                                             "  reason: invalid yaml at line %(line)s, column %(column)s",
                                             line=mark.line, column=mark.column)
            except ReaderError as err:
                raise ConfigurationLoadError(filepath, "  reason: invalid yaml at position %(position)s",
                                                       position=err.position)

or

class ConfigurationLoadError(ConfigurationError):
    def __init__(self, path, message_addition=''):
        message = "Unable to load configuration file.\n  path: %(path)s\n%(message_addition)s"
        super(ConfigurationLoadError, self).__init__(message, message_addition=message_addition, path=path)

@mading0817
Copy link

Hi kalefranz,

The issue is exactly what I met.
Now I am using Anaconda3 5.2.0, and I could not find “tests“ folder, and after replace the “context.py” and "configuration.py", it still not working.
I was wondering why is this issue caused after installation and why do I need change the code to fix it ??

Regards,
Suyang

Signed-off-by: Kale Franz <kfranz@continuum.io>
Signed-off-by: Kale Franz <kfranz@continuum.io>
Signed-off-by: Kale Franz <kfranz@continuum.io>
@kalefranz kalefranz force-pushed the config-reader-error branch from 1b1fa61 to 722b425 Compare August 1, 2018 17:28
Signed-off-by: Kale Franz <kfranz@continuum.io>
@kalefranz kalefranz merged commit 958f405 into conda:master Aug 2, 2018
@kalefranz kalefranz deleted the config-reader-error branch August 2, 2018 05:28
@github-actions
Copy link
github-actions bot commented Sep 1, 2021

Hi there, thank you for your contribution to Conda!

This pull request has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue or pull request if needed.

7901 @github-actions github-actions bot added the locked [bot] locked due to inactivity label Sep 1, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conda Not Running
3 participants
0