Tobias Oberstein added the comment:
> It's unlikely that you would want to parse every string that looks enough
> like a decimal as a decimal, or that you would want to pay the cost of
> checking every string in the whole document to see if it's a decimal.
fwiw, yes, th
Tobias Oberstein added the comment:
I agree, my use case is probably exotic: transparent roundtripping of binaries
over JSON using a beginning \0 byte marker to distinguish plain string and
base64 encoded binaries.
FWIW, I do think however that adding "parse_string" kw param to t
New submission from Tobias Oberstein:
Though the JSONDecoder already has all the hooks internally to allow for a
custom parse_string
(https://github.com/python/cpython/blob/master/Lib/json/decoder.py#L330), this
currently is not exposed in the constructor JSONDecoder.__init__.
It would be
Changes by Tobias Oberstein :
--
nosy: +oberstet
___
Python tracker
<http://bugs.python.org/issue21356>
___
___
Python-bugs-list mailing list
Unsubscribe:
Tobias Oberstein added the comment:
FWIW, WebSocket URL parsing is still wrong on Python 2.7.6 - in fact, it's
broken in multiple ways:
>>> from urlparse import urlparse
>>> urlparse("ws://example.com/somewhere?foo=bar#dgdg")
ParseResult(scheme='ws
New submission from Tobias Oberstein:
The zlib library provides a couple of knobs to control the behavior and
resource consumption of compression:
ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
int level
New submission from Tobias Oberstein:
Currently the `zlib` module documents
zlib.compressobj([level])
However, there are more parameters present already today:
zlib.compressobj([level, method, wbits])
These other parameters are used in at least 2 deployed libraries (in the
context
Tobias Oberstein added the comment:
Is that patch supposed to be in Python 2.7.2?
If so, it doesn't work for "ws":
"ws://example.com/somewhere?foo=bar#dgdg"
F:\scm\Autobahn\testsuite\websockets\servers>python
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.15
Tobias Oberstein added the comment:
The patch as it stands will result in wrong behavior:
+self.assertEqual(urllib.parse.urlparse("ws://example.com/stuff#ff"),
+ ('ws', 'example.com', '/stuff#ff', '', '
Tobias Oberstein added the comment:
> I’d say that urlparse should raise an exception when a ws/wss URI contains a
> fragment part.
Yep, better.
> I’m not sure this will be possible; from a glance at the source and a quick
> test, urlparse will happily break the Generic URI Sy
Tobias Oberstein added the comment:
ok, there was feedback on Hybi list:
http://www.ietf.org/mail-archive/web/hybi/current/msg09270.html
"""
1. ws://example.com/something#somewhere
2. ws://example.com/something#somewhere/
3. ws://example.com/something#somewher
Tobias Oberstein added the comment:
sorry for "throw" .. somewhat bad habit (stemming from wandering between
languages).
uses_fragment extended:
[autobahn@autobahnhub ~/Autobahn]$ python
Python 2.7.1 (r271:86832, Dec 13 2010, 15:52:15)
[GCC 4.2.1 20070719 [FreeBSD]] on freebsd8
Tobias Oberstein added the comment:
here the links to the question on the Hybi list:
http://www.ietf.org/mail-archive/web/hybi/current/msg09257.html
and
http://www.ietf.org/mail-archive/web/hybi/current/msg09258.html
http://www.ietf.org/mail-archive/web/hybi/current/msg09243.html
==
I
Tobias Oberstein added the comment:
I'll ask (to be sure) and link.
However, after rereading the Hybi 17 section, it says
"""
path =
"""
And http://tools.ietf.org/html/rfc3986 says:
"""
The path is terminated by the first question mark (&
Tobias Oberstein added the comment:
I see how you interpret that sentence in the spec, but I would have read it
differently:
invalid:
1. ws://example.com/something#somewhere
2. ws://example.com/something#somewhere/
3. ws://example.com/something#somewhere/foo
4. ws://example.com/something
Tobias Oberstein added the comment:
Well, thinking about it, %23 can also appear in a percent encoded path
component.
I don't get the conditional "..if used as part of the query component" in the
spec.
--
___
Python
Tobias Oberstein added the comment:
fragment identifiers:
the spec says:
"Fragment identifiers are meaningless in the context of WebSocket
URIs, and MUST NOT be used on these URIs. The character "#" in URIs
MUST be escaped as %23 if used as part of the query component."
New submission from Tobias Oberstein :
The urlparse module currently does not support the new "ws" and "wss" schemes
used for the WebSocket protocol.
As a workaround, we currently use the following code (which is a hack of
course):
import urlparse
wss
18 matches
Mail list logo