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 81d6d35
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libmambapy/libmambapy/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ __all__ = [
"generate_ed25519_keypair",
"get_channels",
"get_virtual_packages",
"init_console",
"ostream_redirect",
"sign",
"simplify_conflicts",
Expand Down Expand Up @@ -1593,6 +1594,9 @@ def get_channels(arg0: typing.List[str]) -> typing.List[Channel]:
def get_virtual_packages() -> typing.List[PackageInfo]:
pass

def init_console() -> None:
pass

def sign(data: str, secret_key: str) -> str:
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 81d6d35

Please sign in to comment.