Serhiy Storchaka added the comment:
I agree with Josh's arguments. Similar idea was already proposed and rejected
(issue17338).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21507
___
Serhiy Storchaka added the comment:
Currently json.load/loads don't support binary input. See issue17909 and
issue19837.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21509
___
STINNER Victor added the comment:
I think the argument against using PyObject_LengthHint for the general
iterable case is that for inputs other than sets or dicts, the assumption is
that significant deduplication will occur.
Oh... I'm dumb :) Sorry.
Another option for frozenset only: we may
STINNER Victor added the comment:
After more thought, I think this should remain in tools as a demo.
I disagree, I like the command line interface. It's very useful on Windows for
example. It's also useful on UNIX embedded devices where Python is installed,
but only a few UNIX tools.
If you
Changes by STINNER Victor victor.stin...@gmail.com:
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19837
___
___
Python-bugs-list
Changes by STINNER Victor victor.stin...@gmail.com:
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17909
___
___
Python-bugs-list
Serhiy Storchaka added the comment:
This issue was mainly resolved in issue12892. The surrogatepass error handler
now works with UTF-16* and UTF-32* encodings. But for other encodings it
behaves as for UTF-8 (preserve old behavior). Should we change the behavior for
non-UTF encodings end
Peter Kruse added the comment:
Fascinating, you are right, very good, thanks for your time and looking into
this.
Peter
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19186
___
Serhiy Storchaka added the comment:
Alternative solution is to force UTF-8 in IDLE console. But I think this will
be more surprising, especially for Windows users.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15809
Serhiy Storchaka added the comment:
Here is a patch which disallows the surrogatepass handler for non-utf
encodings. Please test it on Windows.
--
type: behavior - enhancement
versions: +Python 3.5 -Python 3.1, Python 3.2, Python 3.3
___
Python
STINNER Victor added the comment:
Serhiy Storchaka wrote:
Here is a patch
I don't see your patch.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13916
___
Serhiy Storchaka added the comment:
Oh, sorry.
--
keywords: +patch
Added file: http://bugs.python.org/file35257/surrogatepass_non_utf.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13916
Martin v. Löwis added the comment:
LGTM
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13916
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Mark Dickinson dicki...@gmail.com:
--
nosy: +mark.dickinson, skrah
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21510
___
___
Mark Dickinson added the comment:
I wouldn't want to drop the simple example: I suspect that many of those
looking at fma won't have the first idea what it does, and that first example
shows clearly that it's a fused multiply-add.
But +1 for an example that demonstrates the single rounding,
Roundup Robot added the comment:
New changeset 5e98a50e0f55 by Serhiy Storchaka in branch 'default':
Issue #13916: Disallowed the surrogatepass error handler for non UTF-*
http://hg.python.org/cpython/rev/5e98a50e0f55
--
nosy: +python-dev
___
Python
Jayanth Koushik added the comment:
@Mark: I agree. And perhaps it is also worth mentioning (on an unrelated note),
that the decimal fma is not based on the internal cmath fma (it could not be)
and unlike the cmath fma, it is no faster than an unfused multiply-add.
--
Changes by Serhiy Storchaka storch...@gmail.com:
--
assignee: - serhiy.storchaka
resolution: - fixed
stage: - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13916
Serhiy Storchaka added the comment:
All dependencies for this issue are resolved now.
Here is updated patch, synchronized with tip.
--
Added file: http://bugs.python.org/file35258/json_detect_encoding_2.patch
___
Python tracker
Antoine Pitrou added the comment:
I find logical operations on negative numbers confusing in Python, so I'd
rather stick with the first implementation.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21487
Changes by Serhiy Storchaka storch...@gmail.com:
Removed file: http://bugs.python.org/file30133/json_detect_encoding.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17909
___
Serhiy Storchaka added the comment:
What I want to say, the patch LGTM, but after committing issue14373 we should
simplify the code by using functools.lru_cache().
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21486
Antoine Pitrou added the comment:
Actually, using lru_cache(maxsize=None) would enable a simple infinite cache
like in the patch. But it's not like a lot of code would be saved.
--
___
Python tracker rep...@bugs.python.org
STINNER Victor added the comment:
It makes sense to restrict surrogatepass to UTF-* encodings. UTF-8, UTF-16 and
UTF-32 encoders reject surrogate characters, but not UTF-7. Is it a bug? I'm
asking because PyCodec_SurrogatePassErrors() doesn't support UTF-7.
IMO your change is important enough
STINNER Victor added the comment:
Windows buildbots are unhappy.
http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/8355/steps/test/logs/stdio
==
ERROR: test_surrogatepass_handler
Serhiy Storchaka added the comment:
Here is a patch, which adds support for cp65001 and fixes test_cp1252. Please
test it on Windows Vista.
Lone surrogates are not illegal in UTF-7 (see RFC 1642), so error handler is
not called and explicit support of UTF-7 is not needed.
Could you please
Steve added the comment:
I would prefer the function to return bool. But what I prefer is irrelevant,
what counts is accuracy and clarity. And to this end, the return type and the
comment have to match.
For a int return value, the document should mention a condition relative to an
integer
STINNER Victor added the comment:
Here is a patch, which adds support for cp65001
The name of the encoding is cp65001, not something like cp-utf8.
And there is no alias like cp_65001, there is only cp65001.
--
___
Python tracker
Chris Rebert added the comment:
You'll need to also update the Character Encodings subsection of the json
docs.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17909
___
Serhiy Storchaka added the comment:
But an exception reports about CP_UTF8.
--
title: disallow the surrogatepass handler for non utf-* encodings -
disallow the surrogatepass handler for non utf-* encodings
___
Python tracker rep...@bugs.python.org
New submission from Paul Sokolovsky:
Lib/quopri.py for version 3.3..3.5-tip contains following code:
ESCAPE = b'='
...
line = input.readline()
if not line: break
i, n = 0, len(line)
if n 0 and line[n-1:n] == b'\n':
...
elif i+1 n and line[i+1] ==
New submission from Ryder Lewis:
I'm not sure if this is a bug or expected behavior, but basically what I want
to do is log the timestamp when an application exits. Sample script to
illustrate the issue:
try.py
import time
class A():
def __init__(self):
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +benjamin.peterson, pitrou
resolution: - not a bug
status: open - pending
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21512
___
Antoine Pitrou added the comment:
Well, let's call it a limitation rather than a bug.
When creating a global variable (such as a in your example), that variable is
kept alive at least as long as the module containing it. However, modules
usually live until very late in the interpreter shutdown
Changes by Antoine Pitrou pit...@free.fr:
--
resolution: not a bug - wont fix
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21512
___
Roundup Robot added the comment:
New changeset 2158614e1607 by Antoine Pitrou in branch 'default':
Issue #21486: Optimize parsing of netmasks in ipaddress.IPv4Network and
ipaddress.IPv6Network.
http://hg.python.org/cpython/rev/2158614e1607
--
nosy: +python-dev
Roundup Robot added the comment:
New changeset 2711677cf874 by Antoine Pitrou in branch 'default':
Issue #21487: Optimize ipaddress.summarize_address_range() and
ipaddress.{IPv4Network,IPv6Network}.subnets().
http://hg.python.org/cpython/rev/2711677cf874
--
nosy: +python-dev
Terry J. Reedy added the comment:
Idle 3.x has Martin's patch, except that the 'if' clause is merely commented
out rather than removed. (Perhaps someone wanted to test the removal first. It
should now be deleted.)
My 2.7 Idle has Default Source Encoding ... [x] None. Since there is nothing
Roundup Robot added the comment:
New changeset 8867874a2b7d by Antoine Pitrou in branch 'default':
Issue #20826: Optimize ipaddress.collapse_addresses().
http://hg.python.org/cpython/rev/8867874a2b7d
--
nosy: +python-dev
___
Python tracker
Antoine Pitrou added the comment:
I've now committed this. exhuma, if you have any further observations or
results, don't hesitate to post them!
--
resolution: - fixed
stage: patch review - commit review
status: open - closed
___
Python tracker
Changes by Antoine Pitrou pit...@free.fr:
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21487
___
Changes by Antoine Pitrou pit...@free.fr:
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21486
___
Changes by Martin v. Löwis mar...@v.loewis.de:
--
nosy: -loewis
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15809
___
___
Python-bugs-list
Roundup Robot added the comment:
New changeset 4621bb82ceec by Antoine Pitrou in branch '3.4':
Issue #21364: remove recommendation of broken pattern.
http://hg.python.org/cpython/rev/4621bb82ceec
New changeset dbf728f9a2f0 by Antoine Pitrou in branch 'default':
Issue #21364: remove
Antoine Pitrou added the comment:
Thanks for the report, Armin. I've removed that recommendation and changed the
surrounding wording to insist that standard streams are always text streams.
--
resolution: - fixed
stage: - resolved
status: open - closed
Armin Ronacher added the comment:
To avoid further problems may I also recommend documenting how exactly people
are supposed to wrap sys.stdout and so forth. Clearly putting a StringIO there
is insufficient as StringIO does not have a buffer.
Something like this maybe?
import io
buf =
Antoine Pitrou added the comment:
To avoid further problems may I also recommend documenting how exactly
people are supposed to wrap sys.stdout and so forth. Clearly putting
a StringIO there is insufficient as StringIO does not have a buffer.
I would like to know of some situations where
New submission from Antoine Pitrou:
Some properties on IPv4Address and IPv6Address instantiate one or several
network objects each time they are computed. Instead these characteristic
networks can be computed once and for all at module import. Patch attached.
(note: the lru_cache() decorator
Armin Ronacher added the comment:
I would like to know of some situations where you want to write some
code that accesses standard streams as binary *and* don't control the
application setup (i.e. library code rather than application code). It
seems to me that a library should take the
Armin Ronacher added the comment:
Pretty much, yes. Just that you probably want 'replace' instead.
surrogate-escape does not do anything useful here I think.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21364
Antoine Pitrou added the comment:
The same situations people wrapped streams before on python 2:
* code.py users. Werkzeug's traceback system implements a remote python
shell through it.
* any system that wants to unittest shell scripts on a high level.
* any system that wants to
R. David Murray added the comment:
Note that in 3.4 we have contextlib.replace_stdout, but it doesn't give any
examples of how to construct file-like objects that will work well with it.
--
___
Python tracker rep...@bugs.python.org
R. David Murray added the comment:
I mean redirect_stdout.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21364
___
___
Python-bugs-list mailing
Changes by Josh Rosenberg shadowranger+pyt...@gmail.com:
--
nosy: +josh.rosenberg
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21513
___
___
Josh Rosenberg added the comment:
Changing the docs isn't the main hurdle; the problem is that if we told people
they could test == 1, rather than != 0, then new success return codes couldn't
be added without a long period of warning.
I don't think the convention is consistently 0 means
Roundup Robot added the comment:
New changeset 0a6d51ccff54 by Terry Jan Reedy in branch '2.7':
Issue #18104: revise docstrings, remove obsolete comments.
http://hg.python.org/cpython/rev/0a6d51ccff54
New changeset 6d2982ff441f by Terry Jan Reedy in branch '3.4':
Issue #18104: revise
Josh Rosenberg added the comment:
Not sure how much that really helps. If I understand you correctly, it would be
a memory optimization that would require a round of rehashing to use?
If you wanted to make a change that got guaranteed better performance, you
might add support for dict's
Alextp added the comment:
@Ezio:
of course, much of these funcs CANNOT be expressed as simple formulas. Only
with some text. I shown example descriptions for almost all- above.
--
___
Python tracker rep...@bugs.python.org
akira added the comment:
Both json standard (ECMA-404) [1] and the new json rfc 7159 [2] do not mention
the encoding detection.
[1] http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf
[2] https://tools.ietf.org/html/rfc7159#section-8.1
From the rfc:
JSON text SHALL be
Chris Rebert added the comment:
I agree that the state of encoding detection in the new RFC seems unclear,
given that the old RFC prefaced the part about the encoding detection with:
Since the first two characters of a JSON text will always be ASCII
characters
But in the new RFC:
Appendix
Changes by Chris Rebert pyb...@rebertia.com:
--
nosy: +cvrebert
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18820
___
___
Python-bugs-list
Changes by Chris Rebert pyb...@rebertia.com:
--
nosy: +cvrebert
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19361
___
___
Python-bugs-list
Chris Rebert added the comment:
Note that, per the new JSON RFC 7159 (https://tools.ietf.org/html/rfc7159 ),
top-level non-collection values are now de-jure permissible in JSON:
Appendix A. Changes from RFC 4627
o Changed the definition of JSON text so that it can be any JSON
Chris Rebert added the comment:
The new JSON RFC now at least mentions BOM handling:
https://tools.ietf.org/html/rfc7159#section-8.1 :
Implementations MUST NOT add a byte order mark to the beginning of a
JSON text. In the interests of interoperability, implementations
that parse JSON texts
New submission from Chris Rebert:
json module docs: https://docs.python.org/3/library/json.html
New superseding JSON RFC: https://tools.ietf.org/html/rfc7159
Errata to the new RFC: http://www.rfc-editor.org/errata_search.php?rfc=7159
ECMA-404:
Changes by Chris Rebert pyb...@rebertia.com:
--
nosy: +cvrebert
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21401
___
___
Python-bugs-list
Changes by Chris Rebert pyb...@rebertia.com:
--
nosy: +cvrebert
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1043134
___
___
Python-bugs-list
Changes by Chris Rebert pyb...@rebertia.com:
--
nosy: +cvrebert
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1521950
___
___
Python-bugs-list
Changes by Chris Rebert pyb...@rebertia.com:
--
nosy: +cvrebert
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13826
___
___
Python-bugs-list
Changes by Chris Rebert pyb...@rebertia.com:
--
nosy: +cvrebert
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13197
___
___
Python-bugs-list
70 matches
Mail list logo