Skip to content

Commit

Permalink
Call init_console in mamba to prevent UTF8 errors when extracting pac…
Browse files Browse the repository at this point in the history
…kages
  • Loading branch information
JohanMabille committed Jul 5, 2023
1 parent 9de2535 commit 8034021
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
10 changes: 0 additions & 10 deletions libmambapy/libmambapy/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1077,14 +1077,6 @@ class PackageInfo:
def name(self, arg0: str) -> None:
pass
@property
def noarch(self) -> str:
"""
:type: str
"""
@noarch.setter
def noarch(self, arg0: str) -> None:
pass
@property
def sha256(self) -> str:
"""
:type: str
Expand Down Expand Up @@ -1541,8 +1533,6 @@ class SubdirData:
) -> None: ...
def cache_path(self) -> str: ...
def create_repo(self, arg0: Pool) -> Repo: ...
def download_and_check_targets(self, arg0: DownloadTargetList) -> bool: ...
def finalize_checks(self) -> None: ...
def loaded(self) -> bool: ...
pass

Expand Down
3 changes: 3 additions & 0 deletions libmambapy/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "mamba/core/subdirdata.hpp"
#include "mamba/core/transaction.hpp"
#include "mamba/core/url.hpp"
#include "mamba/core/util_os.hpp"
#include "mamba/core/util_string.hpp"
#include "mamba/core/validate.hpp"
#include "mamba/core/virtual_packages.hpp"
Expand Down Expand Up @@ -1004,6 +1005,8 @@ PYBIND11_MODULE(bindings, m)
py::arg("compression_threads") = 1
);

m.def("init_console", &init_console);

// fix extract from error_handling first
// auto package_handling_sm = m.def_submodule("package_handling");
// package_handling_sm.def("extract", &extract);
Expand Down
2 changes: 2 additions & 0 deletions mamba/mamba/mamba.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ def install(args, parser, command="install"):
context.validate_configuration()
check_non_admin()

api.init_console()

init_api_context(use_mamba_experimental)

newenv = bool(command == "create")
Expand Down

0 comments on commit 8034021

Please sign in to comment.