Navigation Menu

Skip to content

Commit

Permalink
App: issue #7112: Addon manager does not work on windows with special…
Browse files Browse the repository at this point in the history
… characters in the username
  • Loading branch information
wwmayer committed Jun 29, 2022
1 parent 448b1ec commit 22829f8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/App/MetadataPyImp.cpp
Expand Up @@ -23,6 +23,7 @@
#include "PreCompiled.h"

#include "Metadata.h"
#include <Base/FileInfo.h>

// inclusion of the generated files (generated out of MetadataPy.xml)
#include "MetadataPy.h"
Expand Down Expand Up @@ -64,10 +65,13 @@ int MetadataPy::PyInit(PyObject* args, PyObject* /*kwd*/)

// Main class constructor -- takes a file path, loads the metadata from it
PyErr_Clear();
const char* filename;
if (PyArg_ParseTuple(args, "s", &filename)) {
char* filename;
if (PyArg_ParseTuple(args, "et", "utf-8", &filename)) {
try {
auto md = new Metadata(filename);
std::string utf8Name = std::string(filename);
PyMem_Free(filename);

auto md = new Metadata(Base::FileInfo::stringToPath(utf8Name));
setTwinPointer(md);
return 0;
}
Expand Down

0 comments on commit 22829f8

Please sign in to comment.