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

Call init_console in mamba to prevent UTF8 errors when extracting pac… #2657

Merged
merged 1 commit into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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