[issue30155] Add ability to get/set tzinfo on datetime instances in C API

2020-02-10 Thread Anthony Tuininga


Anthony Tuininga  added the comment:

Any progress on this?

--

___
Python tracker 
<https://bugs.python.org/issue30155>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38342] ImportError: cannot import name 'MetadataPathFinder' from 'importlib.metadata'

2019-10-02 Thread Anthony Tuininga


Anthony Tuininga  added the comment:

Yes. I had tried b3 earlier, installed b4 over b3 and then rc1 over b4. 
Removing the cruft using the command you specified caused the problem to go 
away.

--

___
Python tracker 
<https://bugs.python.org/issue38342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38342] ImportError: cannot import name 'MetadataPathFinder' from 'importlib.metadata'

2019-10-01 Thread Anthony Tuininga


New submission from Anthony Tuininga :

Running the suggested code found at 
https://docs.python.org/3.8/whatsnew/3.8.html regarding the new 
importlib.metadata module

from importlib.metadata import version, requires, files
version('requests')

yields the error

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.8/importlib/metadata/__init__.py", line 365, in 
version
return distribution(package).version
  File "/usr/local/lib/python3.8/importlib/metadata/__init__.py", line 338, in 
distribution
return Distribution.from_name(package)
  File "/usr/local/lib/python3.8/importlib/metadata/__init__.py", line 159, in 
from_name
dists = resolver(name)
  File "", line 1381, in 
find_distributions
ImportError: cannot import name 'MetadataPathFinder' from 'importlib.metadata' 
(/usr/local/lib/python3.8/importlib/metadata/__init__.py)

--
components: Library (Lib)
messages: 353714
nosy: atuining
priority: normal
severity: normal
status: open
title: ImportError: cannot import name 'MetadataPathFinder' from 
'importlib.metadata'
type: behavior
versions: Python 3.8

___
Python tracker 
<https://bugs.python.org/issue38342>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30155] Add ability to get/set tzinfo on datetime instances in C API

2017-04-24 Thread Anthony Tuininga

New submission from Anthony Tuininga:

Right now there is no documented way to create a datetime instance with a 
tzinfo instance. The documented macros all hard code the value Py_None for the 
tzinfo parameter. Using the PyObject_Call() method instead of the macro for 
creating a datetime instance is ~5x slower.

In addition, there is no macro or method for getting the tzinfo from an 
existing datetime instance. Perhaps creating DATE_GET_TZINFO and 
TIME_GET_TZINFO would be acceptable?

The enhancement 10381 (http://bugs.python.org/issue10381) would also be needed.

I can provide a GitHub PR if that would be helpful. I first want to make sure 
that such an effort would be appreciated!

--
components: Library (Lib)
messages: 292230
nosy: atuining
priority: normal
severity: normal
status: open
title: Add ability to get/set tzinfo on datetime instances in C API
type: enhancement
versions: Python 3.6

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30155>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26346] PySequenceMethods documentation missing sq_slice and sq_ass_slice

2016-02-11 Thread Anthony Tuininga

New submission from Anthony Tuininga:

These methods are completely missing from the documentation found here:

https://docs.python.org/3/c-api/typeobj.html

--
assignee: docs@python
components: Documentation
messages: 260154
nosy: atuining, docs@python
priority: normal
severity: normal
status: open
title: PySequenceMethods documentation missing sq_slice and sq_ass_slice
versions: Python 3.5

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26346>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26346] PySequenceMethods documentation missing sq_slice and sq_ass_slice

2016-02-11 Thread Anthony Tuininga

Anthony Tuininga added the comment:

Ah yes. The fields are still there, though, just marked as not used. 
Interestingly enough they aren't documented in the Python 2 documentation 
eitherand they are in the Python 2.7 headers I have (not marked as unused 
either).

Your suggestion makes sense. The reason I ran into it is I followed an example 
found in the core code for Python 3.5.1which referenced sq_slice and 
sq_ass_slice in the order they are defined in the structure...

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26346>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger()

2014-08-25 Thread Anthony Tuininga

Anthony Tuininga added the comment:

I note that this patch has still not been accepted! Please let me know what 
needs to be done. I just tried against Python 3.4 and the patch works as 
expected -- other than the starting line number is now 715. I have signed the 
contributor agreement if that is what is holding things up.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1102
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16467] frozen importlib required for extending Python interpreter not public

2012-11-13 Thread Anthony Tuininga

New submission from Anthony Tuininga:

With Python 3.3, the ability to create a Python interpreter independent of a 
Python installation (as is done with cx_Freeze and other such freezing tools) 
has become more difficult to accomplish. Py_Initialize() requires the presence 
of a frozen importlib module which is found in importlib.h, but that include 
file is not available in the public include files section of a Python 
distribution. I have copied it for my use but that seems wrong. Please advise 
on how this should take place now. Thanks.

--
components: None
messages: 175515
nosy: atuining
priority: normal
severity: normal
status: open
title: frozen importlib required for extending Python interpreter not public
type: behavior
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16467
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16467] frozen importlib required for extending Python interpreter not public

2012-11-13 Thread Anthony Tuininga

Anthony Tuininga added the comment:

The file importlib.h is used when building the Python interpreter but it is 
*not* available in a standard (non-source) distribution of Python. I have 
copied the file from a source distribution of Python and that does in fact 
work, but I don`t want to make use of what is intended to be a private 
implementation detail. I am the author of cx_Freeze and trying to make it work 
correctly with Python 3.3. What I am looking for here is what I should be doing 
instead or asking for API that I can use. I hope that explains things better.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16467
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16467] frozen importlib required for extending Python interpreter not public

2012-11-13 Thread Anthony Tuininga

Anthony Tuininga added the comment:

Thanks to Amaury for his suggestion. It resolves the problem completely and 
answers the question I had about how to proceed. For others who may come across 
this, the key was to generate the importlib._bootstrap module (which is what is 
found in importlib.h) directly, rather than by including the private generated 
file.

--
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16467
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger()

2012-03-12 Thread Anthony Tuininga

Anthony Tuininga anthony.tuini...@gmail.com added the comment:

All, I have trimmed this patch down to the bare minimum required to solve this 
problem. Please review this as I would dearly love to have this committed. The 
error received without this patch is

MSIError: unknown error 103

This occurs when there are no more records to fetch from the view. The patch 
simply returns None when there are no more records to fetch -- similar to what 
is done by the DB API.

--
Added file: http://bugs.python.org/file24795/_msi_fetch.patch.txt

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1102
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6501] Fatal error on startup with invalid PYTHONIOENCODING

2011-04-01 Thread Anthony Tuininga

Changes by Anthony Tuininga anthony.tuini...@gmail.com:


--
nosy: +atuining

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6501
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6377] distutils compiler switch ignored

2009-06-29 Thread Anthony Tuininga

New submission from Anthony Tuininga anthony.tuini...@gmail.com:

With the release of Python 3.1 the --compiler switch is ignored in
Lib/distutils/command/build_ext.py. The attached patch fixes that issue.
Once that was fixed there was another issue with get_version() in
cygwincompiler but that appears to be fixed in the 3.1 branch. The
revision that introduced this problem is 72596 (from 72593 in trunk).

--
assignee: tarek
components: Distutils
files: distutils_compiler.patch
keywords: patch
messages: 89871
nosy: atuining, tarek
severity: normal
status: open
title: distutils compiler switch ignored
versions: Python 3.1
Added file: http://bugs.python.org/file14390/distutils_compiler.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6377
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5311] bdist_msi generates version number for pure Python packages

2009-05-04 Thread Anthony Tuininga

Anthony Tuininga anthony.tuini...@gmail.com added the comment:

One additional suggestion: allow the packager to specify what the
minimum Python version is. Otherwise, you might have a package that
enables installation for Python 2.3 and 2.4 when the maintainer has
already stated that Python 2.5 is the minimum version supported.
Otherwise, looks great.

--
nosy: +atuining

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5311
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5926] bdist_msi - add support for minimum Python version for pure Python packages

2009-05-04 Thread Anthony Tuininga

New submission from Anthony Tuininga anthony.tuini...@gmail.com:

Add support for specifying the minimum Python version supported so that
versions which are not supported are not included when running the MSI
created by distutils for pure Python packages with the patch referred to
here:

http://bugs.python.org/issue5311

--
assignee: tarek
components: Distutils
messages: 87154
nosy: atuining, tarek
severity: normal
status: open
title: bdist_msi - add support for minimum Python version for pure Python 
packages
type: feature request
versions: Python 2.7, Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5926
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5311] bdist_msi generates version number for pure Python packages

2009-05-04 Thread Anthony Tuininga

Anthony Tuininga anthony.tuini...@gmail.com added the comment:

I've created another feature request as requested for supplying a
minimum Python version when creating pure Python packages.

http://bugs.python.org/issue5926

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5311
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-02-16 Thread Anthony Tuininga

Anthony Tuininga anthony.tuini...@gmail.com added the comment:

Removing cmp() breaks distutils. I get the following exception, for
example using the just released version 3.0.1:

Traceback (most recent call last):
  File setup.py, line 318, in module
classifiers = classifiers)
  File c:\Python30\lib\distutils\core.py, line 149, in setup
dist.run_commands()
  File c:\Python30\lib\distutils\dist.py, line 942, in run_commands
self.run_command(cmd)
  File c:\Python30\lib\distutils\dist.py, line 962, in run_command
cmd_obj.run()
  File c:\Python30\lib\distutils\command\build.py, line 128, in run
self.run_command(cmd_name)
  File c:\Python30\lib\distutils\cmd.py, line 317, in run_command
self.distribution.run_command(command)
  File c:\Python30\lib\distutils\dist.py, line 962, in run_command
cmd_obj.run()
  File c:\Python30\lib\distutils\command\build_ext.py, line 306, in run
force=self.force)
  File c:\Python30\lib\distutils\ccompiler.py, line 1110, in new_compiler
return klass(None, dry_run, force)
  File c:\Python30\lib\distutils\cygwinccompiler.py, line 314, in __init__
if self.gcc_version = 2.91.57:
  File c:\Python30\lib\distutils\version.py, line 64, in __le__
c = self._cmp(other)
  File c:\Python30\lib\distutils\version.py, line 341, in _cmp
return cmp(self.version, other.version)
NameError: global name 'cmp' is not defined

--
nosy: +atuining

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1109963] bdist_wininst ignores build_lib from build command

2008-10-29 Thread Anthony Tuininga

Anthony Tuininga [EMAIL PROTECTED] added the comment:

This problem also occurs in the bdist_msi command.

--
versions: +Python 2.5, Python 2.6

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1109963
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger()

2008-10-20 Thread Anthony Tuininga

Anthony Tuininga [EMAIL PROTECTED] added the comment:

With apologies for the delay, I have modified the patch to remove the
stuff that has been added already. Some of the other changes are to make
use of new C API functionality but they can be ignored, if desired. The
changes that are relevant are in the view_fetch() routine. Again, if you
have questions, let me know.

--
versions: +Python 2.6 -Python 2.5
Added file: http://bugs.python.org/file11840/_msi.patch.txt

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1102
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1128] msilib.Directory.make_short only handles file names with a single dot in them

2007-09-07 Thread Anthony Tuininga

New submission from 
Anthony Tuininga
:

Attached is a patch that fixes the handling of file names with 0 or 2 or
more dots in them.

--
components: Library (Lib)
files: msilib.__init__.patch
messages: 55736
nosy: atuining
severity: normal
status: open
title: msilib.Directory.make_short only handles file names with a single dot in 
them
versions: Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1128
__

msilib.__init__.patch
Description: Binary data
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger()

2007-09-04 Thread Anthony Tuininga

Changes by 
Anthony Tuininga
:


--
components: Library (Lib)
severity: normal
status: open
title: Add support for _msi.Record.GetString() and _msi.Record.GetInteger()
type: behavior
versions: Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1102
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger()

2007-09-04 Thread Anthony Tuininga

New submission from 
Anthony Tuininga
:

Attached is a patch that adds the requested support. This is in relation
to the thread at

http://www.gossamer-threads.com/lists/python/python/584264

In addition to the two methods I also fixed Fetch() by ensuring that
when the records are exhausted None is returned instead of an error.

If something further is required of me or I submitted this patch
incorrectly, please let me know so I don't screw it up next time. :-)

--
nosy: +atuining

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1102
__Index: _msi.c
===
--- _msi.c  (revision 57972)
+++ _msi.c  (working copy)
@@ -350,6 +350,34 @@
 }
 
 static PyObject*
+record_getstring(msiobj* record, PyObject *args)
+{
+int status, field, size;
+PyObject *value;
+char *data;
+
+if (!PyArg_ParseTuple(args, i:GetString, field))
+   return NULL;
+
+size = 0;
+status = MsiRecordGetString(record-h, field, , size);
+if (status != ERROR_MORE_DATA)
+return msierror(status);
+size++;
+data = PyMem_Malloc(size);
+if (!data)
+return PyErr_NoMemory();
+status = MsiRecordGetString(record-h, field, data, size);
+if (status != ERROR_SUCCESS) {
+PyMem_Free(data);
+return msierror(status);
+}
+value = PyString_FromString(data);
+PyMem_Free(data);
+return value;
+}
+
+static PyObject*
 record_setstring(msiobj* record, PyObject *args)
 {
 int status;
@@ -384,6 +412,22 @@
 }
 
 static PyObject*
+record_getinteger(msiobj* record, PyObject *args)
+{
+int field, value;
+
+if (!PyArg_ParseTuple(args, i:GetInteger, field))
+   return NULL;
+
+value = MsiRecordGetInteger(record-h, field);
+if (value != MSI_NULL_INTEGER)
+return PyInt_FromLong(value);
+
+Py_INCREF(Py_None);
+return Py_None;
+}
+
+static PyObject*
 record_setinteger(msiobj* record, PyObject *args)
 {
 int status;
@@ -405,10 +449,14 @@
 static PyMethodDef record_methods[] = {
 { GetFieldCount, (PyCFunction)record_getfieldcount, METH_NOARGS, 
PyDoc_STR(GetFieldCount() - int\nWraps MsiRecordGetFieldCount)},
+{ GetString, (PyCFunction)record_getstring, METH_VARARGS, 
+   PyDoc_STR(GetString(field) - value\nWraps MsiRecordGetString)},
 { SetString, (PyCFunction)record_setstring, METH_VARARGS, 
PyDoc_STR(SetString(field,str) - None\nWraps MsiRecordSetString)},
 { SetStream, (PyCFunction)record_setstream, METH_VARARGS, 
PyDoc_STR(SetStream(field,filename) - None\nWraps 
MsiRecordSetInteger)},
+{ GetInteger, (PyCFunction)record_getinteger, METH_VARARGS, 
+   PyDoc_STR(GetInteger(field) - value\nWraps MsiRecordGetInteger)},
 { SetInteger, (PyCFunction)record_setinteger, METH_VARARGS, 
PyDoc_STR(SetInteger(field,int) - None\nWraps MsiRecordSetInteger)},
 { ClearData, (PyCFunction)record_cleardata, METH_NOARGS, 
@@ -662,8 +710,13 @@
 int status;
 MSIHANDLE result;
 
-if ((status = MsiViewFetch(view-h, result)) != ERROR_SUCCESS)
-   return msierror(status);
+status = MsiViewFetch(view-h, result);
+if (status == ERROR_NO_MORE_ITEMS) {
+Py_INCREF(Py_None);
+return Py_None;
+}
+if (status != ERROR_SUCCESS)
+return msierror(status);
 
 return record_new(result);
 }
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger()

2007-09-04 Thread Anthony Tuininga

Changes by 
Anthony Tuininga
:


--
type: behavior - 

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1102
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1104] msilib.SummaryInfo.GetProperty() truncates the string by one character

2007-09-04 Thread Anthony Tuininga

New submission from 
Anthony Tuininga
:

Attached is a patch that fixes the truncation of the property values
returned by msilib.SummaryInfo.GetProperty(). Unfortunately Microsoft
has deemed it necessary to return the size of the string without the
null termination character but insists upon the size including it when
passing it in. Arggh!

--
components: Library (Lib)
files: _msi.patch2.txt
messages: 55649
nosy: atuining
severity: normal
status: open
title: msilib.SummaryInfo.GetProperty() truncates the string by one character
versions: Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1104
__Index: _msi.c
===
--- _msi.c  (revision 57972)
+++ _msi.c  (working copy)
@@ -488,7 +536,7 @@
 FILETIME fval;
 char sbuf[1000];
 char *sval = sbuf;
-DWORD ssize = sizeof(sval);
+DWORD ssize = sizeof(sbuf);
 
 if (!PyArg_ParseTuple(args, i:GetProperty, field))
return NULL;
@@ -496,7 +544,8 @@
 status = MsiSummaryInfoGetProperty(si-h, field, type, ival, 
fval, sval, ssize);
 if (status == ERROR_MORE_DATA) {
-   sval = malloc(ssize);
+ssize++;
+   sval = malloc(ssize);
 status = MsiSummaryInfoGetProperty(si-h, field, type, ival, 
fval, sval, ssize);
 }
@@ -508,7 +557,7 @@
PyErr_SetString(PyExc_NotImplementedError, FILETIME result);
return NULL;
case VT_LPSTR:
-   result = PyString_FromStringAndSize(sval, ssize);
+   result = PyString_FromString(sval);
if (sval != sbuf)
free(sval);
return result;
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com