diff --git a/src/poetry/console/commands/init.py b/src/poetry/console/commands/init.py index a0921fdd1eb..04f36c6aa76 100644 --- a/src/poetry/console/commands/init.py +++ b/src/poetry/console/commands/init.py @@ -91,7 +91,7 @@ def _init_pyproject( readme_format: str = "md", allow_layout_creation_on_empty: bool = False, ) -> int: - from poetry.core.vcs.git import GitConfig + from dulwich.config import StackedConfig from poetry.config.config import Config from poetry.layouts import layout @@ -116,8 +116,6 @@ def _init_pyproject( ) return 1 - vcs_config = GitConfig() - if is_interactive: self.line("") self.line( @@ -148,10 +146,11 @@ def _init_pyproject( if not description and is_interactive: description = self.ask(self.create_question("Description []: ", default="")) + vcs_config = StackedConfig.default() author = self.option("author") - if not author and vcs_config.get("user.name"): - author = vcs_config["user.name"] - author_email = vcs_config.get("user.email") + if not author and (vcs_username := vcs_config.get("user", "name")): + author = vcs_username.decode() + author_email = vcs_config.get("user", "email").decode() if author_email: author += f" <{author_email}>"