Raymond Hettinger added the comment:
Attaching an alternative patch that handles the unicode specific case with far
less code and less overhead. It seems to speed-up all the timings I've tried.
It keeps the unicode_eq() specific path which bypasses several unneeded steps:
* an incref/decref
Raymond Hettinger added the comment:
Given that json is multi-language format ... I don't know
that we can expect much more from it.
JSON specifies a textual number format but doesn't dictate whether that format
represents a fixed precision binary float point number or a decimal floating
Anders Rundgren added the comment:
I guess my particular requirement/wish is unusual (keeping the original textual
representation of a floating point number intact) while using Decimal should be
fairly universal.
If these things could be combined in a Decimal support option I would (of
Nick Coghlan added the comment:
I started making a few edits based on Zuo and Walter's comments while getting
this patch ready for merging, and decided the end result could benefit from an
additional round of feedback before committing it.
This particular patch is also aimed at the Python 3.4
Bob Ippolito added the comment:
I don't think it's reasonable to expect Decimal to always output precisely the
same string it was given. It's a waste of complexity and space and the only
time you would want this behavior is when you really should've left it
accessible as a string in the first
Anders Rundgren added the comment:
Bob,
Your'e right, I have put up a requirement for JSON serializing that may be
over the top. OTOH, there are (AFAICT...) only two possible solutions:
1. Outlaw floating point data from the plot
2. Insist that serializers conform to the spec
As a pragmatic I
Anders Rundgren added the comment:
Well, I could have insisted on canonicalization of floating-point data but
that's so awkward that outlawing such data is a cleaner approach. Since the
target for JCS is security- and payment-protocols, I don't think the absence of
floating-point support
Nick Coghlan added the comment:
I've retitled this issue to be specifically about reducing the memory
consumption of the existing types in the IP Address module, as that's a change
that isn't easily implemented externally, and shouldn't have any negative side
effects under intended usage
Greg Turner added the comment:
Here's the same deal more-or-less for issue 23114... this time I expended
considerably less effort verifying that it's not a bad idea. At a glance,
though, it looks fine, and solved an instance of the issue 23114 problem I was
able to repro on my box.
Patch
Greg Turner added the comment:
Perhaps it is worth addressing, briefly, the following hypothetical question,
as a litmus test against the faint dis-encapsulation code-smell some folks
might be picking up from this:
In a hypothetcial world without setuptools, would these changes have merit?
New submission from Bertrand Janin:
Since I can't re-open issue 3372, I'm opening a new issue. socket.setsockopt()
still sets an optlen of '4' in the setsockopt() system call for options
IP_MULTICAST_TTL and IP_MULTICAST_LOOP. On OpenBSD, this causes the kernel to
hit an error condition and
Anders Rundgren added the comment:
Using simplejson I got it to work!!!
I just wonder what you think of the solution:
import collections
import simplejson as json
from decimal import Decimal
class EnhancedDecimal(Decimal):
def __str__ (self):
return self.saved_string
def
Gereon Kremer added the comment:
So, let's resurrect this one.
For the project that lead to the old patch, we did not need this feature.
However, we now needed are more complete implementation of IDLE.
Hence, we extended this to return after sending idle() and support polling,
leaving idle
New submission from Philipp Emanuel Weidmann:
Minimal code example:
from Tkinter import Tk
from tkSimpleDialog import askstring
def close_handler():
askstring('', '')
root.destroy()
root = Tk()
root.protocol('WM_DELETE_WINDOW', close_handler)
root.mainloop()
Closing the main window
New submission from Jim Carroll:
I reported this to the sqlite mailing list, and the comments I received
suggested the problem may by the python sqlite connector issue, so I'm opening
this as a bug report.
I understand that performing a SELECT and nested COMMIT on the same table is
not
R. David Murray added the comment:
I'd say you have a bug here of some sort, but I'm not sure if it is a doc bug
or a code bug. Commit specifically does *not* reset the cursors, according to
the code, but I'm not even sure what resetting a cursor means :) I've poked
around the sqlite3
Benjamin Peterson added the comment:
Just use the extended signature of the setsockopt:
mysocket.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL,
struct.pack(B, desired_ttl))
--
nosy: +benjamin.peterson
___
Python tracker
Raymond Hettinger added the comment:
Timings for no_special_hash.diff:
$ ~/cpython/python.exe -m timeit -r7 -s 's={html}' 'html in s'
1000 loops, best of 7: 0.0315 usec per loop
$ ~/nounicode/python.exe -m timeit -r7 -s 's={html}' 'html in s'
1000 loops, best of 7: 0.0336 usec per loop
Matthew Brett added the comment:
I think this is a frank bug for Pythons that use MSVC 10+ by default (3.3, 3.4
for example).
The lack of the /MANIFEST flag breaks the
distutils.ccompiler.CCompiler.link_executable command - see attached setup.py
example. The example gives the error
Bob Ippolito added the comment:
Yeah, that's the hack I was suggesting.
I suppose I don't see the point of having a protocol that normalizes *almost*
everything. Normalization should be all or nothing. Other options would be to
define the signature at the encoded byte level with no
Anders Rundgren added the comment:
Bob,
I'm not sure I understand why you say that JCS requires *almost* full
normalization. Using browsers you can generate fully compliant JCS objects
using like 20 lines of javascript/webcrypto (here excluding base64 support).
No normalization step is
Jim Carroll added the comment:
Hi David,
One more data point. Although I demonstrated the bug using the .execute()
method associated with a connection object -- you can also create the exact
problem using the .execute() method associated with cursors. This leaves no
means to COMMIT inside a
Ned Deily added the comment:
By default Python, do you mean the Apple supplied Python in /usr/bin? If so, it
uses an old Apple supplied Tk 8.5. Can you reproduce the problem with the
current python.org 2.7.9 with the current ActiveState Tk 8.5 installed?
--
nosy: +ned.deily
Anders Rundgren added the comment:
The current JCS validator is only 150 lines and does both RSA and EC signatures:
https://code.google.com/p/openkeystore/source/browse/python/trunk/src/org/webpki/json/JCSValidator.py
My Java-version is much more advanced but this is quite useful anyway
Ethan Furman added the comment:
Raymond Hettinger added the comment:
---
This bug report isn't a JSON spec issue; rather, it is about how the JSON
module API can
support (or inhibit) valid use cases.
AFAICT, the patch to make the API better support enums
New submission from Guido Vranken:
Tools/scripts/ftpmirror.py does not guard against arbitrary path constructions,
and, given a connection to a malicious FTP server (or a man in the middle
attack), it is possible that any file on the client's filesystem gets
overwritten. Ie,. if we suppose
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
Added file: http://bugs.python.org/file37557/measure_build_set.py
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23119
___
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
Added file: http://bugs.python.org/file37558/build_set_timings.txt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23119
___
New submission from Rosa Maria:
I make an xml extractor for mexican internet invoices; the extraction is
correct, but when save to csv, some numbers has additional numbers that does
not exist, for example 5010.00 is saved as 5010.002. As you can see in
the print function at line 155.
Anders Rundgren added the comment:
Ethan Furman added the comment:
I am not a regular json user, but my impression is the format is
pretty basic, and we would be overloading it to try and keep numbers
with three decimal places as Decimal, and anything else as float.
Isn't json's main
Benjamin Peterson added the comment:
That's because line 153 prints extra numbers at the end of the total.
--
nosy: +benjamin.peterson
resolution: - not a bug
status: open - closed
___
Python tracker rep...@bugs.python.org
31 matches
Mail list logo