[Python-Dev] is the concept of 'reference ownership' no long applicable in Python 3.4?

2014-04-17 Thread Jianfeng Mao
Hi,

I noticed the following changes in the C API manuals from 3.3.5 (and earlier 
versions) to 3.4. I don't know if these changes are deliberate and imply that 
we C extension developers no longer need to care about 'reference ownership' 
because of some improvements in 3.4. Could anyone clarify it?

Thanks,
Jianfeng


--- 3.4  C API  reference manual 
PyObjecthttps://docs.python.org/3/c-api/structures.html#c.PyObject* 
PySequence_GetItem(PyObjecthttps://docs.python.org/3/c-api/structures.html#c.PyObject
 *o, Py_ssize_t 
i)¶https://docs.python.org/3/c-api/sequence.html#c.PySequence_GetItem

Return the ith element of o, or NULL on failure. This is the equivalent of the 
Python expression o[i].
PyObjecthttps://docs.python.org/3.4/c-api/structures.html#c.PyObject* 
PyList_GetItem(PyObjecthttps://docs.python.org/3.4/c-api/structures.html#c.PyObject
 *list, Py_ssize_t index)

Return the object at position index in the list pointed to by list. The 
position must be positive, indexing from the end of the list is not supported. 
If index is out of bounds, return NULL and set an 
IndexErrorhttps://docs.python.org/3.4/library/exceptions.html#IndexError 
exception.

--- 3.3.5 C API reference manual ---
PyObjecthttps://docs.python.org/3.3/c-api/structures.html#PyObject* 
PySequence_GetItem(PyObjecthttps://docs.python.org/3.3/c-api/structures.html#PyObject
 *o, Py_ssize_t 
i)¶https://docs.python.org/3.3/c-api/sequence.html#PySequence_GetItem
Return value: New reference.

Return the ith element of o, or NULL on failure. This is the equivalent of the 
Python expression o[i].

PyObjecthttps://docs.python.org/3.3/c-api/structures.html#PyObject* 
PyList_GetItem(PyObjecthttps://docs.python.org/3.3/c-api/structures.html#PyObject
 *list, Py_ssize_t index)
Return value: Borrowed reference.

Return the object at position index in the list pointed to by list. The 
position must be positive, indexing from the end of the list is not supported. 
If index is out of bounds, return NULL and set an 
IndexErrorhttps://docs.python.org/3.3/library/exceptions.html#IndexError 
exception.

___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] make a Windows installation package (.msi) for Python 3.3

2013-05-10 Thread Jianfeng Mao
To Python Windows Release Managers:

My name is Jianfeng Mao and I am a software developer at the U2 group in Rocket 
Software (http://u2.rocketsoftware.com/).   I am currently working on a project 
to embed a slightly customized Python interpreter in our product. For easy 
installation and setup,  we hope to be able to do the standard Python 
installation during the installation of our software.  Basically I want to 
create a .msi file that can be called to install the full Python if the user 
needs this new feature. Brian Curtin 
(br...@python.orgmailto:br...@python.org)  pointed me to Tools/msi/msi.py for 
the Windows MSI builder. I tried to follow  the instructions in the README but 
couldn't make it to work after a few twists and turns.  Brian mentioned that 
few people needs to do this and only release managers handle the packaging of 
Python.  I have listed the steps I have done in my attempt to create the .msi 
file. Please let me know if I have missed anything  or done anything wrong.



1.   hg clone http://hg.python.org/cpython

2.   cd cpython

3.   hg update 3.3

4.   cd tools\buildbot,  edit build.bat to change the configuration from 
Debug to Releaes; edit external.bat, change DEBUG=1 to DEBUG=0

5.   go back to cpython\ and run tools\buildbot\build.bat

6.   cd PC, then do 'nmake -f icons.mak'

7.   cd ..\tools\msi

8.   c:\python27\python msi.py


WARNING: nm did not run successfully - libpythonXX.a not built
cl /O2 /D WIN32 /D NDEBUG /D _WINDOWS /MT /W3 /c msisupport.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

msisupport.c
link.exe /OUT:msisupport.dll /INCREMENTAL:NO /NOLOGO /DLL /SUBSYSTEM:WIN
DOWS /OPT:REF /OPT:ICF msisupport.obj msi.lib kernel32.lib
   Creating library msisupport.lib and object msisupport.exp
Traceback (most recent call last):
  File msi.py, line 1336, in module
add_files(db)
  File msi.py, line 961, in add_files
generate_license()
  File msi.py, line 914, in generate_license
raise ValueError, Could not find +srcdir+/../+pat
ValueError: Could not find C:\temp\cpython/../tcl8*
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Any script to create the installation pacakge of Python 3.3.1 on Windows and *NIX?

2013-05-08 Thread Jianfeng Mao
To Python-Dev committers:

I am working on a project to embed a slightly customized Python interpreter in 
our own software. For easy installation and setup, we want to be able to do the 
standard Python installation as part of the installation of our product.  So 
far I have successfully customized and built Python 3.3.1 (including the 
subprojects) on Windows but I can't find anything in the source distribution to 
allow me package the binaries/modules etc into a MSI just like the one on the 
download page on python.org.  So I am asking for information regarding how to 
package Python build for installation on both Windows and *NIX platforms.  Your 
help will be greatly appreciated.

Thanks,
Jianfeng
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com