You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, January 14th 2013, 12:04pm

How to repare PyUnicodeUCS2_FromObject error

Here is fragment of my c++ code (using Qt) in which I call a shell script of a python-application:


Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
void MainWindow::CodeAsterError()
{
	ui->textBrowserError->append(caProcess->readAllStandardError());
}

void MainWindow::CodeAsterOut()
{
	QByteArray byteArray = caProcess->readAllStandardOutput();
	QStringList strLines = QString(byteArray).split("\n");

	foreach (QString line, strLines)
	{
    	ui->textBrowserOut->append(line);
	}
}

void MainWindow::on_pushButton_clicked()
{
	QString program = "/home/oogolov/aster/bin/as_run";
	QStringList arguments;
	arguments << "/home/oogolov/GeoFEA/GeoFEA2D/WorkDir/Calc.export";

	connect (caProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(CodeAsterOut()));
	connect (caProcess, SIGNAL(readyReadStandardError()), this, SLOT(CodeAsterError()));

	//caProcess->start("/bin/bash", QStringList() << "/home/oogolov/aster/bin/as_run" << "/home/oogolov/GeoFEA/GeoFEA2D/WorkDir/Calc.export");
	caProcess->start(program,arguments);
	caProcess->waitForReadyRead(100);
}


When I run (Build/Run) my application it works well. But when I debug (Debug/Start Debugging) I get following error:

Traceback(most recent call last):
File"<string>", line 1, in <module>
File"/home/oogolov/aster/lib/python2.7/site-packages/asrun/main.py", line 109, in main start()
File"/home/oogolov/aster/lib/python2.7/site-packages/asrun/main.py", line 51, in start run =AsterRun()
File"/home/oogolov/aster/lib/python2.7/site-packages/asrun/run.py", line 186, in __init__ self.LoadExtensions()
File"/home/oogolov/aster/lib/python2.7/site-packages/asrun/run.py", line 297, in LoadExtensionsimport asrun.maintenance
File"/home/oogolov/aster/lib/python2.7/site-packages/asrun/maintenance.py", line 42, in <module> from asrun.build importAsterBuild
File"/home/oogolov/aster/lib/python2.7/site-packages/asrun/build.py", line 31, in <module> from zipfile importZipFileFile"/opt/QtSDK/debugger/Desktop/lib/python2.7/zipfile.py", line 6, in <module>import io
File"/opt/QtSDK/debugger/Desktop/lib/python2.7/io.py", line 60, in <module>import _io

ImportError:/opt/QtSDK/debugger/Desktop/lib/python2.7/lib-dynload/_io.so: undefined symbol: PyUnicodeUCS2_FromObject

Could you help me to repair this "Import, PyUnicodeUCS2_FromObject" state?