[issue21979] SyntaxError not raised on 0xaor 1

2014-07-14 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- stage: - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21979 ___ ___ Python-bugs-list

[issue21979] SyntaxError not raised on 0xaor 1

2014-07-14 Thread Eric V. Smith
Eric V. Smith added the comment: To be more clear: the parser takes the longest token that could be valid. Since n can't be part of a hex number, parsing stops there, returning 0xaa as the first token. So: 0xaaif 1 else 0 170 hex(0xaaif 1 else 0) '0xaa

[issue21981] Idle problem

2014-07-14 Thread Eric V. Smith
Eric V. Smith added the comment: Please respond to the other bug. No need to open a new bug when responding to an existing issue. Thanks. -- nosy: +eric.smith resolution: - not a bug stage: - resolved status: open - closed ___ Python tracker rep

[issue21990] saxutils defines an inner class where a normal one would do

2014-07-23 Thread Eric V. Smith
Eric V. Smith added the comment: Looks fine to me. Normally I'd define the class being returned before the function returning it, but it doesn't really make a difference. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http

[issue22090] Decimal and float formatting treat '%' differently for infinities and nans.

2014-07-27 Thread Eric V. Smith
Eric V. Smith added the comment: I agree that Decimal is wrong here. PEP 3101 says the result should include the trailing '%'. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22090

[issue22222] dtoa.c: remove custom memory allocator

2014-08-17 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2 ___ ___ Python-bugs-list

[issue22385] Allow 'x' and 'X' to accept bytes-like objects in string formatting

2014-09-11 Thread Eric V. Smith
Eric V. Smith added the comment: I think this would need to be implemented by adding bytes.__format__. I can't think of a way to make it work on bytes-like objects in general. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue22385] Allow 'x' and 'X' to accept bytes-like objects in string formatting

2014-09-11 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not particularly wild about the .precision syntax either, but I think the feature is generally useful. Adding bytes.__format__ is exactly what special output for bytes _is_, as far as format() is concerned. Another option would be to invent a new format

[issue22387] Making tempfile.NamedTemporaryFile a class

2014-09-11 Thread Eric V. Smith
Eric V. Smith added the comment: Can you explain why you want to subclass them? -- nosy: +eric.smith type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22387

[issue22418] ipaddress.py new IPv6 Method for Solicited Multicast Address

2014-09-16 Thread Eric V. Smith
Eric V. Smith added the comment: Changing to 3.5 only, as this is an API addition so it can only be added there. I think that raising an exception instead of retuning None for a multicast address would be a better API. Any chance you can write some tests? Thanks! -- nosy

[issue22466] problem with installing python 2.7.8

2014-09-22 Thread Eric V. Smith
Eric V. Smith added the comment: Where did you download the installer from? How are you running the installer? -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22466

[issue22515] Implement partial order on Counter

2014-10-01 Thread Eric V. Smith
Eric V. Smith added the comment: Is there some particular problem you're trying to solve, which this would make easier? Without a use case, I'm -1. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22515

[issue22532] A suggested change

2014-10-01 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- resolution: - not a bug stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22532

[issue22515] Implement partial order on Counter

2014-10-01 Thread Eric V. Smith
Eric V. Smith added the comment: No need to explain it. It sounds like it's not generally useful, so I'm still -1. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22515

[issue22545] incomplete complex repr() with negative zeroes

2014-10-03 Thread Eric V. Smith
Eric V. Smith added the comment: Where are you seeing this? On an Ubuntu 13.10 x86 box, I see: complex(-0.0) (-0+0j) This is with 2.7.5+, 3.3.2+ (from Ubuntu distro), and with 3.5.0a0 and 3.4.2rc1+ built locally. -- ___ Python tracker rep

[issue22545] incomplete complex repr() with negative zeroes

2014-10-03 Thread Eric V. Smith
Eric V. Smith added the comment: No problem! For completeness, I also see the correct behavior on cygwin 32-bit 2.7.3 and 3.2.3. I don't have access to a straight Windows version. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue22546] Wrong default precision in documentation for format

2014-10-03 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith, mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22546

[issue22546] Wrong default precision in documentation for format

2014-10-03 Thread Eric V. Smith
Eric V. Smith added the comment: I think this is a result of changing the precision of str() to match repr(). 2.7 prints: '3.14159265359' -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22546

[issue22556] datetime comparison with 'None' returning a TypeError

2014-10-05 Thread Eric V. Smith
Eric V. Smith added the comment: You've identified the main problem: would None go first or last? Modify your key function to make the decision appropriate for you, returning either a very small or very large value for None, as appropriate. If you really want to see this behavior changed, you

[issue22557] Local import is too slow

2014-10-05 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22557 ___ ___ Python-bugs-list

[issue22562] Singleton pattern for namedtuple

2014-10-06 Thread Eric V. Smith
Eric V. Smith added the comment: You might want to check out https://bitbucket.org/ctismer/namelesstuple, which uses a similar approach. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22562

[issue22597] printf-style formatting allows mixing keyed and keyless specifiers

2014-10-10 Thread Eric V. Smith
Eric V. Smith added the comment: This is a duplicate of issue 1467929. -- nosy: +eric.smith resolution: - duplicate stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22597

[issue22957] Multi-index Containers Library

2014-11-27 Thread Eric V. Smith
Eric V. Smith added the comment: You should discuss this on the python-ideas mailing list. Then if there's traction there, we'll re-open this issue. Please reference this issue number when starting the discussion on python-ideas so we can find it later. -- nosy: +eric.smith status

[issue22973] hash() function gives the same result for -1 and for -2 argument (==-2)

2014-12-01 Thread Eric V. Smith
Eric V. Smith added the comment: hash() is not defined to be unique, so you're always going to have collisions. The behavior of hash() for int that you're seeing is not a bug. There's some background here: http://stackoverflow.com/questions/10130454/why-do-1-and-2-both-hash-to-2-in-python

[issue23083] sys.exit with bool parameter

2014-12-18 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not sure this should be documented. It follows from int and bool equivalence. Plus, I consider it an anti-pattern. We don't want to document everywhere you can pass a bool where an int is called for. That's thousands of places. -- nosy

[issue23083] sys.exit with bool parameter

2014-12-18 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- stage: - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23083 ___ ___ Python-bugs-list

[issue23141] Command line long filename not passed correctly

2014-12-31 Thread Eric V. Smith
Eric V. Smith added the comment: This works fine for me, too, using the Windows version of 3.4.2 downloaded from python.org. 2 questions: - where did you download Python? - which shell are you using? -- nosy: +eric.smith ___ Python tracker rep

[issue23141] Command line long filename not passed correctly

2014-12-31 Thread Eric V. Smith
Eric V. Smith added the comment: I'm glad you found it! -- resolution: fixed - not a bug stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23141

[issue23323] Issue with imaplib and append messages passing a tuple with flags

2015-01-26 Thread Eric V. Smith
Eric V. Smith added the comment: flags is supposed to be a string. This is not well documented, like much of the module. Try: flags = r'(\Answered \Seen)' -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue23386] snmp - mib error

2015-02-03 Thread Eric V. Smith
Eric V. Smith added the comment: pysnmp is not part of the Python standard library. It looks like you should report issues or search for help at at pysnmp.sourceforge.net. -- components: -Build nosy: +eric.smith resolution: - third party stage: - resolved status: open - closed type

[issue23386] snmp - mib error

2015-02-03 Thread Eric V. Smith
Eric V. Smith added the comment: Your question is not appropriate here, and you're unlikely to get an answer. This tracker is for bugs in python and its standard library. It is not for asking for help with third party packages. See my other comment for a pointer to an appropriate venue

[issue23389] pkgutil.find_loader raises an ImportError on PEP 420 implicit namespace packages

2015-02-03 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23389 ___ ___ Python-bugs-list

[issue23281] Access violation - pyc file

2015-01-20 Thread Eric V. Smith
Eric V. Smith added the comment: Was this file generated by CPython from a .py file? If so, can you share the .py file? If not, how was this file generated? As eryksun says, it appears to not be a valid .pyc file. -- nosy: +eric.smith ___ Python

[issue23294] A typo in the tutorial

2015-01-21 Thread Eric V. Smith
Eric V. Smith added the comment: What's the typo? I'm not seeing it. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23294

[issue23271] Unicode HOWTO documentation error

2015-01-19 Thread Eric V. Smith
Eric V. Smith added the comment: The example is correct. If you type it into a python interpreter, you get the results as shown in the example. The .replace() method does not modify the string s. It returns the new value. In the example, the new value is displayed, but is not assigned back

[issue23294] A typo in the tutorial

2015-01-22 Thread Eric V. Smith
Eric V. Smith added the comment: No problem! Thanks for looking at the documentation with an inquisitive eye. -- stage: - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23294

[issue23479] str.format() breaks object duck typing

2015-02-18 Thread Eric V. Smith
Eric V. Smith added the comment: As David says, the change from: ValueError: Unknown format code 'f' for object of type 'str' to: TypeError: non-empty format string passed to object.__format__ is quite intentional. Let me address the differences between %-formatting and __format__-based

[issue23479] str.format() breaks object duck typing

2015-02-18 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- resolution: - not a bug status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23479

[issue23473] Allow namedtuple to be JSON encoded as dict

2015-02-18 Thread Eric V. Smith
Eric V. Smith added the comment: Can you post a code snippet that used to work, but now does not? -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23473

[issue23193] Please support numeric_owner in tarfile

2015-01-28 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- stage: test needed - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23193

[issue23340] armv7l C++ exceptions issue

2015-01-28 Thread Eric V. Smith
Eric V. Smith added the comment: I agree with David that this isn't the right venue. That said, the likely problem is that Python's main() is written in C, not C++, so some needed runtime support for exceptions is not getting initialized. -- nosy: +eric.smith resolution: - not a bug

[issue18644] Got ResourceWarning: unclosed file when using test function from formatter module

2015-01-05 Thread Eric V. Smith
Eric V. Smith added the comment: Good point on contextlib.closing not being needed. I usually use this pattern on things that aren't files! On second thought, the with statement will close sys.stdin, so this isn't a valid pattern here. Sorry for the noise

[issue18644] Got ResourceWarning: unclosed file when using test function from formatter module

2015-01-05 Thread Eric V. Smith
Eric V. Smith added the comment: Not that I think it's worth changing for this case, but I find code like this better written as: if some_test: fl = contextlib.closing(open(sys.argv[1])) else: fl = sys.stdin with fl as fl: do_stuff(fl) This way you don't need another test

[issue23193] Please support numeric_owner in tarfile

2015-01-12 Thread Eric V. Smith
Eric V. Smith added the comment: I think Michael is asking if the proposed change would ever be accepted. If the answer is no, not even if you write the tests and update the documentation, then there's no sense putting the work into this. That seems like a reasonable question to me. I think

[issue23193] Please support numeric_owner in tarfile

2015-01-13 Thread Eric V. Smith
Eric V. Smith added the comment: Ignore my review comment on pwd and grp being None. I see that there is a test for it (at least grp), and they're not available on Windows. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue23193] Please support numeric_owner in tarfile

2015-01-13 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- assignee: - eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23193 ___ ___ Python-bugs

[issue23193] Please support numeric_owner in tarfile

2015-01-13 Thread Eric V. Smith
Eric V. Smith added the comment: I don't think we want to encourage the type of coupling that arises from subclassing, especially when when overriding an undocumented method. I'm +1 on the change. I'll review the patch. Michael: can you write the tests, and hopefully docs? -- stage

[issue23624] str.center inconsistent with format ^

2015-03-18 Thread Eric V. Smith
Eric V. Smith added the comment: I agree with David: It's unfortunate, but too late to change. FWIW, since the goal is to replace just str.center, I'd write this as: def my_center(s, width): return format(s, '^' + str(width)) As soon as you're mixing in other formatting, then str.center

[issue23727] rfc2231 line continuations result in an additional newline

2015-03-20 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- components: +email -Windows nosy: +barry, r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23727

[issue23624] str.center inconsistent with format ^

2015-03-10 Thread Eric V. Smith
Eric V. Smith added the comment: I agree it would be nice to be consistent, and that str.__format__'s approach is likely the desirable one. But is it worth the breakage? Surely someone cares about the current behavior. Does this cause any practical, real-world problem

[issue23602] Implement __format__ for Fraction

2015-03-08 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not sure it needs fixing: it follows from the definition of using Decimal(num) / Decimal(denom). Plus, it's controllable with a decimal context: from decimal import localcontext with localcontext() as ctx: ... ctx.prec = 100 ... format(F(1, 3), '.30f

[issue23627] Incorrect string formatting of float values in Python 2.7

2015-03-10 Thread Eric V. Smith
Eric V. Smith added the comment: By using %s, you're asking the formatting code to first convert the parameter to a string. Then, by using .10, you're asking it to truncate the value. It's essentially equivalent to: str(-7.7176718e-05) '-7.7176718e-05' str(-7.7176718e-05)[:10] '-7.7176718

[issue23624] str.center inconsistent with format ^

2015-03-10 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23624 ___ ___ Python-bugs-list

[issue23779] imaplib authenticate raises TypeError if authenticator tries to abort

2015-03-25 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- stage: - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23779 ___ ___ Python-bugs-list

[issue23779] imaplib authenticate raises TypeError if authenticator tries to abort

2015-03-25 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23779 ___ ___ Python-bugs-list

[issue23535] os.path.join() wrong concatenation of C: on Windows

2015-02-27 Thread Eric V. Smith
Eric V. Smith added the comment: I agree this isn't a bug, due to per-drive current directories on Windows. -- nosy: +eric.smith resolution: - not a bug stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http

[issue23193] Please support numeric_owner in tarfile

2015-04-13 Thread Eric V. Smith
Eric V. Smith added the comment: I added numeric_owner to the self.chown() call when adding directories. I'm reasonably sure this is correct. I added tests for dirs, although they need some cleaning up to be simpler and cleaner. I'll do that cleanup shortly, but I want to check this in before

[issue23193] Please support numeric_owner in tarfile

2015-04-13 Thread Eric V. Smith
Eric V. Smith added the comment: Other than Misc/NEWS, I think this is the final version of this patch. -- Added file: http://bugs.python.org/file38981/tarfile-numeric-owner-with-tests-3.diff ___ Python tracker rep...@bugs.python.org http

[issue24019] str/unicode encoding kwarg causes exceptions

2015-04-21 Thread Eric V. Smith
Eric V. Smith added the comment: As this is an enhancement request, I've changed the versions. I'm opposed to this change. If I pass an encoding along with a type for which it makes no sense, I'd prefer an error instead of silently ignoring the encoding. I think your helper function

[issue24019] str/unicode encoding kwarg causes exceptions

2015-04-21 Thread Eric V. Smith
Eric V. Smith added the comment: I agree with deprecating (in the documentation) but never removing the encoding argument to str() in Python 3. .decode() is the better way to convert a bytes-like object to a str. Every change proposed here would be an enhancement in 2.7, and we

[issue24106] Messed up indentation makes undesired piece of code being run!

2015-05-01 Thread Eric V. Smith
Eric V. Smith added the comment: I think David meant the else clause on a for statement: https://docs.python.org/2/reference/compound_stmts.html#the-for-statement -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue24192] unexpected system error with pep420 style namespace packages

2015-05-14 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24192 ___ ___ Python-bugs-list

[issue23193] Please support numeric_owner in tarfile

2015-04-14 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for your review, Berker. I've updated the code with most of your suggestions, although some of them were mooted by some restructuring I did. A couple of questions/issues: - I'm not sure where we stand on keyword-only arguments. I certainly agree

[issue23193] Please support numeric_owner in tarfile

2015-04-15 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks everyone for their help, especially Michael for the original patch. -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue23929] Minor typo (way vs. away) in os.renames docstring

2015-04-13 Thread Eric V. Smith
Eric V. Smith added the comment: I think removing the word way would be a better improvement. -- nosy: +eric.smith versions: -Python 3.2, Python 3.3, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23929

[issue23929] Minor typo (way vs. away) in os.renames docstring

2015-04-13 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- keywords: +easy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23929 ___ ___ Python-bugs-list

[issue23923] Integer operations (// or %) on negative numbers product wrong results.

2015-04-12 Thread Eric V. Smith
Eric V. Smith added the comment: This is the expected behavior: https://docs.python.org/2/faq/programming.html#why-does-22-10-return-3 -- nosy: +eric.smith resolution: - not a bug stage: - resolved status: open - closed ___ Python tracker rep

[issue23193] Please support numeric_owner in tarfile

2015-04-13 Thread Eric V. Smith
Eric V. Smith added the comment: Updated patch with a few minor doc tweaks. The one substantive change I did make was to add numeric_owner to the call to self.chown() when setting directory owners. I believe this is correct, but I need to convince myself and to write a test. -- Added

[issue23193] Please support numeric_owner in tarfile

2015-04-13 Thread Eric V. Smith
Eric V. Smith added the comment: Note that this change will break code that subclasses TarFile and overrides chown(), as suggested in msg233915. I'm not too concerned about that, since chown() is not documented. Ideally it would be renamed to _chown(), but that's probably a separate issue

[issue23910] C implementation of namedtuple (WIP)

2015-04-10 Thread Eric V. Smith
Eric V. Smith added the comment: What's the motivating use case for this? -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23910

[issue23910] C implementation of namedtuple (WIP)

2015-04-10 Thread Eric V. Smith
Eric V. Smith added the comment: Have you thought of just exposing Object/structseq.c? Before you put much time into this, I'd get Raymond's acceptance of whatever approach you want to take. It might be best to raise it on python-ideas

[issue23910] C implementation of namedtuple (WIP)

2015-04-10 Thread Eric V. Smith
Eric V. Smith added the comment: I haven't seen thought it through, just that it seems very similar to a C namedtuple. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23910

[issue23893] Forward-port future_builtins

2015-04-08 Thread Eric V. Smith
Eric V. Smith added the comment: Looks good to me. I realize it's trivial, but is it worth putting this on PyPI for older 3.x's? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23893

[issue16991] Add OrderedDict written in C

2015-04-08 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16991 ___ ___ Python-bugs-list

[issue23893] Forward-port future_builtins

2015-04-09 Thread Eric V. Smith
Eric V. Smith added the comment: I think Serhiy is saying that you don't need to implement future_builtins in 3.x, if your 2.7 and 3.x compatible code catches the ImportError. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue24387] json.loads should be idempotent when the argument is a dictionary

2015-06-05 Thread Eric V. Smith
Eric V. Smith added the comment: What are the use cases where json.loads would be called on the return from json.loads? It seems to me a better design would be to wrap such calls with a test, instead of having json.loads do this test. Hiding it in json.loads would mask other programming

[issue24372] Documentation for ssl.wrap_socket's ssl_version parameter is odd

2015-06-03 Thread Eric V. Smith
Eric V. Smith added the comment: I have a requirement to support 2.7.5, so SSLContext is currently a problem for me. I realize that 2.7 could at best get a documentation change. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue24417] Type-specific documentation for __format__ methods

2015-06-09 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24417 ___ ___ Python-bugs-list

[issue24507] CRLF issues

2015-06-25 Thread Eric V. Smith
Eric V. Smith added the comment: At least for the files in decimaltestdata, I'd be wary about changing them. My understanding is that these files are from the IBM decimal test library. I don't think we should stray from upstream here, even for something as simple as line endings

[issue24428] Import sys,getopt is having issue while taking inputs

2015-06-10 Thread Eric V. Smith
Eric V. Smith added the comment: This is not a problem with python, but rather with how bash interprets your program arguments. Try putting the arguments in single quotes, like: python validate_json_adj.py -i '$#@%' -- nosy: +eric.smith resolution: - not a bug stage: - resolved

[issue24454] Improve the usability of the match object named group API

2015-06-15 Thread Eric V. Smith
Eric V. Smith added the comment: I'd definitely be for mo['col']. I can't say I've ever used len(mo.groups()). I do have lots of code like: return mo.group('col'), mo.group('row'), mo.group('foo') Using groupdict there is doable but not great. But: return mo['col'], mo['row'], mo['foo'] would

[issue24323] Typo in Mutable Sequence Types documentation.

2015-05-29 Thread Eric V. Smith
Eric V. Smith added the comment: It's trying to say that i is optional, as stated in the footnote. I agree it would be better written as s.pop(i), since square brackets are otherwise used in that section as indexing operators. But the footnote should stay, explaining what happens if you omit

[issue24323] Typo in Mutable Sequence Types documentation.

2015-05-29 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- versions: -Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24323

[issue24323] Typo in Mutable Sequence Types documentation.

2015-05-29 Thread Eric V. Smith
Eric V. Smith added the comment: s.pop(i=-1) doesn't actually work, but I guess it gets the point across. For 2.7 it's even more confusing, since it includes: s.index(x[, i[, j]]) and s.sort([cmp[, key[, reverse]]]) I'd suggest not changing the 2.7 docs

[issue24323] Typo in Mutable Sequence Types documentation.

2015-05-31 Thread Eric V. Smith
Eric V. Smith added the comment: I don't feel particularly strongly about it. It's mildly more confusing in the 3.x docs than 2.7 because it's the only use in that section of an optional argument. I disagree that s.pop(i) is wrong, since it agrees with the Results column. But I agree it's

[issue24312] miniDOM._write_data() give a vague error message when the argument isn't of type str

2015-05-28 Thread Eric V. Smith
Eric V. Smith added the comment: As a rule, we don't put in checks like this. There are an untold number of places where such checks could be added. I suspect the new typing module will be a better way to catch these types of errors. Does the problem not occur with 3.5? -- nosy

[issue24574] ANSI escape sequences breaking string justification

2015-07-06 Thread Eric V. Smith
Eric V. Smith added the comment: strings are unaware of any ANSI escape sequences or other structure that is being ascribed to their contents. The '\033' escape character is being counted, as are the rest of the characters in that string. Since the string is already at least 10 characters

[issue24549] string.format() should have a safe_substitute equivalent, to be run consecutively

2015-07-01 Thread Eric V. Smith
Eric V. Smith added the comment: So let's say your function would be named safe_format. Then: {1} {0}.safe_format('one') would give: {1} one. Then: {1} one.safe_format('two') would be an error, because there's no index 1 in the args tuple. I can't imagine how you'd implement this function

[issue24281] String formatting: incorrect number of decimal places

2015-05-25 Thread Eric V. Smith
Eric V. Smith added the comment: Just to clarify: If not specified, the default presentation type for floats is g. Since you didn't specify f in your example, it's using g. For presentation type g, the precision (3 in your case) is the total number of significant digits. So 12.34 first

[issue24281] String formatting: incorrect number of decimal places

2015-05-26 Thread Eric V. Smith
Eric V. Smith added the comment: And I just double checked: the entirety of the sentence you quoted is: The precision is a decimal number indicating how many digits should be displayed after the decimal point for a floating point value formatted with 'f' and 'F', or before and after

[issue24779] Python/ast.c: decode_unicode is never called with rawmode=True

2015-08-02 Thread Eric V. Smith
New submission from Eric V. Smith: The only call to decode_unicode is this: if (!*bytesmode !rawmode) { return decode_unicode(c, s, len, rawmode, c-c_encoding); } So rawmode will always be 0. Removing this will delete a call to PyUnicode_DecodeRawUnicodeEscape in decode_unicode

[issue24779] Python/ast.c: decode_unicode is never called with rawmode=True

2015-08-02 Thread Eric V. Smith
Eric V. Smith added the comment: That's poor wording on my part: the call to PyUnicode_DecodeRawUnicodeEscape isn't actually execute if rawmode is false. So it's really just a dead branch that's being deleted. -- ___ Python tracker rep

[issue24802] PyFloat_FromString Buffer Over-read

2015-08-06 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24802 ___ ___ Python-bugs-list

[issue24803] PyNumber_Long Buffer Over-read.patch

2015-08-06 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24803 ___ ___ Python-bugs-list

[issue24690] find_executable should expand ~

2015-07-23 Thread Eric V. Smith
Eric V. Smith added the comment: You can use os.path.expanduser(). In general we leave decisions such as expanding user names and environment variables up to the caller, and we don't build them in to each function. Although I'm not sure why you'd want to pass a full path name

[issue24661] CGIHTTPServer: premature unescaping of query string

2015-07-18 Thread Eric V. Smith
Eric V. Smith added the comment: I would expect the cgi script to receive the unescaped values. Can you point to some reference that says otherwise? -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24661

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Eric V. Smith
Eric V. Smith added the comment: Saksham: Also, it would be best to take this discussion of how to produce a patch to the python-committers mailing list: https://mail.python.org/mailman/listinfo/python-committers -- ___ Python tracker <

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Eric V. Smith
Eric V. Smith added the comment: Saksham: First we need our "experts" to decide what, if any, change is needed. If we decide that a change is needed, at that point we'd look at a patch. -- ___ Python tracker <rep...@bugs.pyth

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Eric V. Smith
Eric V. Smith added the comment: > Berker Peksag added the comment: > >> Also, it would be best to take this discussion of how to produce a patch to >> the python-committers mailing list: > > or the core-mentorship list: > https://mail.python.org/mailman/listin

[issue25154] Drop the pyvenv script

2015-10-26 Thread Eric V. Smith
Eric V. Smith added the comment: There's a typo here in 'executable': + '`{} -m venv`'.format(exeutable), file=sys.stderr) And this could now be: print('WARNING: the pyenv script is deprecated in favour of ' f'`{executable} -m venv`', file=sys.stderr) ! And since

<    1   2   3   4   5   6   7   8   9   10   >