Why does PyRun_SimpleFile need a char*, not a const char*?

Delaney, Timothy tdelaney at avaya.com
Mon Dec 2 18:02:11 EST 2002


> From: Gernot Hillier [mailto:ghillie at suse.de]
> 
> As I'm using embedded python in C++, I would really like to use
> 
> string a="bla.py"
> script_f=fopen(a.c_str(),"r")
> PyRun_SimpleFile(script_f, a.c_str());
> 
> But this only gives me "invalid conversion from `const char*' 
> to `char*'" in 
> PyRun_SimpleFile(). :-(
> 
> So - why does PyRun_SimpleFile() expect to get a "char*" and 
> not a "const 
> char*"?
> 
> Does it change this pointer? I hope not...
> 
> I think this qualifies as bug - what do you think?

Raise a bug report on SourceForge.

Tim Delaney




More information about the Python-list mailing list