Alexander Belopolsky added the comment:
I am attaching a test coverage file for the patched datetimemodule.c.
--
Added file: http://bugs.python.org/file17874/datetimemodule.c.gcov
___
Python tracker
<http://bugs.python.org/issue5
Alexander Belopolsky added the comment:
It looks like I attached coverage for the original file. See
new-datetimemodule.c.gcov for coverage after the change.
--
Added file: http://bugs.python.org/file17875/new-datetimemodule.c.gcov
___
Python
Changes by Alexander Belopolsky :
--
nosy: +pitrou
___
Python tracker
<http://bugs.python.org/issue9004>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Alexander Belopolsky :
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue4679>
___
___
Python-bugs-list mailing list
Un
Alexander Belopolsky added the comment:
This is a bit strange. timedelta is accepting int subclass instances:
>>> class I(int):
...pass
...
>>> timedelta(days = I(36))
datetime.timedelta(36)
but not numpy.unt_:
>>> timedelta(days = int_(36))
Traceback (mos
Changes by Alexander Belopolsky :
--
priority: normal -> low
resolution: -> rejected
status: open -> pending
___
Python tracker
<http://bugs.python.o
Alexander Belopolsky added the comment:
> As a matter of good style, though, I'd still like to see all uses of
> timedelta in the standard library and documentation use the keywords
> explicitly ...
It is a bit of a shame, but there are exactly 3 places using timedelta in
Alexander Belopolsky added the comment:
I am attaching a python prototype. I am following the convention in place for
the other datetime classes of prepending the repr with 'datetime.'. This may
not be ideal, but better than to introduce an inconsistency. The only question
Alexander Belopolsky added the comment:
On the second thought, this is clearly not a bug fix. Not a backport candidate.
--
status: pending -> closed
___
Python tracker
<http://bugs.python.org/iss
New submission from Alexander Belopolsky :
Attached patch makes timezone(timedelta(0)) always return the same instance as
timezone.utc. See issue9051 for pure python implementation.
With this patch, manipulation of aware datetime objects will be as efficient as
that of naive datetime objects
Alexander Belopolsky added the comment:
Attaching a C patch.
--
resolution: -> accepted
stage: unit test needed -> commit review
Added file: http://bugs.python.org/file17887/issue9000.diff
___
Python tracker
<http://bugs.python.org/
Alexander Belopolsky added the comment:
Replacing the patch. The previously attached patch reverted issue9051 a bit
too aggressively.
--
Added file: http://bugs.python.org/file17888/issue9000.diff
___
Python tracker
<http://bugs.python.
Changes by Alexander Belopolsky :
Removed file: http://bugs.python.org/file17887/issue9000.diff
___
Python tracker
<http://bugs.python.org/issue9000>
___
___
Python-bug
Alexander Belopolsky added the comment:
Committed in r82617. Python version committed to sandbox in r82616.
--
stage: commit review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.org/
Alexander Belopolsky added the comment:
Python implementation of UTC interning can be done better than the one in
issue9051. See attached issue9183-proto.diff.
--
Added file: http://bugs.python.org/file17889/issue9183-proto.diff
___
Python tracker
Alexander Belopolsky added the comment:
There is nothing we can do about misreporting of UTC offset. Unlike time
tuples, datetime objects do not store the DST flag and thus have no means to
disambiguate between standard and DST during the hour after the clock is set
back for DST to standard
Changes by Alexander Belopolsky :
--
dependencies: +String interpolation doesn't work with sys.version_info
___
Python tracker
<http://bugs.python.org/i
Alexander Belopolsky added the comment:
This is definitely the right way to do it. I expect that I will have only
minor nit-picks as I go through the patch.
1. You can probably just do
#define PyStructSequence_SET_ITEM PyTuple_SET_ITEM
#define PyStructSequence_GET_ITEM PyTuple_GET_ITEM
Alexander Belopolsky added the comment:
On Wed, Jul 7, 2010 at 4:19 PM, Benjamin Peterson
wrote:
>> - PyStructSequence_New does not fill ob_item array with NULLs.
>
> I'm not sure it really matters, since the fields should always be
> filled in, but I suppose it can'
Alexander Belopolsky added the comment:
Looks great. I love the patches where few '+'s are drowning in a sea of '-'s!
A gratuitous nitpick (feel free to ignore). In
+val = PyStructSequence_GET_ITEM(obj, i);
if (cname == NULL || val == NULL) {
The null
Alexander Belopolsky added the comment:
Uploaded issue5288.diff to Rietveld:
http://codereview.appspot.com/1698050
--
nosy: +benjamin.peterson
___
Python tracker
<http://bugs.python.org/issue5
Alexander Belopolsky added the comment:
issue5288a.diff addressed comments from Rietveld.
--
stage: unit test needed -> commit review
Added file: http://bugs.python.org/file17897/issue5288a.diff
___
Python tracker
<http://bugs.python.org/iss
Alexander Belopolsky added the comment:
C code changes eliminating round-trips between timdelta and int offsets
committed in r82642 and Python code changes committed to sandbox in r82641.
Now the requested behavior change is easy and I am about +0.5 on relaxing the
offset checks to allow
Alexander Belopolsky added the comment:
> A side effect of this change is that it kills the ability to have a
> PyStructSequence which has a smaller visible size than the total
> number of items.
Hmm. I was looking for this precise issue when I was reviewing the code and it
appea
New submission from Alexander Belopolsky :
Most likely the same underlying problem as in issue 9202, but can be seen on a
non-windows platform.
>>> from os import *
>>> stat('/')
Traceback (most recent call last):
File "", line 1, in
SystemError: NULL
Changes by Alexander Belopolsky :
--
keywords: +patch
Added file: http://bugs.python.org/file17906/issue9206.diff
___
Python tracker
<http://bugs.python.org/issue9
Changes by Alexander Belopolsky :
--
nosy: +benjamin.peterson, brian.curtin, eric.smith
Added file: http://bugs.python.org/file17907/issue9206.diff
___
Python tracker
<http://bugs.python.org/issue9
Changes by Alexander Belopolsky :
Removed file: http://bugs.python.org/file17907/issue9206.diff
___
Python tracker
<http://bugs.python.org/issue9206>
___
___
Python-bug
Alexander Belopolsky added the comment:
On Thu, Jul 8, 2010 at 4:30 PM, Ronald Oussoren wrote:
..
> Note that explicitly setting the effective uid and gid of processes is
> somewhat frowned upon by Apple, they'd prefer if all daemon processes where
> started using launchd and u
Alexander Belopolsky added the comment:
Attached patch, issue9206a.diff seems to fix the os.stat() issue.
Brian, can you check if it fixes issue 9202 as well?
I planned to finish some other stuff tonight, so I am reassigning this to
Benjamin.
--
assignee: belopolsky
Alexander Belopolsky added the comment:
This whole thing is a mess. Great analysis, by the way. I started a
similar experiment some time ago, but gave up when I discovered that a
member of the admin group can read any file regardless of permissions
settings. Your solution is probably the
Alexander Belopolsky added the comment:
s/2.7/2.7.1/
--
___
Python tracker
<http://bugs.python.org/issue7900>
___
___
Python-bugs-list mailing list
Unsubscribe:
Alexander Belopolsky added the comment:
issue7989a.diff is a partial success implementing Nick Coghlan's testing idea.
Unfortunately, datetime implementation with it's circular dependency on
_strftime is not very robust with respect to import trickery.
I am calling this a parti
Changes by Alexander Belopolsky :
--
assignee: -> belopolsky
___
Python tracker
<http://bugs.python.org/issue6478>
___
___
Python-bugs-list mailing list
Un
Alexander Belopolsky added the comment:
Thank you for the bug report and a patch.
This does look like a bug and proposed patch seems to be the simplest way to
fix it. It is unfortunate that the entire TimeRE cache needs to be
recalculated when only 'Z' entry is invalidated by
Alexander Belopolsky added the comment:
Composed before reading Nick's comment:
"""
This issue is broader in scope than just the time module example that is given,
so I am not taking this over. With respect to datetime and time modules, there
are several related issues I
Alexander Belopolsky added the comment:
On Mon, Jul 12, 2010 at 12:07 PM, Antoine Pitrou wrote:
..
> Instead of being defined in _time.h, perhaps the new API function should be
> provided by core Python?
This is an interesting idea, but proposed Py_gettimeofday inherits
float_time lo
Alexander Belopolsky added the comment:
On Mon, Jul 12, 2010 at 1:06 PM, Antoine Pitrou wrote:
..
> Indeed, the GIL code would probably still use its own code paths.
> However, other less sensitive code could rely on the new API. For
> example, it is not critical for lock timeouts t
Alexander Belopolsky added the comment:
This option would be more useful if it became an optional argument to the
help() function. For someone working at the python command line prompt, having
to switch to pydoc to see private method documentation may be inconvenient. It
is more natural to
Alexander Belopolsky added the comment:
issue9206b.diff fixes test_datetime in issue9206a.diff by restoring sys.modules
in-place in tearDown method.
Based on python-dev discussion, I am marking this as accepted and uploading the
patch to Rietveld for commit review.
Please comment on the
Changes by Alexander Belopolsky :
Added file: http://bugs.python.org/file17977/issue9206b.diff
___
Python tracker
<http://bugs.python.org/issue7989>
___
___
Python-bug
Changes by Alexander Belopolsky :
Removed file: http://bugs.python.org/file17977/issue9206b.diff
___
Python tracker
<http://bugs.python.org/issue7989>
___
___
Python-bug
Changes by Alexander Belopolsky :
Removed file: http://bugs.python.org/file17976/issue9206b.diff
___
Python tracker
<http://bugs.python.org/issue7989>
___
___
Python-bug
Changes by Alexander Belopolsky :
Added file: http://bugs.python.org/file17978/issue9206b.diff
___
Python tracker
<http://bugs.python.org/issue7989>
___
___
Python-bug
Alexander Belopolsky added the comment:
The bug is still present in 2.7, and 3.2.
--
nosy: +belopolsky
___
Python tracker
<http://bugs.python.org/issue4
Alexander Belopolsky added the comment:
Is this a case of pure python implementation with a C speedup? Can you upload
the patch to Rietveld? I'll take a look once it is there.
--
nosy: +belopolsky
___
Python tracker
<http://bugs.py
Changes by Alexander Belopolsky :
--
components: +Documentation
___
Python tracker
<http://bugs.python.org/issue1581183>
___
___
Python-bugs-list mailin
New submission from Alexander Belopolsky :
I have discovered this issue while working on the unit tests for issue 7989. In
the first version of the setUp/tearDown overrides, I made a mistake when
restoring sys.modules after the test run. The fix was to do
sys.modules.__init__
New submission from Alexander Belopolsky :
On Tue, Jul 13, 2010 at 4:52 PM, Brett Cannon wrote [1]:
..
> I say this every time I give an import talk and it has been brought up here
> before but obviously not everyone catches it (which is understandable as I
> think when it came up on p
Changes by Alexander Belopolsky :
--
assignee: -> d...@python
components: +Documentation
nosy: +d...@python
stage: -> needs patch
type: -> feature request
___
Python tracker
<http://bugs.python.o
Alexander Belopolsky added the comment:
It would be nice if at the same time the facilities available in test.support
and test.regrtest were reviewed and some promoted to user facing unittest
package. They can even be placed in unittest.support and unittest.regrtest
modules for easy
Changes by Alexander Belopolsky :
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue9169>
___
___
Python-bugs-list mailing list
Un
Alexander Belopolsky added the comment:
Adding issue 7989 as a dependency because having pure python implementation in
the CPython tree will make it much easier to experiment with new datetime
features.
I am still -1 on adding specialized formatting methods to the datetime class.
I think
Alexander Belopolsky added the comment:
Issue 8273 is in some sense the opposite of this - it calls for blessing of
everything in in test.support while this issue calls for wholesale
"unblessing". I don't think either approach is right. While users should
definitely nev
Alexander Belopolsky added the comment:
In issue7989c.diff, I reverted to lazy import of _strptime, added cleanup of
_xyz helper functions, and made test_datetime more robust by restoring
sys.modules more thoroughly.
Unfortunately I've encountered an issue with Rietveld that prevents me
Alexander Belopolsky added the comment:
Yes, parsing elements ending with 'Z' into aware datetime objects makes
perfect sense, but this should be done carefully because doing so will break
any code that mixes the result with naive datetimes.
There is a lengthy RFC 3339 discussio
Alexander Belopolsky added the comment:
I don't see it being applied. Tres Seaver above reports that
issue1574217_dont_mask_errors.txt applies cleanly to 2.6 branch, which means
that it has not been applied yet.
Someone needs to check if the patch is current for 2.7 and py3k branch
Changes by Alexander Belopolsky :
--
nosy: +tim.golden
___
Python tracker
<http://bugs.python.org/issue9012>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Alexander Belopolsky :
--
nosy: +tim.golden
___
Python tracker
<http://bugs.python.org/issue9079>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Alexander Belopolsky :
--
nosy: +belopolsky
___
Python tracker
<http://bugs.python.org/issue9260>
___
___
Python-bugs-list mailing list
Unsubscribe:
Alexander Belopolsky added the comment:
This looks like a borderline case between a bug and a feature request. If this
is deemed to be a feature, it is not appropriate for 2.x or 3.1. In any case,
I think the first step should be to consider this for py3k branch
Alexander Belopolsky added the comment:
I have verified that the issue is present in py3k. The unit test portion of
the patch applies cleanly in py3k an the added tests fail. The code portion
applies with patch -l and fixes the issue. I'll upload a patch with fixed
white
Changes by Alexander Belopolsky :
Added file: http://bugs.python.org/file18002/issue1574217.diff
___
Python tracker
<http://bugs.python.org/issue1574217>
___
___
Pytho
Alexander Belopolsky added the comment:
Responding to Antoine question, I don't understand how you would use a union
here. Certainly you cannot define Py_dicthashcache_t as a union of long and
Py_ssize_t because it will not be able to easily assign long or Py_ssize_t
values to it. I
Alexander Belopolsky added the comment:
On the second thought, this comment:
- /* Cached hash code of me_key. Note that hash codes are C longs.
-* We have to use Py_ssize_t instead because dict_popitem() abuses
-* me_hash to hold a search finger.
-*/
suggests
Alexander Belopolsky added the comment:
Please ignore my comment about set type. Sets don't have this issue.
--
___
Python tracker
<http://bugs.python.org/issu
Alexander Belopolsky added the comment:
Yet it looks like set has a bigger problem whenever sizeof(Py_ssize_t) >
sizeof(long). setentry.hash is defined as long, but set_pop() stores a
Py_ssize_t index in it.
--
___
Python tracker
&l
Alexander Belopolsky added the comment:
I am attaching a patch that uses a regular union of long and Py_ssize_t to
store cached hash/index value in both set and dict entry. Using an anonymous
union would simplify the patch and would reduce the likelihood of breaking
extensions that access
Changes by Alexander Belopolsky :
Removed file: http://bugs.python.org/file18005/unnamed
___
Python tracker
<http://bugs.python.org/issue9260>
___
___
Python-bugs-list m
Alexander Belopolsky added the comment:
This looks like a duplicate of issue 1581183. The issue is still present in
py3k, but only shows up in picklecycle.py when using pickle.py version. I am
attaching picklecycle3.py which is py3k version of picklecycle.py using python
pickler
Alexander Belopolsky added the comment:
There seems to be a bug somewhere in 2.x cPickle. Here is a somewhat simpler
way to demonstrate the bug: the following code
from pickletools import dis
import cPickle
t = 1L, # use long for easy 3.x comparison
s1 = cPickle.dumps(t)
s2 = cPickle.dumps
Alexander Belopolsky added the comment:
OK, the 2.7 behavior is explainable and correct. cPickle checks the reference
count and does not generate PUT for objects that don't have references:
>>> from pickletools import dis
>>> from cPickle import dumps
>>&
Alexander Belopolsky added the comment:
I am speculating here while Alexandre probably knows the answer. The skip PUT
on unreferenced objects optimization was probably removed because doing so
makes _pickle module behave more like pickle and because pickletools now has
optimize method which
Alexander Belopolsky added the comment:
I've just closed issue8738 as invalid and surely a document explaining the
differences between cPickle and _pickle would save me a lot of effort. It will
also help anyone porting from 2.x to 3.x.
Alexandre, do you have any notes that you can
Alexander Belopolsky added the comment:
The issue is still present in py3k. Attaching an updated patch with tests
only. Is this the same as issue998998?
--
assignee: -> belopolsky
nosy: +alexandre.vassalotti, belopolsky
stage: -> needs patch
versions: +Python 3.2
Added file
Alexander Belopolsky added the comment:
This does not look like a valid bug to me. OP does not show that pickle files
are different on different systems, he mangles pickle file with unix2dos
instead. This would certainly produce an invalid pickle because pickle format
requires '\n
Changes by Alexander Belopolsky :
--
status: pending -> closed
___
Python tracker
<http://bugs.python.org/issue1520662>
___
___
Python-bugs-list mailing list
Un
Alexander Belopolsky added the comment:
> The pickle.py docsstrings in 2.7+ contain the following text
> (amongst others):
>
> .. Protocol 0 is the
> only protocol that can be written to a file opened in text
> mode and read back successfully.
Hmm,
Alexander Belopolsky added the comment:
Antoine,
I think I have found a better solution. Since we are dealing with classic
classes, they should not define __new__. If in porting to 3.x, users introduce
__new__ that requires arguments, they will not be able to unpickle 2.x pickles
no
New submission from Alexander Belopolsky :
Pickle opcode documentation in pickletools still refers to old/new style
classes and changes made in 2.x series. Opcodes such as INT, INST, and OBJ
that are no longer produced by 3.x pickling code should be described as such
and discussion added on
Changes by Alexander Belopolsky :
--
dependencies: +3.1 cannot unpickle 2.7-created pickle
nosy: +alexandre.vassalotti, lemburg, mark.dickinson, pitrou
___
Python tracker
<http://bugs.python.org/issue9
New submission from Alexander Belopolsky :
Example:
>>> dis(pickle.dumps(T, 3), annotate=1)
>>>
>>>
0: \x80 PROTO 3 |
Alexander Belopolsky added the comment:
I am going to close this as a duplicate of issue 1062277. The later has a
patch, but Raymond questioned whether proposed feature is desirable. [msg47268]
I am -1, but will look at the patch there.
--
nosy: +rhettinger
resolution
New submission from Alexander Belopolsky :
Attached script, cycle.py demonstrates a simplification of the behavior
reported by mike bayer in msg77200.
Essentially, the script attempts to pickle a set that contains a class instance
that has an attribute referring back to the set:
class C
Changes by Alexander Belopolsky :
--
nosy: +alexandre.vassalotti, grubert, rhettinger, schmir, zzzeek
___
Python tracker
<http://bugs.python.org/issue9
Changes by Alexander Belopolsky :
Added file: http://bugs.python.org/file18021/cycle.py
___
Python tracker
<http://bugs.python.org/issue9269>
___
___
Python-bugs-list m
Changes by Alexander Belopolsky :
Removed file: http://bugs.python.org/file18020/cycle.py
___
Python tracker
<http://bugs.python.org/issue9269>
___
___
Python-bugs-list m
Alexander Belopolsky added the comment:
There are two issues here. The original issue is a duplicate of #1062277. The
other issue is specific to cycles containing a set. [msg77200]
I am opening a separate issue for that. See #9269.
--
resolution: -> duplicate
status: o
Alexander Belopolsky added the comment:
Chances are we will need to add protocol support for sets. See issue9269.
--
___
Python tracker
<http://bugs.python.org/issue9
Alexander Belopolsky added the comment:
I am reclassifying this as an RFE because as a bug, this is a duplicate of
issue1062277. The later contains an excellent description of the problem by
Dima Dorfman:
Our pickle implementations don't check for reduce
cycles. This is som
Alexander Belopolsky added the comment:
On Thu, Jul 15, 2010 at 8:26 PM, mike bayer wrote:
..
> where is it defined that sets are not "supposed" to contain mutable items?
> such a requirement vastly limits the usefulness of sets.
>
Well, there is no such requirement. The
Alexander Belopolsky added the comment:
On Thu, Jul 15, 2010 at 8:52 PM, Jack Diederich wrote:
..
> If database rows were mutable the results of a JOIN could be nonsensical.
And if your result set is self-referential you have a bigger problem
on your hands than not being able to pickle
Alexander Belopolsky added the comment:
I think Raymond might be interested. Since this is not a bug fix, it can only
be considered for 3.x.
--
nosy: +belopolsky, rhettinger
versions: +Python 3.2 -Python 2.7
___
Python tracker
<h
Alexander Belopolsky added the comment:
Just a reminder to myself based on Mark's suggestion on IRC. In TUPLE
opcode documentation two-tuple and three-tuple are redundant in summary line.
Can be replaced with just tuple without loss of clarity. See r
Alexander Belopolsky added the comment:
Revision 68903 was merged in py3k in r68908. It looks like a similar issue
shows up in test_random:
==
ERROR: test_pickling (test.test_random.MersenneTwister_TestBasicOps
Alexander Belopolsky added the comment:
>From IRC:
Sasha: What's the current status of pickling float inf, nan, -0.0, etc.?
Mark: In py3k and release27-maint, there shouldn't be any issues with any of
those. Same with release31-maint. In release26-maint, pickling infinities
Changes by Alexander Belopolsky :
--
dependencies: +cPickle can misread data type
___
Python tracker
<http://bugs.python.org/issue9267>
___
___
Python-bugs-list m
Alexander Belopolsky added the comment:
> Perhaps the annotations should be wrapped at 78 chars/line ..
I don't know. With deeply nested pickles, annotations may not even start
before column 80. I think further improvement in alignment and layout
algorithms will show diminishing
Alexander Belopolsky added the comment:
OK, can someone show me an example of how functions defined in core Python can
be made available to extension modules? I thought I could model pytime.h/.c
after pymath.h/.c, but the later is not used in extension modules. I must be
missing something
Alexander Belopolsky added the comment:
No it must be something else. Attached issue9079-fail.diff fails with
Symbol not found: __PyTime_gettimeofday
Referenced from: .../build/lib.macosx-10.4-x86_64-3.2-pydebug/datetime.so
even though it is in pytime.o
$ nm ./Python/pytime.o
3101 - 3200 of 4097 matches
Mail list logo