[issue11315] Fix type regression in http.cookies.load (want bytes, not str)

2015-10-30 Thread Chad Whitacre

Chad Whitacre added the comment:

Here's a start on converting to bytes everywhere for cookies. I'm not sure I 
fully understand the library's original worldview on type conversion. There's a 
value_{decode,encode} facility, and in the test suite attribute values in 
particular are often not even strings of any kind.

--
Added file: 
http://bugs.python.org/file40904/start-converting-to-bytes-everywhere.patch

___
Python tracker 
<http://bugs.python.org/issue11315>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11315] Fix type regression in http.cookies.load (want bytes, not str)

2015-10-30 Thread Chad Whitacre

Chad Whitacre added the comment:

Here's a patch that fixes the two new failing tests. Now a bunch of other tests 
are busted. :-)

--
Added file: http://bugs.python.org/file40903/fix-the-two-new-tests.patch

___
Python tracker 
<http://bugs.python.org/issue11315>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11315] Fix type regression in http.cookies.load (want bytes, not str)

2015-10-30 Thread Chad Whitacre

Chad Whitacre added the comment:

Here's a patch with a couple failings tests for the type regression in 3.x.

--
Added file: 
http://bugs.python.org/file40901/failing-tests-for-type-regression.patch

___
Python tracker 
<http://bugs.python.org/issue11315>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11315] Fix/add unicode support in Cookie module?

2015-10-30 Thread Chad Whitacre

Chad Whitacre added the comment:

> in the 3.x version, only character strings (unicode) are accepted
> The code was changed to do this in r83361 #3788.

That seems like a bug to me. It looks like the intention was to avoid the 
`type("")` check for stylistic reasons, so `isinstance(rawdata, str)` is an 
understandable translation under 3.1 (which #3788 targets), but I suspect that 
`type("")` should never have survived the transition to Python 3 in the first 
place. The 2.7 branch still has `type("")` (not `str("")` as originally 
reported):

https://hg.python.org/cpython/file/2.7/Lib/Cookie.py#l639


> “raw” would suggest to me than only bytes make sense.

Agreed. Cookie names and values are constrained to a subset of ASCII:

https://tools.ietf.org/html/rfc6265#section-4.1.1

I suggest cookies be thought of as a binary data store, with programmers 
responsible to encode/decode their data at the boundary with the cookies 
library.


> I would tend to edit the documentation but no[t] the behavior, given that 2.7 
> is stable and this behavior has been present and documented for a long time.

Leaving 2.7 as-is makes sense, but now I think it looks like we have a 
regression in 3, which should be fixed.



P.S. I arrived here from https://github.com/gratipay/aspen.py/pull/524.

--
nosy: +whit537

___
Python tracker 
<http://bugs.python.org/issue11315>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11315] Fix type regression in http.cookies.load (want bytes, not str)

2015-10-30 Thread Chad Whitacre

Changes by Chad Whitacre :


--
title: Fix/add unicode support in Cookie module? -> Fix type regression in 
http.cookies.load (want bytes, not str)
versions: +Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 -Python 
2.7

___
Python tracker 
<http://bugs.python.org/issue11315>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1669349] make install fails if no previous Python installation

2011-09-07 Thread Chad Whitacre

Chad Whitacre  added the comment:

I am seeing this behavior with 2.7.1.

--
nosy: +whit537

___
Python tracker 
<http://bugs.python.org/issue1669349>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7595] Doc typo for select.kevent()

2009-12-29 Thread Chad Whitacre

New submission from Chad Whitacre :

I believe the default "flags" argument to select.kevent() should be given 
as KQ_EV_ADD, not KQ_ADD.

http://docs.python.org/dev/py3k/library/select.html

--
assignee: georg.brandl
components: Documentation, Library (Lib)
messages: 96996
nosy: georg.brandl, whit537
severity: normal
status: open
title: Doc typo for select.kevent()
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

___
Python tracker 
<http://bugs.python.org/issue7595>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com