Support Python 3k

This is attempt to support Python 3k in biggles (see #42). Note that the branch is **not ready to be merged**. Although the code in this branch compiles, it still segfaults at runtime. The purpose of this pull request is to make the code review easier.
I think this is an error prone approach.  I think it would be better
to make a simpler function that takes only a single key and value, and
than use

PyArg_ParseTuple

to do the conversion.

Then call that from python for each key,value pair in the dict.  There
is not significant optimization to the current approach, and
pyarg_parsetuple is type safe.

-e

On 8/22/14, Matt <notifications@github.com> wrote:
>> @@ -198,9 +200,13 @@ new( PyObject *self, PyObject *args )
>>  		pos = 0;
>>  		while ( PyDict_Next( odict, &pos, &key, &value ) )
>>  		{
>> -			skey = PyString_AsString( key );
>> -			svalue = PyString_AsString( value );
>> +			PyObject* tmp;
>
> OK. So this works. Man this was a pain to figure out. Can @esheldon confirm
> I did the reference counting correctly? I don't want to cause a memory
> leak.
>
> 	tmp1 = PyObject_CallMethod(key,"encode",NULL);
>                 skey = PyBytes_AsString(tmp1);
>
> 		tmp2 = PyObject_CallMethod(value,"encode",NULL);
>                 svalue = PyBytes_AsString(tmp2);
> 		
> 		pl_setplparam( params, skey, svalue );
>
>                 Py_XDECREF(tmp1);
>                 Py_XDECREF(tmp2);
>
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/nolta/biggles/pull/44/files#r16625578


-- 
Erin Scott Sheldon
Brookhaven National Laboratory erin dot sheldon at gmail dot com