[issue1007] Fix dumbdbm, which fixes test_shelve (for me); instrument other tests so we catch this sooner (and more directly)

2007-08-23 Thread Larry Hastings
Larry Hastings added the comment: Whoops, copy paste error on the title, there. -- title: ix dumbdbm, which fixes test_shelve (for me); instrument other tests so we catch this sooner (and more directly) - Fix dumbdbm, which fixes test_shelve (for me); instrument other tests so we

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-06-08 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: I noticed this a while ago. And FWIW it's not just 3.x; I see this same behavior in 2.6. I've whipped up a test case, attached, which runs in both Python 2 and Python 3. The test runs sys.interpreter -V four times: it tries all

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-06-08 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: I realize we're down to the wire, but would it be too late to fix this in 2.7? It is a genuine bug, and it won't break any correct code. -- ___ Python tracker rep...@bugs.python.org http

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-06-08 Thread Larry Hastings
Changes by Larry Hastings la...@hastings.org: -- versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7839 ___ ___ Python-bugs-list

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-06-08 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Sorry for spamming updates, but here's two more things to consider. 1) What does it do on Windows? For all I know all four combinations work fine there and we should preserve the existing functionality. 2) All four combinations work fine

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-06-08 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Zsolt: an excellent idea! That shouldn't change the semantics of the function, and therefore is strictly a bug fix. Which means we could potentially backport it, yes? Obviously we only need to change it between string / list if we're

[issue6807] No such file or directory: 'msisupport.dll' in msi.py

2010-07-11 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Why did you assign this to me? I don't know why my name is on this bug in the first place. Is it possible you were thinking of another Larry? -- ___ Python tracker rep...@bugs.python.org http

[issue7924] test_capi crashes with misleading datetime ImportError when _curses is not built

2010-02-13 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: To reproduce: add a typo on _curses on line 1666. Of what file? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7924

[issue7924] test_capi crashes with misleading datetime ImportError when _curses is not built

2010-02-13 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Patch to make testcapsule clear import errors when testing. Sorry about the whitespace changes, but I outdented a bunch of code--I think it's clearer this way. -- Added file: http://bugs.python.org/file16223

[issue5939] Ensure that PyCapsule_GetPointer calls in ctypes handle errors appropriately

2010-02-22 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: I finally reviewed this, and I think it does need additional armor against attack. I think a user could insert a different object into the thread local dict with the hard-coded name and get CPython to crash. This patch fixes

[issue7992] Backport capsule object

2010-03-25 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: This is also (naturally) being discussed on python-dev. I've posted a long message there about it; you can find that message here: http://mail.python.org/pipermail/python-dev/2010-March/098904.html I don't know whether it's best to conduct

[issue7992] Backport capsule object

2010-03-25 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Florent: that's because the Windows build projects don't build capsule.c. I don't have an appropriate Windows development environment; I'll try to fix them by hand tonight, but if that doesn't work we'll have to call for help from some

[issue7946] Convoy effect with I/O bound threads and New GIL

2010-03-26 Thread Larry Hastings
Changes by Larry Hastings la...@hastings.org: -- nosy: +larry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7946 ___ ___ Python-bugs-list mailing

[issue8235] Support FreeBSD's SO_SETFIB in socketmodule.c

2010-03-27 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Kyle asked me to look at this; I think it looks ready for checkin, so unless someone else jumps in with something to say I'll check it in in a day or two. It's not going in to 2.6 however, just 2.7 trunk and probably 3.2. -- nosy

[issue8235] Support FreeBSD's SO_SETFIB in socketmodule.c

2010-04-02 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Committed in Python 2.7 as revision r79592 Committed in Python 3.2 as revision r79594 Thanks for the patch! -- assignee: - larry resolution: - accepted status: open - closed versions: +Python 3.2

[issue7992] Backport capsule object

2010-04-02 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Yes. I was told it was inappropriate for me to change the bsddb module, as it's independently maintained by Jesus Cea. I sent Mr. Cea a patch last night; I hope he chooses to merge it soon. Since CObjects are marked Pending Deprecation

[issue7992] Backport capsule object

2010-04-02 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Oh, and, last night I checked in r79590. This is the checkin that ameliorates the backwards compatibility issues. Specifically, I changed four things: * PyCObject_AsVoidPtr() can now open capsules. This addresses most of the remaining

[issue7992] Backport capsule object

2010-04-02 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: The patch is a bit more involved than that. Capsules didn't exist in 3.0, and the bsddb module published a CObject in 3.1. So bsddb must continue to use CObject for those two releases. Therefore the patch to the line you were addressing

[issue7992] Backport capsule object

2010-04-19 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Marking closed, as promised; 2.7b1 has been out for nine days and there hasn't been a peep. If new problems crop up from the capsule backport, please create a new issue and assign it to me. For posterity: 2.7b1 shipped with a bsddb

[issue7946] Convoy effect with I/O bound threads and New GIL

2010-04-27 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: In Windows the high-precision counter might return different results on different cores in some hardware configurations (older multi-core processors). More specifically: some older multi-core processors where the HAL implements

[issue5872] New C API for declaring Python types

2009-10-29 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Antoine: As the patch matured I would obviously provide documentation and examples and such. The point of submitting the patch in this form was a) so it was alive somewhere besides my hard drive, and b) to get some public review from the core

[issue5872] New C API for declaring Python types

2009-10-29 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Whoops! I think I'll finish that unfinished sentence. The patch attempts to mitigate this as much as possible with the backwards-compatibility header file; it minimizes as much as possible the changes you need to perform to get your code

[issue11670] configparser read_file now iterates over f, docs still say it calls readline

2011-03-25 Thread Larry Hastings
New submission from Larry Hastings la...@hastings.org: The documentation for configparser.RawConfigParser.read_file() states: Read and parse configuration data from the file or file-like object in f (only the readline() method is used). This was true in Python 3.1 and before. However in 3.2

[issue11670] configparser read_file now iterates over f, docs still say it calls readline

2011-03-25 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: By the same token, readfp is now deprecate in favor of the new spelling read_file. That change *is* mentioned in configparser. If I'm touching What's New In Python 3.2, mind if I add a mention of that too

[issue13105] Please elaborate on how 2.x and 3.x are different heads

2011-10-06 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: What follows is the original email from Nick. -- We maintain two independent heads in hg: 2.7 and default 3.2 is open for general bugfixes 2.5 (IIRC), 2.6 and 3.1 are open for security fixes Security fixes (if applicable to both heads) go

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2011-10-09 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Can I get some thoughts / votes on whether to a) check in with the current performance regression, or b) do the work to make it lazy-created? -- ___ Python tracker rep...@bugs.python.org http

[issue13086] Update howto/cporting.rst so it talks about Python 3 instead of 3.0

2011-10-09 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Attached is my first revision patch. I did some other editing for clarity / 80 columns, though I can back those out from this patch (and put in another) if that's best. Patch is against the 2.7 branch; once this goes in I'll port all my

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-25 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Victor: I think your patch merits its own tracker issue; it's only tangentially related to the proposed changes to os.stat. That said, please do add me to the nosy list if you create one. One more thing: I haven't given it a lot of thought

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-26 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Victor: I *think* Raymond's comments were directed at my patch, not yours. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11457

[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2012-12-07 Thread Larry Hastings
Larry Hastings added the comment: Sorry for the delay; this head cold is slowing me down. Here's the current state of Argument Clinic as a patch for review. I look forward to your comments! -- Added file: http://bugs.python.org/file28248/larry.clinic.patch.1.txt

[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2012-12-08 Thread Larry Hastings
Larry Hastings added the comment: Antoine, Stefan: There doesn't appear to be a bright line separating this should get a PEP from this doesn't need a PEP. That said, changes to the C API for CPython don't seem to merit PEPs very often, the recent Stable ABI being the lone exception

[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2012-12-09 Thread Larry Hastings
Larry Hastings added the comment: I disagree that the Clinic DSL is verbose. Certainly I find it more succinct than what we do now. On the other hand, the syntax you proposed in the python-dev message you cite is insufficient to the task. Consider a function that takes a char *. How might

[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2012-12-09 Thread Larry Hastings
Larry Hastings added the comment: What lines end with a colon? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16612 ___ ___ Python-bugs-list

[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2012-12-10 Thread Larry Hastings
Larry Hastings added the comment: Ah. In that case, may I rewrite your critique as [...] some lines may end with a semicolon, some lines may not, some assignment signs (=) permit spaces around them, some don't. The semicolon is optional, permitted explicitly so you can copy-and-paste

[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2012-12-13 Thread Larry Hastings
Larry Hastings added the comment: I don't think we can solve the problem of the output being too long for your liking. Personally I like the output; I find it eminently readable, and making it shorter would impair that. I think in the majority of uses Clinic will be a win for readability

[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2012-12-14 Thread Larry Hastings
Larry Hastings added the comment: I have no current plan to write a PEP. I don't know how to settle the difference of opinion here; the easiest thing would be if you convinced Guido we needed one. -- ___ Python tracker rep...@bugs.python.org http

[issue16656] os.listdir() returns unusable bytes result on Windows

2012-12-14 Thread Larry Hastings
Larry Hastings added the comment: I'm a little confused. FindFirstFile is an ANSI API, so we get a narrow string back. We call PyBytes_FromString(), which expects a narrow string and returns a bytes object. Who's trying (and failing) to encode the filename

[issue16801] Preserve original representation for integers / floats in docstrings

2012-12-28 Thread Larry Hastings
New submission from Larry Hastings: The line declaring the function dbm.open looks like this: def open(file, flag='r', mode=0o666): The docstring for dbm.open looks like this: open(file, flag='r', mode=438) Obviously 438==0o666. But the author used the octal representation because

[issue16801] Preserve original representation for integers / floats in docstrings

2012-12-28 Thread Larry Hastings
Larry Hastings added the comment: (I was also considering proposing using annotations to tell the parser we want the original representation in the docstring, but I suspect that's a bad idea. That would instantly restrict the untamed frontier that is annotations

[issue16801] Preserve original representation for integers / floats in docstrings

2012-12-28 Thread Larry Hastings
Larry Hastings added the comment: Okay, counter-proposal time. We add a new field to the Parameter object, the preferred string representation of the default. If the parameter has a default, it is always a string, by default repr(parameter_default_value); if the parameter has no default

[issue16801] Preserve original representation for integers / floats in docstrings

2013-02-05 Thread Larry Hastings
Larry Hastings added the comment: Georg: what other functions do you know of where (as you suggest) the signature could be improved? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16801

[issue16038] ftplib: unlimited readline() from connection

2013-02-09 Thread Larry Hastings
Larry Hastings added the comment: My spies are everywhere! You cannot hide your black heart, Pitrou. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16038

[issue17187] Python segfaults from improperly formed and called function

2013-02-11 Thread Larry Hastings
New submission from Larry Hastings: Python 3.3 added a nice new feature: if you don't supply enough positional parameters to a function, it tells you the names of the positional parameters you omitted. Unfortunately, the code that prints this error message assumes that the function is well

[issue17187] Python segfaults from improperly formed and called function

2013-02-11 Thread Larry Hastings
Changes by Larry Hastings la...@hastings.org: -- keywords: +patch Added file: http://bugs.python.org/file29044/lch.bandaid.for.malformed.fn.crash.1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17187

[issue1518] Fast globals/builtins access (patch)

2013-02-11 Thread Larry Hastings
Larry Hastings added the comment: It sort of looks like this was closed because we assumed we were moving to Unladen Swallow. We're not. Should this be reopened? -- nosy: +larry ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue17190] _FAST opcodes do no range checking

2013-02-11 Thread Larry Hastings
New submission from Larry Hastings: The implementations for LOAD_FAST, STORE_FAST, and DELETE_FAST don't check that the index is = the size of fastlocals. So it's a snap to crash the interpreter with hand-written bytecode, by going past the end of the fastlocals array. Kaboom! Attached

[issue17190] _FAST opcodes do no range checking

2013-02-12 Thread Larry Hastings
Larry Hastings added the comment: I'm not surprised it was discussed to death long ago. And I can get behind wontfix. But let me just say that a) I think an uncrashable Python interpreter is a laudable goal, and steps we can take towards that should not be dismissed out of hand. b) I doubt

[issue17170] string method lookup is too slow

2013-02-13 Thread Larry Hastings
Larry Hastings added the comment: Argument Clinic has languished for lack of time. I didn't get much feedback, though a couple people were shouting for a PEP, which I was resisting. I figured, if they have something to say, they can go ahead and reply on the tracker issue, and if they don't

[issue17170] string method lookup is too slow

2013-02-13 Thread Larry Hastings
Larry Hastings added the comment: Oh, and, as to whether Argument Clinic would solve this problem, the answer is not yet. Right now Argument Clinic literally generates calls to PyArg_ParseTupleAndKeywords. (In special cases it switches to PyArg_ParseTuple.) I'm more interested in Argument

[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2013-02-23 Thread Larry Hastings
Larry Hastings added the comment: Okay, I have finally addressed all the comments so far. Changes described below are my patch #2. They're also checked in to https://bitbucket.org/larry/python-clinic/ . * Antoine, Nick, et al: I've converted clinic.txt into a PEP. I've already sent

[issue16801] Preserve original representation for integers / floats in docstrings

2013-02-24 Thread Larry Hastings
Larry Hastings added the comment: FWIW I think the octint class is a great idea. It's nice and localized, and it should have no performance impact and only a small maintenance impact. It'll also preserve the readability of the default if you pull it out with inspect.getfullargspec

[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2013-02-25 Thread Larry Hastings
Larry Hastings added the comment: Argument Clinic is now PEP 436. http://www.python.org/dev/peps/pep-0436/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16612

[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2013-02-25 Thread Larry Hastings
Larry Hastings added the comment: A quick note about the extension mechanism. Currently the only way to extend PyArg_Parse* is via O. Therefore, any extended type you add will use O, and will have a converter. So internally all I did was say if the parameter has a converter, ignore

[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2013-02-26 Thread Larry Hastings
Larry Hastings added the comment: As a rule I'm unlikely to mention things I haven't heard about. I've never used Cython, and I don't recall anyone mentioning this technology previously. Once skrah posts his alternative DSL proposal, I'll amend the PEP to discuss both these alternatives

[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2013-02-26 Thread Larry Hastings
Larry Hastings added the comment: write_clinic_file tells Clinic to start writing to the clinic file, which I think is best to do at the very top of the file. include_clinic_file spits out the #include, which you probably want near the bottom of the file, just before the static module

[issue17324] SimpleHTTPServer serves files even if the URL has a trailing slash

2013-03-01 Thread Larry Hastings
New submission from Larry Hastings: To reproduce: 1) Create a file called foo.txt in the local directory, put whatever you like in it. 2) Run python -m SimpleHTTPServer or python3 -m http.server. 3) Point your web browser at http://127.0.0.1:8000/foo.txt/;. 4) Note that the server has served

[issue17324] SimpleHTTPServer serves files even if the URL has a trailing slash

2013-03-01 Thread Larry Hastings
Changes by Larry Hastings la...@hastings.org: -- stage: - test needed type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17324

[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2013-03-09 Thread Larry Hastings
Larry Hastings added the comment: Thanks for pointing that out! I've fixed it in my local branch, though I'm fooling around with some new syntax so I'm not ready to publish it yet. It's not a general problem, exactly; it's a problem with extension types. After just a little tweaking

[issue13477] tarfile module should have a command line

2013-03-19 Thread Larry Hastings
Larry Hastings added the comment: Modern tar programs don't need to be told the compression method--they infer it. If they can do it in C, we can do it in Python. So we should simply omit the -bz2 stuff. As for what the interface should look like, I'm definitely in favor of it looking like

[issue13477] tarfile module should have a command line

2013-03-19 Thread Larry Hastings
Larry Hastings added the comment: Huh. tar *can* infer it from the data itself. On the other hand, it chooses explicitly not to. % cat ~/Downloads/Python-3.3.0.tar.bz2| tar xvf - tar: Archive is compressed. Use -j option tar: Error is not recoverable: exiting now % cat ~/Downloads/Python

[issue17499] inspect.Signature and inspect.Parameter objects are mutable

2013-03-20 Thread Larry Hastings
New submission from Larry Hastings: The documentation for Inspect.Signature and Inspect.Parameter states that the objects are immutable. And they go to great lengths to provide a convenient interface allowing you to replace members. However, the objects make only a pathetic effort at being

[issue17499] inspect.Signature and inspect.Parameter objects are mutable

2013-03-20 Thread Larry Hastings
Larry Hastings added the comment: Yes, it seems I've been living in a fool's paradise, happy and ignorant. I thought that the behavior of garden-variety immutable objects was like tuple, where the implementor shored up the interface and the saboteur had to work *really* hard to modify

[issue17490] Use converter functions to implement ast.literal_eval

2013-03-20 Thread Larry Hastings
Larry Hastings added the comment: For what it's worth, here's what we're doing. The new Argument Clinic parameter line looks a great deal like the middle bit of a Python function declaration. So much so that we can do this: ast_string = def x({}): pass.format(parameter_line) root

[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'

2011-08-21 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: So what about doing the same for FreeBSD, SunOS, and Windows? The conversation about this point sort of trailed off. But, dammit, a foolish consistency is the hobgoblin of my small mind. If we're changing linux2 / linux3 to just linux, we

[issue12898] add opendir() for POSIX platforms

2011-09-05 Thread Larry Hastings
New submission from Larry Hastings la...@hastings.org: With the recent spate of POSIX *at() functions added to os, we now have a bunch of places in the API that take directory fds. But afaict there's no way to get a directory fd in Python! The only calls to opendir() in the tree

[issue12899] Change os.utimensat() and os.futimens() to use float for atime mtime

2011-09-05 Thread Larry Hastings
New submission from Larry Hastings la...@hastings.org: The new functions os.futimens() and os.utimensat() update the timestamps of a file with nanosecond precision. However, both functions take atime and mtime as a tuple: (seconds since epoch, nanoseconds). Contrast this with os.utime

[issue12898] add opendir() for POSIX platforms

2011-09-05 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Well, there's no os.fdopendir(); I think you're referring to fdlistdir(), which uses the C function fdopendir() internally. The DIR structure is not exposed to the Python caller at any point. I did miss the whole opendir-returns-a-DIR

[issue12898] add opendir() for POSIX platforms

2011-09-05 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: fdlistdir() is largely irrelevant to the discussion. I was proposing adding a function to open directory fds, because there isn't one; fdlistdir(), like many other POSIX functions available in Python, consumes directory fds

[issue12898] add opendir() for POSIX platforms

2011-09-05 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Is there anything you want to do on a directory fd except listing its contents? In the first message in this bug, I wrote: With the recent spate of POSIX *at() functions added to os, we now have a bunch of places in the API that take

[issue12899] Change os.utimensat() and os.futimens() to use float for atime mtime

2011-09-05 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: I'm withdrawing this, as I've found a better way to approach the problem. -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue12904] Change os.utime c functions to use nanosecond precision where possible

2011-09-05 Thread Larry Hastings
New submission from Larry Hastings la...@hastings.org: Since Linux 2.5 stat() has supported reading nanosecond resolution (1b/sec) for atime and mtime. However, the utime() family of functions could only write atime and mtime with microsecond resolution (1m/sec) until relatively recently

[issue12904] Change os.utime c functions to use nanosecond precision where possible

2011-09-05 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: A small aside: An IEEE 754 double is insufficient to store a modern timestamp with nanosecond accuracy. We're currently at just over 1.3 billion seconds since the epoch. This eats 28 bits of the mantissa. (The value is actually 31 bits

[issue12904] Change os.utime c functions to use nanosecond precision where possible

2011-09-05 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: It's a duplicate of issue #11457. No. #11457 is a how-many-angels-on-the-head-of-a-pin discussion proposing new representations of ctime/mtime/atime to preserve nanosecond accuracy. This patch changes the behavior of os.utime, os.futimes

[issue11457] Expose nanosecond precision from system calls

2011-09-05 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: This is probably a terrible idea, but: what about using a subclass of float that internally preserves the original sec / usec values? Call it a utime_float for now. os.stat would produce them, and os.utime would look for them

[issue11457] Expose nanosecond precision from system calls

2011-09-06 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Here's a better idea: we add a new IEEE 754-2008 quad-precision float type. The IEEE 754-2008 quad precision float has 1 sign bit, 15 bits of exponent, and 112 bits of mantissa, so it should have enough precision to last utime until

[issue11457] Expose nanosecond precision from system calls

2011-09-09 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: I think a pair of integers is a poor API. It ties the value of the fractional part to nanoseconds. What happens when a future filesystem implements picosecond resolution? And then later goes to femtoseconds? Or some platform chooses

[issue11457] Expose nanosecond precision from system calls

2011-09-09 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: To support higher resolution will need to supply 3 fields in st_xtimesuperspec: tv_sec and tv_nsec packed in st_xtimespec (say tv_timespec) and new tv_psec field. st_xtime will now be st_xtimesuperspec.tv_timespec.tv_sec

[issue11457] Expose nanosecond precision from system calls

2011-09-09 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: I've drawn an ASCII table summarizing the proposals so far. If I've made any factual errors I trust you'll let me know. =type means os.stat().st_mtime is changed to that type. +type means os.stat() grows a new field using that type

[issue11457] Expose nanosecond precision from system calls

2011-09-09 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: s/pair-of-floats/pair-of-ints/ Also, to be clear: yocto is the smallest defined SI prefix. And what I meant when I referred to 10**-3 was, float128 could handle 10**-24 but not 10**-27. According to my back-of-the-envelope calculations

[issue11457] Expose nanosecond precision from system calls

2011-09-11 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Mark Dickinson: I realize a new float type would be a major undertaking That's an understatement and a half. The only way this could ever be viable is if float128 support becomes widespread enough that we don't have to write our own

[issue11457] Expose nanosecond precision from system calls

2011-09-11 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Victor STINNER: Python is compiled using Visual Studio 2008 on Windows. Portability does matter on Python. If a type is not available on *all* platforms (including some old platforms, e.g. FreeBSD 6 or Windows XP), we cannot use

[issue11457] Expose nanosecond precision from system calls

2011-09-26 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Mark Dickinson wrote: I think this could work. could? Oh ye of little faith! Attached is a patch against a nice fresh trunk (2b47f0146639) that adds Decimal attributes ctime, mtime, and atime to the object returned by os.stat

[issue13053] Add Capsule migration documentation to cporting

2011-09-28 Thread Larry Hastings
New submission from Larry Hastings la...@hastings.org: After the great Capsule flame wars of 2011, it became clear that we need documentation on migrating from CObject to Capsules, as CObject is gone as of 3.2. Nick made me promise to write the documentation, and Raymond steered me

[issue13086] Update howto/cporting.rst so it talks about 3.x instead of 3.0

2011-10-01 Thread Larry Hastings
New submission from Larry Hastings la...@hastings.org: The title of howto/cporting.rst is Porting Extension Modules To 3.0. It then talks about 3.0 in a whole bunch of places. Considering that we're working on 3.3, and considering that 3.0 is end-of-lifed (not even meriting a branch in hg

[issue13053] Add Capsule migration documentation to cporting

2011-10-01 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Attached is a patch against trunk branch 2.7 (rev dec00ae64ca8) adding documentation on how to migrate CObjects to Capsules. Delta the inevitable formatting bikeshedding, this should be ready to go. I've smoke-tested the capsulethunk.h

[issue13053] Add Capsule migration documentation to cporting

2011-10-01 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Whoops, forgot to attach. *Here's* the patch. -- keywords: +patch Added file: http://bugs.python.org/file23282/larry.cporting.capsules.r1.diff ___ Python tracker rep...@bugs.python.org http

[issue13086] Update howto/cporting.rst so it talks about 3.x instead of 3.0

2011-10-01 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Why shouldn't I check this in to the 2.7 / 3.1 branches? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13086

[issue13053] Add Capsule migration documentation to cporting

2011-10-02 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Attached is r2 of the patch, incorporating Nick's suggestions. Base revision hasn't changed. -- Added file: http://bugs.python.org/file23301/larry.cporting.capsules.r2.diff ___ Python tracker rep

[issue13053] Add Capsule migration documentation to cporting

2011-10-02 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: In case you're curious, here's how I tested capsulethunk.h. I added the file to Python 2.7 (hg head), 3.0.0 (tarball), and 3.1.0 (tarball). For 2.7 ad 3.0.0 I quickly hacked four files to use the Capsule API instead of CObjects: * Python

[issue13053] Add Capsule migration documentation to cporting

2011-10-04 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: New patch based on comments from Ezio Melotti--thanks, Ezio! * capsulethunk.h is now its own file in Doc/includes. * Various minor formatting touchups. * I added some rationale behind the thunked PyCapsule_SetName behavior. -- Added

[issue13105] Please elaborate on how 2.x and 3.x are different heads

2011-10-04 Thread Larry Hastings
New submission from Larry Hastings la...@hastings.org: It wasn't clear to me after reading the Forward Porting section exactly what was going on. Nick Coghlan spelled it out for me in a private email, and suggested that maybe this stuff should be in the devguide proper. Here's some specific

[issue14889] PyBytes_FromObject(bytes_object) fails

2012-05-23 Thread Larry Hastings
New submission from Larry Hastings la...@hastings.org: If you pass a valid PyUnicodeObject into PyUnicode_AsObject(), it incref's the original object and returns it. If you pass a valid PyBytesObject into PyBytes_AsObject()... it fails. I assert that in the PyBytes_AsObject() should behave

[issue14889] PyBytes_FromObject(bytes_object) fails

2012-05-23 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: The appropriate four line patch. (Six with whitespace.) -- keywords: +patch stage: needs patch - patch review Added file: http://bugs.python.org/file25682/larry.pybytes_fromobject.identity.1.diff

[issue14889] PyBytes_FromObject(bytes_object) fails

2012-05-23 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: 1) Yes, whoopsies. It's late. 2) It fails, as in, it returns NULL. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14889

[issue14889] PyBytes_FromObject(bytes_object) fails

2012-05-24 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: I can't reproduce this, and it was pretty late in my day when I saw it, so let's assume I was mistaken and PyBytes_CheckBuffer() works fine. Nevertheless I think the patch is a good idea--why create a new object when you don't have

[issue14889] PyBytes_FromObject(bytes_object) creates a new object

2012-05-24 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Changing the name of the report to accurately reflect reality. If you passed in a bytes object, PyBytes_FromObject would create a new object, when all it really needed to do was incref and return. My checkin in a minute will add

[issue14889] PyBytes_FromObject(bytes_object) creates a new object

2012-05-24 Thread Larry Hastings
Changes by Larry Hastings la...@hastings.org: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14889

[issue3177] Add shutil.open

2012-05-25 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: As an example, ``os.startfile(a.py)`` will usually run `a.py` in the Python interpreter, while ``xdg-open a.py`` it will usually open the source code in an editor on Linux. Well, so how about on UNIX shutil.launch (or whatever it's called

[issue14917] Make os.symlink on Win32 detect if target is directory

2012-05-25 Thread Larry Hastings
New submission from Larry Hastings la...@hastings.org: The prototype for os.symlink on Windows adds a target_is_directory flag, which indicates whether or not the destination is a directory. Surely we could detect that and pass in the correct value ourselves? A quick GetFileAttributes() call

[issue3177] Add shutil.open

2012-05-25 Thread Larry Hastings
Larry Hastings la...@hastings.org added the comment: Could even add an `operation` parameter to let the caller select actions, [...] operation in ['auto', 'run', 'edit', 'display', 'browse', 'explore', 'share', 'send', 'like', 'email', 'open', 'xdg-open', ...] # can be incrementally added

  1   2   3   4   5   6   7   8   9   10   >