[issue11707] Create C version of functools.cmp_to_key()
Eric Smith e...@trueblade.com added the comment: I haven't had time to look at this in detail, but the concept appears sound. I'll try to devote some time to it, but hopefully someone else on core-mentorship with more familiarity with this code will also be able to review it. One thing: You don't want to delete the pure Python version, as that can be used by alternate implementations. You want to leave it in place, and then after it try to import the C version. If the import fails, the Python version will be used, if it succeeds, the C version will be used. I'm reasonably sure there are examples of testing both implementations elsewhere in the stdlib. Maybe ask on core-mentorship for pointers. Thanks for working on this! -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11707 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11648] openlog()s 'logopt' keyword broken in syslog module
Eric Smith e...@trueblade.com added the comment: I agree with Georg, unfortunately. And I say unfortunately because neither logopt nor logoption is a good name. The log part adds nothing. The man page for syslog calls this option, which would be my preferred name. But changing it now would be a hassle. Also, we clearly need a test for this, since apparently none failed when it was changed to the longer name. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11648 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7833] Bdist_wininst installers fail to load extensions built with Issue4120 patch
Changes by Eric Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7833 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11641] raw_input() - input() security issue
Changes by Eric Smith e...@trueblade.com: -- resolution: - invalid status: open - closed type: security - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11641 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11644] 2to3 example.py is not a Python 2.x file
Eric Smith e...@trueblade.com added the comment: Plus, it's recommended to move to 2.6 or 2.7 before trying to port to 3.x. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11644 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11644] 2to3 documentation should mention that the sample file requires 2.6 or better
Eric Smith e...@trueblade.com added the comment: I'll agree that the documentation could mention that. Reopening. Patches accepted. -- components: -2to3 (2.x to 3.0 conversion tool) resolution: invalid - stage: committed/rejected - status: closed - open title: 2to3 example.py is not a Python 2.x file - 2to3 documentation should mention that the sample file requires 2.6 or better ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11644 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9584] Allow curly brace expansion
Eric Smith e...@trueblade.com added the comment: Yes, we recently switched to Mercurial. See http://docs.python.org/devguide/faq.html You shouldn't need to change your patches just because of the switch from svn. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9584 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11607] Apllication crashes when saving file
Eric Smith e...@trueblade.com added the comment: You're going to need to supply more information. What application? Can you post the source code? What does crashes mean? Is it giving a Python traceback? If so, please supply it. Thanks. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11607 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11505] string.py increased test coverage
Changes by Eric Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11505 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9856] Change object.__format__(s) where s is non-empty to a TypeError
Changes by Eric Smith e...@trueblade.com: -- priority: release blocker - deferred blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9856 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9856] Change object.__format__(s) where s is non-empty to a TypeError
Eric Smith e...@trueblade.com added the comment: Next step is to make it a TypeError in 3.4. -- priority: normal - release blocker title: Change object.__format__(s) where s is non-empty to a DeprecationWarning - Change object.__format__(s) where s is non-empty to a TypeError versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9856 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11072] Add MLSD command support to ftplib
Eric Smith e...@trueblade.com added the comment: I'll give this a proper review in the next day or so (busy at PyCon). Despite the fact that I typically hate changing values returned by the server, I agree on case-folding the fact names to lowercase upon reading them. The RFC clearly states they're case insensitive: Fact names are case-insensitive. Size, size, SIZE, and SiZe are the same fact. You should have the facts in MLSD_DATA be mixed case, to ensure they're being lowercased correctly. I agree that there's nothing that can be done in the case where no facts are specified: the spec clearly says just use the values we've previously set. Caller beware. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11072] Add MLSD command support to ftplib
Eric Smith e...@trueblade.com added the comment: So it is. I told you I hadn't done a proper review! I was mainly trying to say I agree with lowercasing. I'll shut up until I can read the whole patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9584] Allow curly brace expansion
Eric Smith e...@trueblade.com added the comment: I removed the unused import (mostly as a simple test of mercurial, it's my first commit there). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9584 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11072] Add MLSD command support to ftplib
Eric Smith e...@trueblade.com added the comment: I agree that the callback isn't needed, and it reflects the older coding style of much of the library (such as in retrlines). Instead, I'd make this a generator, yielding each of the dicts. (Actually in some ideal rewrite of ftplib, the whole callback feature used by retrlines would go away except as a compatibility feature, and internally everything would use generators instead of callbacks.) Aren't you modifying the state on the server (via OPTS MLST), and then if you make a subsequent call without specifying facts you'll be using the value of facts from the previous call to MLSD? I don't think that's desirable, but short of calling OPTS MLST every time (possibly with the results of an initial FEAT) there's no way around it. Just today I saw a filename with ; in the name. I think you want to use .partition(' ') isolate the facts from the filename, and add a test with such a filename. I don't like the isdigit test. Shouldn't this decision be left to the caller? What if a fact happens to look like an integer some of the time, but not always? Maybe unique is a hex string. I don't think you'd want it converted to an int on the occasions where it was all decimal digits, but a string otherwise. Also look at your modify facts. Those are not very useful as ints. I don't think you should invent a pseudo-fact name, in case the standard ever uses that. I'd prefer if you yielded tuples of (filename, fact-dict). MLSD_DATA has newlines in it, so you get \r\n\n sequences in your test data. If a fact=value string does not have an '=', you silently ignore it. I'd rather this raise an exception and not pass silently. It's not compliant. You should have a test for this. It's possible for a value to have an '=' in it, so you don't want to use .split('='), you should use .partition('='). You should add such a fact to the test data. Thanks for working on this. It will be a great addition to ftplib. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11396] add format handler to bytes object
Eric Smith e...@trueblade.com added the comment: There have been a number of discussions about this, but no concrete proposal. The last one I recall was to add a __bformat__ method, but I couldn't find the email trail just now. See also issue 3982. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11396 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11396] add format handler to bytes object
Eric Smith e...@trueblade.com added the comment: I found part of the discussion I was looking for: http://mail.python.org/pipermail/python-dev/2010-July/102252.html -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11396 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11382] some posix module functions unnecessarily release the GIL
Changes by Eric Smith e...@trueblade.com: -- components: +Interpreter Core nosy: +eric.smith, pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11382 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10833] Replace %.100s by %s in PyErr_Format(): the arbitrary limit of 500 bytes is outdated
Eric Smith e...@trueblade.com added the comment: I don't feel strongly one way or the other about it. I was just relaying the reason I heard when I asked the question about why it's done the way it is. I suggest mentioning that you're going to commit this change on python-dev, since this seems like an issue that people might care about without knowing about its existence in the bug tracker. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10833 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11378] os.path.join when second argument starts with '/' (linux/unix)
Eric Smith e...@trueblade.com added the comment: I appreciate that you're unconvinced of its usefulness, but you can be assured that some of us do find it a useful and desirable behavior. And Python isn't the only system that works this way, emacs does the same thing when you enter filenames. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11378 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11264] Format Specification Mini-Language missing type 'i'?
Eric Smith e...@trueblade.com added the comment: It would be redundant, so we don't need both. I don't recall any discussion when PEP 3101 was developed as to choosing 'd' over 'i'. In all of the C code I've seen use printf, I don't think I've ever seen 'i' used. -- resolution: - rejected stage: - committed/rejected status: open - closed type: - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11264 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)
Eric Smith e...@trueblade.com added the comment: [I doubt my terminology is exactly correct in this post, but I've tried my best to make it so.) The more I think about this the more I realize we can't implement a parser that doesn't make guesses about '-' prefixed args and that works with arparse's existing behavior with respect to optional arguments. For example: parser = argparse.ArgumentParser() parser.add_argument('--foo', nargs='?') parser.add_argument('--bar', nargs='?') print parser.parse_args(['--foo', '--bar', 'a']) print parser.parse_args(['--foo', 'x', '--bar', 'a']) Unless the parser tries to guess that --bar is an optional argument by itself, it can't know that --foo has an argument or not. I guess it could look and say that if you called this with '--foo --baz', then '--baz' must be an argument for '--foo', but then you could never have an argument to '--foo' named '--bar', plus it all seems fragile. Maybe this new parser (as Steven described it) wouldn't allow a variable number of arguments to optional arguments? That is, nargs couldn't be '?', '*', or '+', only a number. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9334 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)
Eric Smith e...@trueblade.com added the comment: Without guessing which args are options, I don't see how it's possible to implement parse_known_args(). I'd propose raising an exception if it's called and dont_assume_everything_that_looks_like_a_flag_is_intended_to_be_one (or whatever it ends up being called) is True. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9334 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)
Eric Smith e...@trueblade.com added the comment: Steven: Yes, the current structure of the first pass scan makes any patch problematic. It really would be an implementation of a different algorithm. I'm still interested in looking at it, though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9334 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11145] '%o' % user-defined instance
Changes by Eric Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)
Eric Smith e...@trueblade.com added the comment: -- won't work. Traditionally, this has been used to separate optional arguments from positional arguments. Continuing the cd example, that's what would let you cd into a directory whose name starts with a hyphen: $ cd -links-/ -bash: cd: -l: invalid option cd: usage: cd [-L|-P] [dir] $ cd -- -links- $ This would also work with argparse: import argparse parser = argparse.ArgumentParser(prog='cd') parser.add_argument('-L', help='follow symbolic links') parser.add_argument('-P', help='do not follow symbolic links') parser.add_argument('dir', help='directory name') print(parser.parse_args(['--', '-Links-'])) prints: Namespace(L=None, P=None, dir='-Links-') Continuing the example from my earlier post shows it won't work for values for optional arguments: parser.parse_args(['--asciidoc-opts -- -one']) usage: a2x [-h] [--asciidoc-opts ASCIIDOC_OPTS] a2x: error: unrecognized arguments: --asciidoc-opts -- -one I believe it's only the '=' that will solve this problem. In fact, because of this issue, I suggest we document '=' as the preferred way to call argparse when optional arguments have values, and change all of the examples to use it. I also think it would cause less confusion (because of this issue) if the help output showed the equal sign. But I realize that's probably more controversial. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9334 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)
Eric Smith e...@trueblade.com added the comment: Good point, I hadn't thought of that. Maybe ArgumentParser needs a don't try to be so helpful, parse like optparse option. Which is what Steven suggested earlier, I believe. I'd take a crack at this if there's general consensus on that solution. We can change the documentation to point out the issue now, but the feature request can only go in 3.3. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9334 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)
Eric Smith e...@trueblade.com added the comment: I'd also like to see this as the default. After all, presumably we'd like Python scripts to work like all other command line programs, and I too am unaware of any other option parsing library that works the way argparse does. But changing released behavior in the stdlib is problematic, as everyone knows. I'll look into producing a patch to add this as optional behavior, then we can separately think about changing the default. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9334 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11113] html.entities mapping dicts need updating?
Eric Smith e...@trueblade.com added the comment: I don't see the need for a parameter to support different sets of entities. Just supporting the ones from HTML 5 seems like the right thing. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11113] html.entities mapping dicts need updating?
Eric Smith e...@trueblade.com added the comment: Ah. I hadn't thought of generating them, only parsing them. In that case, then yes, it's an issue for generation. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)
Eric Smith e...@trueblade.com added the comment: While I also dislike the existing behavior, note that you can get what you want by using an equal sign. import argparse parser = argparse.ArgumentParser(prog='a2x') parser.add_argument('--asciidoc-opts', ... action='store', dest='asciidoc_opts', default='' ... metavar='ASCIIDOC_OPTS', help='asciidoc options') parser.parse_args(['--asciidoc-opts', '-1']) Namespace(asciidoc_opts='-1') parser.parse_args(['--asciidoc-opts=-one']) Namespace(asciidoc_opts='-one') I always use the equal sign, so I've never noticed this behavior before. I wish that help would display the equal sign, but that's another issue. -- versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9334 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11114] file.tell extremely slow
Eric Smith e...@trueblade.com added the comment: Do you have a benchmark program you can post? -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11122] bdist_rpm fails
Eric Smith e...@trueblade.com added the comment: rpm -ba is very old. I think it's been at least since 2002 that -ba was supported by rpm. I believe bdist_rpm is calling rpmbuild -ba, and if that doesn't exist, then rpm -ba is a transition strategy until all systems supported rpmbuild. This transition period should be over. Unfortunately today it's far more likely that rpm -ba will not be what you want to call, but rpm will almost always be found, giving this error. Most systems (certain RedHat based) ship rpmbuild as a separate command. RedHat installs it via the rpm-build package. I'd suggest just switching bdist_rpm to always use rpmbuild. Then at least the error would be that rpmbuild isn't found. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11122 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11125] csv documentation should not use open() without close()
New submission from Eric Smith e...@trueblade.com: Many places open() is shown as a parameter to a csv method, but close() can't be called. This is not a practice we should be advocating. Better would be to show a 'with' statement, or at least a note explaining this isn't an ideal usage. -- assignee: docs@python components: Documentation keywords: easy messages: 127954 nosy: docs@python, eric.smith priority: normal severity: normal status: open title: csv documentation should not use open() without close() versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11125 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11095] subprocess popen broken for bytes and backslash
Eric Smith e...@trueblade.com added the comment: 1: subprocess.call is documented as taking a string, not bytes. If you think it should also take bytes, I suggest opening a separate bug as a feature request. 2: You're running into both Python and the shell escaping. If you have an odd number of backslashes, then python is converting '\a' into an ascii BEL character: http://docs.python.org/py3k/reference/lexical_analysis.html#string-literals For the remaining backslashes, Python is converting every 2 into a single backslash when it does its escaping, and the shell is doing the same thing, as is echo. That accounts for 8 backslashes becoming a single backslash in the output. -- nosy: +eric.smith resolution: - invalid stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11095 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11072] Add MLSD command support to ftplib
Changes by Eric Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11032] _string: formatter_field_name_split() and formatter_parser() don't check input type
Eric Smith e...@trueblade.com added the comment: It looks like the canonical message is expected X, got Y. With that change I've checked it in in r88226. I'll backport. -- assignee: haypo - eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11032 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11032] _string: formatter_field_name_split() and formatter_parser() don't check input type
Eric Smith e...@trueblade.com added the comment: Actually this error doesn't exist on older versions because these used to be methods on a string. The error was introduced in r85456 (issue 9418) when these became functions in the _string module. No need to backport. -- resolution: - accepted stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11032 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9418] Move _formatter_* methods from string type into _string module
Eric Smith e...@trueblade.com added the comment: No further action required. I'm not going to remove format() and friends from stringlib as long as there's chatter about adding a .format() for bytes. -- resolution: - accepted stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9418 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11032] _string: formatter_field_name_split() and formatter_parser doesn't check input type
Eric Smith e...@trueblade.com added the comment: The patch looks good to me. I've added some more tests to cover some corner cases. Go ahead and commit it. -- Added file: http://bugs.python.org/file20572/_string0.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11032 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11039] Use of 'L' specifier is inconsistent when printing long integers
Eric Smith e...@trueblade.com added the comment: There is no suffix in python 3.x. Since this is a feature request, and there will be no new releases of 2.x, I'm closing this. -- nosy: +eric.smith resolution: - rejected stage: - committed/rejected status: open - closed type: - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11039 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11051] system calls per import
Changes by Eric Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11051 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11032] _string: formatter_field_name_split() and formatter_parser doesn't check input type
Changes by Eric Smith e...@trueblade.com: -- type: - crash ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11032 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11032] _string: formatter_field_name_split() and formatter_parser() don't check input type
Eric Smith e...@trueblade.com added the comment: Release manager: You can decide if this fix should go in before 3.2. It's a trivial fix to a crasher, but it's extremely unlikely anyone would trip over it. It's been a crasher since 3.0. It's also a crasher in 2.7, although there it's in the str module and the method names have leading underscores. -- assignee: - georg.brandl components: +Extension Modules -Library (Lib) nosy: +benjamin.peterson, georg.brandl priority: normal - release blocker title: _string: formatter_field_name_split() and formatter_parser doesn't check input type - _string: formatter_field_name_split() and formatter_parser() don't check input type versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11032 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11032] _string: formatter_field_name_split() and formatter_parser doesn't check input type
Eric Smith e...@trueblade.com added the comment: I'll review this tomorrow. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11032 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10968] threading.Timer should be a class so that it can be derived
Changes by Eric Smith e...@trueblade.com: -- nosy: +eric.smith title: Timer should be a class so that it can be derived - threading.Timer should be a class so that it can be derived ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10968 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10930] dict.setdefault: Bug: default argument is ALWAYS evaluated, i.e. no short-circuit eval
Eric Smith e...@trueblade.com added the comment: Or use a collections.defaultdict, which has a factory function as a constructor argument. It sort of depends on what you're trying to do. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10930 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10873] String formatting example invalid
Eric Smith e...@trueblade.com added the comment: This feature was added in 2.7 (and 3.1, I think). If the numeric indices are not specified, they take the args in order. -- assignee: d...@python - eric.smith nosy: +eric.smith resolution: - invalid stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10873 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10876] Zipfile crashes when zip password is set to 610
Eric Smith e...@trueblade.com added the comment: What do you mean by is set to 610? Can you show us the code that caused this error? -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10876 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3173] external strftime for Python?
Changes by Eric Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3173 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3173] external strftime for Python?
Eric Smith e...@trueblade.com added the comment: I think we're stuck with strftime for quite a while, no matter how ugly it is. datetime.__format__ uses it, for example. Although maybe it's possible to write an strftime-format to new-format translator. If we're going to take this on (re-writing strftime), I think the way to do it is to have it take the locale info as a parameter, and if that parameter is NULL then look up the info in the current locale. It looks like it's still a problem to find all of the info in the locale on all platforms, though. Finding the locale info is no doubt the tricky part, as someone said. I agree it would be easier to write this from scratch rather than track down the licensing on the existing patch. As it is, there's just not much code there. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3173 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10833] Replace %.100s by %s in PyErr_Format(): the arbitrary limit of 500 bytes is outdated
Eric Smith e...@trueblade.com added the comment: I always thought that one of the reasons for specifying the length was in case a pointer pointed to garbage: at least you'd be limiting how much trash was printed. But maybe that's just my imagination and there is no such reason. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10833 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10797] Wrong detection of lines in readlines() function
Eric Smith e...@trueblade.com added the comment: Either use mode 'U' or the io module if you want to match 3.x. $ python Python 2.6.5 (r265:79063, Jun 12 2010, 17:07:01) [GCC 4.3.4 20090804 (release) 1] on cygwin Type help, copyright, credits or license for more information. open('testFile').readlines() ['# bla\r#\r\t# bl\r\t#\r\t#\r#blaaa\t\r'] open('testFile', 'U').readlines() ['# bla\n', '#\n', '\t# bl\n', '\t#\n', '\t#\n', '#blaaa\t\n'] import io io.open('testFile').readlines() [u'# bla\n', u'#\n', u'\t# bl\n', u'\t#\n', u'\t#\n', u'#blaaa\t\n'] -- nosy: +eric.smith resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10797 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: [python-committers] [RELEASED] Python 3.2 beta 2
On 12/22/2010 8:46 AM, Georg Brandl wrote: Am 22.12.2010 02:15, schrieb Nick Coghlan: On Wed, Dec 22, 2010 at 6:18 AM, Georg Brandlge...@python.org wrote: Since PEP 3003, the Moratorium on Language Changes, is in effect, there are no changes in Python's syntax and built-in types in Python 3.2. Minor nit - we actually did tweak a few of the builtin types a bit (mostly the stuff to improve Sequence ABC conformance and to make range objects more list-like) Indeed, I'll fix this wording for the next announcement. (And I will mention SSL, sorry Antoine). If you're only going to mention some vague some builtins had minor changes, then I'm fine with that. If you're going to enumerate all such changes, that will be a bigger job. There were 2 such changes I'm aware of: str.format_map (#6081) and the addition of alternate (#) formatting to float, complex and decimal (#7094) __format__ methods. For this announcement I don't think it's necessary to list them all. -- http://mail.python.org/mailman/listinfo/python-list
[issue10715] uninformative error message
Changes by Eric Smith e...@trueblade.com: Removed file: http://bugs.python.org/file20126/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10715 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10715] uninformative error message
Eric Smith e...@trueblade.com added the comment: Because you're sending email as HTML, the message shows up both as plain text and as an attachment. It's the attachments that are being removed. If you could, please stop sending HTML email. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10715 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10715] uninformative error message
Eric Smith e...@trueblade.com added the comment: Here's a code snippet that shows the problem: import subprocess subprocess.Popen(['foo']) Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python2.5/subprocess.py, line 593, in __init__ errread, errwrite) File /usr/lib/python2.5/subprocess.py, line 1079, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10715 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10715] Command name missing from exception in subprocess.Popen
Changes by Eric Smith e...@trueblade.com: -- title: uninformative error message - Command name missing from exception in subprocess.Popen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10715 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10715] Command name missing from exception in subprocess.Popen
Changes by Eric Smith e...@trueblade.com: -- stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10715 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10715] Command name missing from exception in subprocess.Popen
Eric Smith e...@trueblade.com added the comment: This has already been fixed in 3.2: Python 3.2b2 (py3k:87413, Dec 21 2010, 07:09:13) [GCC 4.1.2 20070626 (Red Hat 4.1.2-13)] on linux2 Type help, copyright, credits or license for more information. import subprocess subprocess.Popen(['foo']) Traceback (most recent call last): File stdin, line 1, in module File /root/python/py3k/Lib/subprocess.py, line 708, in __init__ restore_signals, start_new_session) File /root/python/py3k/Lib/subprocess.py, line 1323, in _execute_child raise child_exception_type(errno_num, err_msg) OSError: [Errno 2] No such file or directory: 'foo' It looks like it was changed by Benjamin in r86595. Not sure why that wasn't backported. -- versions: -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10715 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10715] Command name missing from exception in subprocess.Popen
Eric Smith e...@trueblade.com added the comment: That change was just a tweak. The real change was in r86593. It references issue 4925, of which this is a duplicate. I'm closing this, if you want to follow the issue add yourself to 4925. -- resolution: - duplicate stage: needs patch - committed/rejected status: open - closed superseder: - Improve error message of subprocess when cannot open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10715 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10729] fwbackups python lib error
Eric Smith e...@trueblade.com added the comment: fwbackups is a third party package. See if you can submit a bug at http://www.diffingo.com/oss/fwbackups -- nosy: +eric.smith resolution: - invalid stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10729 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10715] uninformative error message
Eric Smith e...@trueblade.com added the comment: Operating systems also return this errno for many, many things unrelated to files. So while we might be able to fix this in some specific cases, in general it's not possible to add file names to all errors. Once we know your specific case we can see if it's fixable. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10715 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9232] Allow trailing comma in any function argument list.
Changes by Eric Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9232 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10669] Remove Deprecation Warnings
Eric Smith e...@trueblade.com added the comment: Are the warnings originating in your code, or in the standard library, or elsewhere? If in the standard library, please provide specific details. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10669 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10660] format() to lower and uppercase
Eric Smith e...@trueblade.com added the comment: I agree with David. Here's an example of using such a subclass. It extends the format string for strings to begin with an optional 'u' or 'l': --- class U(str): def __format__(self, fmt): if fmt[0] == 'u': s = self.upper() fmt = fmt[1:] elif fmt[0] == 'l': s = self.lower() fmt = fmt[1:] else: s = str(self) return s.__format__(fmt) name = 'Hervé Cauwelier' print('{0:u*^20} {0:l*^20} {0:*^20}'.format(U(name))) --- It produces: **HERVÉ CAUWELIER*** **hervé cauwelier*** **Hervé Cauwelier*** -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10660 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10661] ElementTree QName has a very uninformative repr()
Eric Smith e...@trueblade.com added the comment: This should be either: 'QName %r' % (self.text,) or: 'QName {!r}'.format(self.text) If self.text is a tuple (which granted is its own error), then the version checked in will raise an exception. -- nosy: +eric.smith resolution: fixed - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10661 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10516] Add list.clear() and list.copy()
Changes by Eric Smith e...@trueblade.com: Removed file: http://bugs.python.org/file19959/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10516 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10633] string.format() Unexpected output with numeric '#' prefix and 0 width
Eric Smith e...@trueblade.com added the comment: I disagree that your expected output is how it should behave. I believe it's more likely that the user wants the entire field width specified. In addition, compatibility with %-formatting would dictate that we keep the current behavior. '%#02x' % 10 '0xa' -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10633 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10621] 1 + 2j -- (1 + 2j) and not (1+2j)
Eric Smith e...@trueblade.com added the comment: I agree. It would be nice, but the impact on existing code is too large. I can easily imagine someone parsing the output of print(somecomplexnumber) and not considering spaces. For the record, it would require changing complex.__repr__ (which is also complex.__str__) and complex.__format__. Now that I look at the code, it seems that complex_format is only called from one place (complex_repr), with fixed parameters. It could be moved into complex_repr for what I think is a small improvement in readability. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10621 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10621] 1 + 2j -- (1 + 2j) and not (1+2j)
Eric Smith e...@trueblade.com added the comment: There are no tests or docs to fix: it's an internal (static) helper function. It's not a particularly straightforward change, because you're inserting a space into the middle of the floating point imaginary string. There would be extra bookkeeping and memory management going on. But even if it were easy, I disagree that it's worth breaking existing usages of complex.__str__, .__repr__, and .__format__. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10621 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10624] Move requires_IEEE_754 decorator from test_complex into test.support
New submission from Eric Smith e...@trueblade.com: The decorator could be shared in at least datetimetester, test_cmath, test_complex, test_decimal, test_fractions, test_long, and test_math. -- assignee: eric.smith components: Tests keywords: easy messages: 123346 nosy: eric.smith, mark.dickinson priority: low severity: normal status: open title: Move requires_IEEE_754 decorator from test_complex into test.support versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10624 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10625] There is no test for repr(complex(-0., 1.)) special handling
New submission from Eric Smith e...@trueblade.com: There's a special test in the C code for this, but there no test for it in test_complex. Note that this needs to be a IEEE 754 specific test. -- assignee: eric.smith components: Tests keywords: easy messages: 123348 nosy: eric.smith priority: normal severity: normal status: open title: There is no test for repr(complex(-0.,1.)) special handling versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10625 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10624] Move requires_IEEE_754 decorator from test_complex into test.support
Eric Smith e...@trueblade.com added the comment: Moved from test_math.py into support.py in r87040. I'll fix up the other modules shortly. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10624 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10625] There is no test for repr(complex(-0., 1.)) special handling
Eric Smith e...@trueblade.com added the comment: Technically the special handling in complex_repr() is for +0, but there needs to be a test both ways. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10625 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10624] Move requires_IEEE_754 decorator from test_complex into test.support
Eric Smith e...@trueblade.com added the comment: Modified all other tests to use support.requires_IEEE_754 in r87043. -- resolution: - accepted stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10624 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10625] There is no test for repr(complex(-0., 1.)) special handling
Eric Smith e...@trueblade.com added the comment: Checked-in in r87044. -- resolution: - accepted stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10625 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10621] 1 + 2j -- (1 + 2j) and not (1+2j)
Changes by Eric Smith e...@trueblade.com: Removed file: http://bugs.python.org/file19940/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10621 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10557] Malformed error message from float()
Eric Smith e...@trueblade.com added the comment: According to comments in the code and verified by inspection, PyOS_string_to_double does not accept any whitespace. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10557 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10557] Malformed error message from float()
Changes by Eric Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10557 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10563] Spurious newline in time.ctime
Eric Smith e...@trueblade.com added the comment: There's an error in time_ctime where it expects the length of the string to be fixed: if (p[24] == '\n') p[24] = '\0'; It doesn't count on the year having 5 digits. It should probably say (untested): l = len(p); if (l 0 p[l-1] == '\n') p[l-1] = '\0'; I'll whip up a patch and some tests. I'm not sure if the tests will work on platforms other than Linux. I'll see what I can find out about ctime and large values. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10563 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10563] Spurious newline in time.ctime
Eric Smith e...@trueblade.com added the comment: That should be strlen(), of course. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10563 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10563] Spurious newline in time.ctime
Eric Smith e...@trueblade.com added the comment: What platform are you running this on? My Fedora 32 bit system won't support a time_t that large. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10563 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10563] Spurious newline in time.ctime
Eric Smith e...@trueblade.com added the comment: Can you try this diff and see if it solves the problem: Index: Modules/timemodule.c === --- Modules/timemodule.c(revision 86848) +++ Modules/timemodule.c(working copy) @@ -639,6 +639,7 @@ PyObject *ot = NULL; time_t tt; char *p; +Py_ssize_t len; if (!PyArg_UnpackTuple(args, ctime, 0, 1, ot)) return NULL; @@ -657,8 +658,10 @@ PyErr_SetString(PyExc_ValueError, unconvertible time); return NULL; } -if (p[24] == '\n') -p[24] = '\0'; +len = strlen(p); +if (len 0 p[len-1] == '\n') +/* Remove the trailing newline, if present. */ +p[len-1] = '\0'; return PyUnicode_FromString(p); } -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10563 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10563] Spurious newline in time.ctime
Changes by Eric Smith e...@trueblade.com: -- components: +Extension Modules -Library (Lib) keywords: +easy, patch stage: - unit test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10563 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10542] Py_UNICODE_NEXT and other macros for surrogates
Eric Smith e...@trueblade.com added the comment: The idea is that the first part refers to what the macro returns (Py_UCS4) and the read part of the name refers to moving a pointer across an array (any array of integers). I thought the first part generally meant the type of the first parameter. Although I can go either way, especially if we add an underscore. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10542 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10539] Regular expression not checking 'range' element on 1st char in string.
Eric Smith e...@trueblade.com added the comment: I'm not sure I understand. The output I get is: f42e6be1-29bf-4f3c-ba58-1ae1d9ca5f88 g42e6be1-29bf-4f3c-ba58-1ae1d9ca5f88 False The first string matches. The second string matches because the leading g is being matched by \w. The third string does not match because the g in the second position is not matched by [0-9][a-f]. For the second string you're matching \w followed by 7 [0-9][a-f], just as the regex allows. Am I missing something? -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10521] str methods don't accept non-BMP fillchar on a narrow Unicode build
Eric Smith e...@trueblade.com added the comment: I think these macros would be a reasonable approach. I think str.center, etc. should support non-BMP chars, because to not do so can raise an exception. Supporting composed graphemes seems like another problem altogether. And while we could fix that, it's clearly a larger step. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10521 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10542] Py_UNICODE_NEXT and other macros for surrogates
Eric Smith e...@trueblade.com added the comment: In addition to the proposed Py_UNICODE_NEXT and Py_UNICODE_PUT_NEXT, str.__format__ would also need a function that tells it how many Py_UNICODEs are needed to store a given Py_UCS4. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10542 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10542] Py_UNICODE_NEXT and other macros for surrogates
Eric Smith e...@trueblade.com added the comment: I'd need access to this without having to build a PyUnicodeObject, for efficiency. But it sounds like it does have the basic functionality I need. For my use I'd really need it to take the result of Py_UNICODE_NEXT. Something like: Py_ssize_t Py_UNICODE_NUM_NEEDED(Py_UCS4 c) and it would always return 1 or 2. Always 1 for a wide build, and for a narrow build 1 if c is in the BMP else 2. Choose a better name, of course. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10542 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10542] Py_UNICODE_NEXT and other macros for surrogates
Eric Smith e...@trueblade.com added the comment: The code will basically be: Py_UCS4 fill; parse_format_string(fmt, ..., fill, ...); /* lots more code */ if (fill_needed) { /* compute how many characters to reserve */ space_needed = Py_UNICODE_NUM_NEEDED(fill) * number_of_characters_to_fill; } It would be most convenient (and require the fewest changes) if the computation could just use fill, instead of remembering the pointers to the beginning and end of fill. Py_UNICODE_CODEPOINT_COUNT could be implemented with a primitive that does what I want. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10542 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10542] Py_UNICODE_NEXT and other macros for surrogates
Eric Smith e...@trueblade.com added the comment: The compiler's decision to inline something should not be related to its ability to put variables in a register. But I definitely agree that we should get the abstraction right first and worry about the implementation later. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10542 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10528] argparse uses %s in gettext calls
Changes by Eric Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10528 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7094] Add alternate float formatting styles to new-style formatting.
Eric Smith e...@trueblade.com added the comment: Checked in r86751. I'm leaving this open until I fix the remaining issue with '#g' for Decimal. -- components: +Library (Lib) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7094 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10524] Patch to add Pardus to supported dists in platform
Eric Smith e...@trueblade.com added the comment: The patch name has 2.7 in it, although Versions says 3.2. As this is a feature request, it can't be added to 2.7. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10524 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10533] defaultdict constructor with a concrete value
Eric Smith e...@trueblade.com added the comment: -1 from me. You can't use keywords, and if you make the value callable at a later date then suddenly you'll change the behavior of seemingly unrelated code. Is a lambda so bad? -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10533 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10533] defaultdict constructor with a concrete value
Eric Smith e...@trueblade.com added the comment: How about: from collections import defaultdict class defaultdict_value(defaultdict): def __init__(self, value): defaultdict.__init__(self, lambda : value) x = defaultdict_value(3) print(x[1]) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10533 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10521] str methods don't accept non-BMP fillchar on a narrow Unicode build
Eric Smith e...@trueblade.com added the comment: str.__format__ and friends (int, float, complex) also have this same problem. For example, when they're computing the fill character: format('', 'x^') '' format('', '\U00100140^') Traceback (most recent call last): File stdin, line 1, in module ValueError: Invalid conversion specification -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10521 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7094] Add alternate float formatting styles to new-style formatting.
Changes by Eric Smith e...@trueblade.com: -- stage: unit test needed - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7094 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10516] Add list.clear()
Eric Smith e...@trueblade.com added the comment: Guido's email is archived at: http://mail.python.org/pipermail/python-ideas/2010-November/008732.html -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10516 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com