[issue19193] Improve cross-references in tutorial

2013-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Georg for the review.

--
assignee: docs@python -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue19190] Improve cross-references in builtins documentation.

2013-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch addresses more Georg's comments.

--
Added file: http://bugs.python.org/file32011/refs.builtins_3.patch

___
Python tracker 

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



[issue19196] Improve cross-references in distutils documentation

2013-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch addresses Georg's comments.

--
Added file: http://bugs.python.org/file32012/refs.distutils_2.patch

___
Python tracker 

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



[issue19158] BoundedSemaphore.release() subject to races

2013-10-09 Thread STINNER Victor

STINNER Victor added the comment:

You should mention the change in Misc/NEWS.

--

___
Python tracker 

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



[issue19199] Remove PyThreadState.tick_counter field

2013-10-09 Thread Armin Rigo

Armin Rigo added the comment:

Better remove this field if its value is now useless anyway.  If someone needs 
it again for a similar reason, he can contribute a patch like I did in 2002 :-)

--

___
Python tracker 

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



[issue19165] Change formatter warning to DeprecationWarning in 3.5

2013-10-09 Thread Esa Peuha

Esa Peuha added the comment:

The wanted patch seems to be very simple: change PendingDeprecationWarning to 
DeprecationWarning on line 24 of Lib/formatter.py but only for Python 3.5 (i.e. 
no need to do anything until 3.4 is released).

On a related note, should formatter be added to PEP 4?

--
nosy: +Esa.Peuha

___
Python tracker 

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



[issue19202] Additions to docs

2013-10-09 Thread Esa Peuha

New submission from Esa Peuha:

Here are some additions to documentation of a few functions:

all, any: alternative definitions using functools.reduce
enumerate: alternative definition using zip and itertools.count
sum: equivalent definition using functools.reduce and operator.add
functools.reduce: equivalent definitions, use operator.add in example
itertools.accumulate: point to functools.reduce
itertools.filterfalse: point to filter

--
assignee: docs@python
components: Documentation
files: doc.diff
keywords: patch
messages: 199281
nosy: Esa.Peuha, docs@python
priority: normal
severity: normal
status: open
title: Additions to docs
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file32013/doc.diff

___
Python tracker 

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



[issue19202] Additions to docs

2013-10-09 Thread Georg Brandl

Georg Brandl added the comment:

Most of these changes should not be applied: the "alternate" equivalents in 
terms of reduce() will not help understanding,  Equivalents for reduce() may be 
useful, but I would limit them to one per case, possibly even just one function 
that covers both cases.

I'm deferring to Raymond for the changes to the itertools docs.

--
nosy: +georg.brandl, rhettinger

___
Python tracker 

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



[issue19195] Improve cross-references in C API

2013-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9b855a701e28 by Serhiy Storchaka in branch '2.7':
Issue 19195: Improved cross-references in C API documentation.
http://hg.python.org/cpython/rev/9b855a701e28

New changeset f0491617b098 by Serhiy Storchaka in branch '3.3':
Issue 19195: Improved cross-references in C API documentation.
http://hg.python.org/cpython/rev/f0491617b098

New changeset e30b27927e49 by Serhiy Storchaka in branch 'default':
Issue 19195: Improved cross-references in C API documentation.
http://hg.python.org/cpython/rev/e30b27927e49

--
nosy: +python-dev

___
Python tracker 

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



[issue19190] Improve cross-references in builtins documentation.

2013-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7565df5939de by Serhiy Storchaka in branch '2.7':
Issue #19190: Improve cross-references in builtin types and functions 
documentation.
http://hg.python.org/cpython/rev/7565df5939de

New changeset 207e1e1cb17a by Serhiy Storchaka in branch '3.3':
Issue #19190: Improve cross-references in builtin types and functions 
documentation.
http://hg.python.org/cpython/rev/207e1e1cb17a

New changeset a3f6e5920881 by Serhiy Storchaka in branch 'default':
Issue #19190: Improve cross-references in builtin types and functions 
documentation.
http://hg.python.org/cpython/rev/a3f6e5920881

--
nosy: +python-dev

___
Python tracker 

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



[issue19196] Improve cross-references in distutils documentation

2013-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e0b9e0ed561a by Serhiy Storchaka in branch '2.7':
#19196: Improved cross-references in distutils documentation.
http://hg.python.org/cpython/rev/e0b9e0ed561a

New changeset 0879b60de41f by Serhiy Storchaka in branch '3.3':
#19196: Improved cross-references in distutils documentation.
http://hg.python.org/cpython/rev/0879b60de41f

New changeset d70799f69d25 by Serhiy Storchaka in branch 'default':
#19196: Improved cross-references in distutils documentation.
http://hg.python.org/cpython/rev/d70799f69d25

--
nosy: +python-dev

___
Python tracker 

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



[issue19195] Improve cross-references in C API

2013-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for the review Georg.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue19190] Improve cross-references in builtins documentation.

2013-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for the review Georg.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue19196] Improve cross-references in distutils documentation

2013-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for the review Georg.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue19194] Improve cross-references in fcntl documentation

2013-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 372abcca25fc by Serhiy Storchaka in branch '2.7':
#19194: Improved cross-references in the fcntl module documentation.
http://hg.python.org/cpython/rev/372abcca25fc

New changeset 9015a84d694e by Serhiy Storchaka in branch '3.3':
#19194: Improved cross-references in the fcntl module documentation.
http://hg.python.org/cpython/rev/9015a84d694e

New changeset d76e91a29f64 by Serhiy Storchaka in branch 'default':
#19194: Improved cross-references in the fcntl module documentation.
http://hg.python.org/cpython/rev/d76e91a29f64

--
nosy: +python-dev

___
Python tracker 

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



[issue19194] Improve cross-references in fcntl documentation

2013-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for the review Georg.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue19203] Improve cross-references in curses howto

2013-10-09 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Here is a patch which fixes internal references in the howto of the curses 
module.

--
assignee: docs@python
components: Documentation
files: refs.curses-howto.patch
keywords: patch
messages: 199291
nosy: akuchling, docs@python, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Improve cross-references in curses howto
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file32014/refs.curses-howto.patch

___
Python tracker 

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



[issue18758] Fix internal references in the documentation

2013-10-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +Improve cross-references in curses howto

___
Python tracker 

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



[issue19203] Improve cross-references in curses howto

2013-10-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file32014/refs.curses-howto.patch

___
Python tracker 

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



[issue19203] Improve cross-references in curses howto

2013-10-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file32015/refs.curses-howto.patch

___
Python tracker 

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



[issue18758] Fix internal references in the documentation

2013-10-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +Improve cross-references in urllib documentation

___
Python tracker 

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



[issue19204] Improve cross-references in urllib documentation

2013-10-09 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Here is a patch which fixes internal references in the documentation of the 
urllib package.

--
assignee: docs@python
components: Documentation
files: refs.urllib.patch
keywords: patch
messages: 199292
nosy: docs@python, orsenthil, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Improve cross-references in urllib documentation
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file32016/refs.urllib.patch

___
Python tracker 

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



[issue19199] Remove PyThreadState.tick_counter field

2013-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3ce0102e4c1f by Victor Stinner in branch 'default':
Close #19199: Remove ``PyThreadState.tick_counter`` field
http://hg.python.org/cpython/rev/3ce0102e4c1f

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue19205] Don

2013-10-09 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: Don

___
Python tracker 

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



[issue19206] Support disabling file I/O when doing traceback formatting

2013-10-09 Thread Itamar Turner-Trauring

New submission from Itamar Turner-Trauring:

In certain situations it is best to avoid doing file I/O. For example, a 
program that runs in an event loop may wish to avoid any potentially blocking 
operations; reading from a file usually is fast, but can sometimes take 
arbitrary long. Another example (my specific use case) is a logging library - 
you don't want to block for an arbitrary amount of time when creating log 
messages in an application thread (a separate thread would do the writing).

Unfortunately, the traceback.py module reads from files to load the source 
lines for the traceback (using linecache.py). This means if you want to format 
a traceback without file I/O you have to either recreate some logic from the 
standard library, monkey-patch globally, or do a terrible hack you don't want 
to know about.

It would be better if the there was some way to ask the traceback.py module's 
functions to not do file I/O. The actual change would be fairly minor I suspect 
since the formatting functions already support getting None back from linecache.

--
components: Library (Lib)
messages: 199294
nosy: itamarst
priority: normal
severity: normal
status: open
title: Support disabling file I/O when doing traceback formatting
type: enhancement

___
Python tracker 

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



[issue19205] Don't import re and sysconfig in site.py

2013-10-09 Thread Christian Heimes

New submission from Christian Heimes:

The site module is loaded at every startup. Nowadays it imports the re and the 
sysconfig modules. The re module is used for venv config parsing and inside 
sysconfig. sysconfig is loaded to find the location of the user's site-packages 
directory.

Suggestions:
- Only import re and compile CONFIG_LINE when a venv config file is found

- Don't rely on sysconfig for user's site-packages directory. Instead the 
sysconfig module should rely on site.py to get its location.

Without re and sysconfig Python would import only 45 instead of 56 modules at 
startup (tested on Linux).

--
components: +Interpreter Core, Library (Lib)
stage:  -> needs patch
title: Don -> Don't import re and sysconfig in site.py
type:  -> performance
versions: +Python 3.4

___
Python tracker 

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



[issue19205] Don't import re and sysconfig in site.py

2013-10-09 Thread Christian Heimes

Changes by Christian Heimes :


--
keywords: +patch
Added file: http://bugs.python.org/file32017/site_no_re.patch

___
Python tracker 

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



[issue19207] Improve cross-references in os documentation

2013-10-09 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Here is a patch which fixes internal references in the documentation of the os, 
os.path and posix modules.

--
assignee: docs@python
components: Documentation
files: refs.os.patch
keywords: patch
messages: 199296
nosy: docs@python, loewis, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Improve cross-references in os documentation
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file32018/refs.os.patch

___
Python tracker 

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



[issue18758] Fix internal references in the documentation

2013-10-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +Improve cross-references in os documentation

___
Python tracker 

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



[issue19200] grammar in forkserver docs

2013-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c0f3d18d79fd by Georg Brandl in branch 'default':
Closes #19200: small grammar fix in multiprocessing docs. Thanks to Elazar 
Gershuni.
http://hg.python.org/cpython/rev/c0f3d18d79fd

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue19208] Bas64.decodestring() returns data instead of throwing exception

2013-10-09 Thread Tymoteusz Paul

New submission from Tymoteusz Paul:

What happens (and how to reproduce):

import base64
str = """GET 
http://www.google.com.hk/search?q=hotels+near+airport&pws=1&igu=1&ip=0.0.0.0&safe=images&gl=CN&gll=39.913889,116.391667&near=china&hl=zh-CN
 HTTP/1.0\nContent-Length: 0\nUser-Agent: Opera/9.80 (X11; Linux i686; U; 
en-US) Presto/2.9.173 Version/12.00\nProxy-Authorization: Basic\nAuthorization: 
Basic\nReferer: http://www.google.com/\n\n""";
base64.decodestring(str)

What is expected:
Exception should be throw as provided string is not encoded with base64. 

What is the result:
We receive some garbage string which hex representation is 
'\x18D\xe1\xb6\xda\x7f\xff\x0c0\x82\x8a \x95\xe7(\x9a\x19?\xb1\xe6\xabr\x1a'

--
messages: 199299
nosy: Tymoteusz.Paul
priority: normal
severity: normal
status: open
title: Bas64.decodestring() returns data instead of throwing exception
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue18758] Fix internal references in the documentation

2013-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

And here is a patch with small changes which doesn't worth separated issue.

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file32019/refs.patch

___
Python tracker 

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



[issue18758] Fix internal references in the documentation

2013-10-09 Thread Georg Brandl

Georg Brandl added the comment:

Looks good, except that buffer doesn't really correspond to bytearray.  No 
memoryview involved there?

--

___
Python tracker 

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



[issue18758] Fix internal references in the documentation

2013-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

No. BytesWarning is related only to bytes and bytearray.

--

___
Python tracker 

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



[issue18758] Fix internal references in the documentation

2013-10-09 Thread Georg Brandl

Georg Brandl added the comment:

OK then -- so much the better.

--

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-09 Thread Christian Heimes

New submission from Christian Heimes:

The patch removes "import copyreg" from the os module and moves the 
registration of the hooks to copyreg. This speeds up the startup of the 
interpreter a tiny bit.

--
files: os_no_copyreg.patch
keywords: patch
messages: 199303
nosy: christian.heimes
priority: normal
severity: normal
stage: patch review
status: open
title: Remove import copyreg from os module
type: performance
versions: Python 3.4
Added file: http://bugs.python.org/file32020/os_no_copyreg.patch

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-09 Thread Georg Brandl

Georg Brandl added the comment:

+1

--
nosy: +georg.brandl

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-09 Thread STINNER Victor

STINNER Victor added the comment:

I don't know the copyreg module! Does it have a unit test for the registered os 
objects? If not, how can it be tested manually?

--
nosy: +haypo

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-09 Thread Christian Heimes

Christian Heimes added the comment:

>>> import os
>>> import pickle
>>> pickle.dumps(os.stat("."))
b"\x80\x03cos\n_make_stat_result\nq\x00(M\xfdAJ\x84\xa0k\x00M\x00\xfcK\x13M\xe8\x03M\xe8\x03M\x00`J\x9chURJ\xbdgURJ\xbdgURtq\x01}q\x02(X\x08\x00\x00\x00st_ctimeq\x03GA\xd4\x95Y\xefW\x04\xc1X\x07\x00\x00\x00st_rdevq\x04K\x00X\x0b\x00\x00\x00st_mtime_nsq\x05\x8a\x08\xe8/\xfdo@w+\x13X\x08\x00\x00\x00st_atimeq\x06GA\xd4\x95Z'$T\xb6X\x0b\x00\x00\x00st_ctime_nsq\x07\x8a\x08\xe8/\xfdo@w+\x13X\n\x00\x00\x00st_blksizeq\x08M\x00\x10X\x0b\x00\x00\x00st_atime_nsq\t\x8a\x08\xa0\x0e9htw+\x13X\x08\x00\x00\x00st_mtimeq\nGA\xd4\x95Y\xefW\x04\xc1X\t\x00\x00\x00st_blocksq\x0bK8u\x86q\x0cRq\r."
>>> pickle.loads(pickle.dumps(os.stat(".")))
posix.stat_result(st_mode=16893, st_ino=7053444, st_dev=64512, st_nlink=19, 
st_uid=1000, st_gid=1000, st_size=24576, st_atime=1381329052, 
st_mtime=1381328829, st_ctime=1381328829)

--

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What will happen when do not register stat_result and statvfs_result at all?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue19201] lzma and 'x' mode open

2013-10-09 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +ethan.furman
stage:  -> patch review

___
Python tracker 

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



[issue19210] Unicode Objects in Tuples

2013-10-09 Thread Stephen Tucker

New submission from Stephen Tucker:

If a tuple consists of a single unicode object with non-ASCII characters in it, 
the printing of the tuple causes the non-ASCII characters to appear correctly 
as characters.

If the tuple contains such a unicode object and anything else (even if it 
contains nothing else but two or more such unicode objects), the printing of 
the tuple causes all non-ASCII characters in the objects to appear as their 
"\u" escapes instead of as their characters.

The same thing happens when writing such tuples to a file that has been opened 
using codecs.open (, 'w', 'utf-8').

--
components: Windows
messages: 199308
nosy: Stephen_Tucker
priority: normal
severity: normal
status: open
title: Unicode Objects in Tuples
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-09 Thread Christian Heimes

Christian Heimes added the comment:

You can still pickle and unpickle the objects but the result is no longer 
platform-independent as it refers to "posix" or "nt" instead of "os".

>>> import os, pickle, pickletools
>>> pickletools.dis(pickle.dumps(os.stat(".")))
0: \x80 PROTO  3
2: cGLOBAL 'os _make_stat_result'
   24: qBINPUT 0
   26: (MARK
...

>>> pickletools.dis(pickle.dumps(os.stat(".")))
0: \x80 PROTO  3
2: cGLOBAL 'posix stat_result'
   21: qBINPUT 0
   23: (MARK
...

--

___
Python tracker 

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



[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2013-10-09 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
versions: +Python 3.3, Python 3.4 -Python 2.6

___
Python tracker 

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



[issue19165] Change formatter warning to DeprecationWarning in 3.5

2013-10-09 Thread Brett Cannon

Brett Cannon added the comment:

Esa is right; this is a placeholder bug to remind me to do this in Python 3.5.

And Esa is also right about adding formatter to PEP 4; I'll reopen the original 
bug to remind me to do that.

--

___
Python tracker 

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



[issue19165] Change formatter warning to DeprecationWarning in 3.5

2013-10-09 Thread Brett Cannon

Changes by Brett Cannon :


--
dependencies: +Deprecate the formatter module

___
Python tracker 

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



[issue18716] Deprecate the formatter module

2013-10-09 Thread Brett Cannon

Brett Cannon added the comment:

Need to add a note to PEP 4.

--
status: closed -> open

___
Python tracker 

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



[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2013-10-09 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Addressing storchaka's review comments. Here is the updated patch.

--
Added file: http://bugs.python.org/file32021/19092-v2.diff

___
Python tracker 

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



[issue19202] Additions to docs

2013-10-09 Thread Esa Peuha

Esa Peuha added the comment:

How would you give a single definition of reduce() that helps people to 
understand both 2-arg and 3-arg variants? The way it is implemented in C is 
impossible to duplicate in pure Python; the best you could do is a hack that 
works unless someone *tries* to break it, but that would just be confusing.

--

___
Python tracker 

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



[issue19210] Unicode Objects in Tuples

2013-10-09 Thread Eric V. Smith

Eric V. Smith added the comment:

Can you provide some code which demonstrates this?

It's easier to address this if we have known working (or non-working) examples.

Thanks.

--
nosy: +eric.smith

___
Python tracker 

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



[issue19202] Additions to docs

2013-10-09 Thread Georg Brandl

Georg Brandl added the comment:

What about

def reduce(function, iterable, initializer=None):
it = iter(iterable)
if initializer is None:
value = next(it)
else:
value = initializer
for element in it:
value = function(value, element)
return value

Remember, an equivalent doesn't have to be 100% compatible, it is a way for the 
user to quickly get an idea what the function does.

--

___
Python tracker 

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



[issue19205] Don't import re and sysconfig in site.py

2013-10-09 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-09 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue9548] locale can be imported at startup but relies on too many library modules

2013-10-09 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue19210] Unicode Objects in Tuples

2013-10-09 Thread Peter Otten

Peter Otten added the comment:

Be aware that for a 1-tuple the trailing comma is mandatory:

>>> print (u"äöü") # this is a string despite the suggestive parens
äöü
>>> print (u"äöü",) # this is a tuple
(u'\xe4\xf6\xfc',)

--
nosy: +peter.otten

___
Python tracker 

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



[issue19208] Bas64.decodestring() returns data instead of throwing exception

2013-10-09 Thread R. David Murray

R. David Murray added the comment:

You are looking for the (new in Python 3) 'validate' option of b64decode:

>>> base64.b64decode(b"GET 
>>> http://www.google.com.hk/search?q=hotels+near+airport&pws=1&igu=1&ip=0.0.0.0&safe=images&gl=CN&gll=39.913889,116.391667&near=china&hl=zh-CN";,
>>>  validate=True)
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/rdmurray/python/p34/Lib/base64.py", line 87, in b64decode
raise binascii.Error('Non-base64 digit found')
binascii.Error: Non-base64 digit found

In Python2, the base64 module unfortunately only handles the applications of 
RFC 3548 where non-base64 alphabet characters are required to be ignored.  
(Those are (or were?) the primary applications of the RFC, by the way, which is 
why it was implemented that way originally.)

--
nosy: +r.david.murray
resolution:  -> out of date
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue1507011] Use a set to keep interned strings

2013-10-09 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
superseder:  -> Use a set for interned strings

___
Python tracker 

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



[issue19187] Use a set for interned strings

2013-10-09 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

This exact issue was discussed in #19187 and #7224 many years ago.

--
nosy: +belopolsky

___
Python tracker 

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



[issue19187] Use a set for interned strings

2013-10-09 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

The first reference above should have been to #1507011.

--

___
Python tracker 

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



[issue19211] from relative_module import seems to import wrong module

2013-10-09 Thread Ethan Glasser-Camp

New submission from Ethan Glasser-Camp:

I have a library lib. lib/__init__.py does the following:

from .subdir import a
from . import a
import sys

print(sys.modules['lib.a'])

This code fails with a KeyError. It seems that despite the second line, lib.a 
does not get imported. Printing a.__name__ shows lib.subdir.a. Commenting out 
the first line makes the code work fine, as does moving the code from 
lib/__init__.py to lib/api.py. This happens under both Python 2.7 and Python 
3.3.

Here is my sys.path, sys.meta_path, and sys.path_hooks under Python 2.7:

(['/home/ethan/tmp/import-madness', 
'/home/ethan/tmp/software/notmuch/bindings/python', 
'/home/ethan/local/lib/python2.7/site-packages', '/usr/lib/python2.7', 
'/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', 
'/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', 
'/home/ethan/.local/lib/python2.7/site-packages', 
'/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', 
'/usr/lib/python2.7/dist-packages/PILcompat', 
'/usr/lib/python2.7/dist-packages/gst-0.10', 
'/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7'], 
[], [])

The same under Python 3:

['/home/ethan/tmp/import-madness', 
'/home/ethan/local/lib/python2.7/site-packages', '/usr/lib/python3.3', 
'/usr/lib/python3.3/plat-x86_64-linux-gnu', '/usr/lib/python3.3/lib-dynload', 
'/usr/local/lib/python3.3/dist-packages', '/usr/lib/python3/dist-packages'] 
[, , ] 
[, .path_hook_for_FileFinder at 0x7f0728babdd0>]

--
components: Interpreter Core
files: __init__.py
messages: 199320
nosy: ethan.glasser.camp
priority: normal
severity: normal
status: open
title: from relative_module import seems to import wrong module
type: behavior
versions: Python 2.7, Python 3.3
Added file: http://bugs.python.org/file32022/__init__.py

___
Python tracker 

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



[issue19210] Unicode Objects in Tuples

2013-10-09 Thread Eric V. Smith

Eric V. Smith added the comment:

This isn't strictly related to printing a tuple. It's the difference between 
str() and repr():

>>> print (u"äöü")  # uses str
äöü
>>> print repr(u"äöü")
u'\xe4\xf6\xfc'

When the tuple is printed, it uses the repr of its constituent parts.

--

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-09 Thread STINNER Victor

STINNER Victor added the comment:

Can't we modify the qualified name instead?

--

___
Python tracker 

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



[issue19211] from relative_module import seems to import wrong module

2013-10-09 Thread R. David Murray

R. David Murray added the comment:

I believe that this is because once you execute the first line, 'a' exists as a 
name in the 'lib' namespace, so 'from . import a' sees that 'a' already exists, 
and does nothing.  The same import sequence in abc.py will put 'a' into the 
'abc' namespace, but 'from . import a' will be looking in the 'lib' namespace, 
won't see an 'a', and will do the new import, overwriting the definition of 'a' 
in the 'abc' namespace as it does so.

The exact effects of imports inside __init__ is sometimes a bit non-intuitive.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-09 Thread Georg Brandl

Georg Brandl added the comment:

But for pickling something, you have to import pickle, which always imports 
copyreg anyway, doesn't it?

--

___
Python tracker 

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



[issue19211] from relative_module import seems to import wrong module

2013-10-09 Thread Ethan Glasser-Camp

Ethan Glasser-Camp added the comment:

Thanks for the explanation. I had a feeling I was overlooking something obvious 
but couldn't figure out what it was. Feel free to close as invalid.

--

___
Python tracker 

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



[issue19158] BoundedSemaphore.release() subject to races

2013-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 369fabf9b2ba by Tim Peters in branch '3.3':
Issue 19158:  a rare race in BoundedSemaphore could allow .release() too often.
http://hg.python.org/cpython/rev/369fabf9b2ba

New changeset 9ddc33174ddf by Tim Peters in branch 'default':
Issue 19158:  a rare race in BoundedSemaphore could allow .release() too often.
http://hg.python.org/cpython/rev/9ddc33174ddf

New changeset 2ce77d9ed4b0 by Tim Peters in branch '2.7':
Issue 19158:  a rare race in BoundedSemaphore could allow .release() too often.
http://hg.python.org/cpython/rev/2ce77d9ed4b0

--

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-09 Thread Christian Heimes

Christian Heimes added the comment:

Exactly, the pickle module depends on the copyreg module. It's a submodule that 
acts as a registry for pickle-related lookups and hooks. My patch just moves 
the registration of these hooks out of the os module into the copyreg module.

--

___
Python tracker 

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



[issue19211] from relative_module import seems to import wrong module

2013-10-09 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-09 Thread Georg Brandl

Georg Brandl added the comment:

I don't see a problem with that.

--

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

How much this speed up the startup of the interpreter?

Proposed patch looks contrary to purpose of the copyreg module.

--

___
Python tracker 

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



[issue19205] Don't import re and sysconfig in site.py

2013-10-09 Thread Christian Heimes

Christian Heimes added the comment:

The site and sysconfig module are too intermingled to remove the import of 
sysconfig from the site module. However the sysconfig module doesn't use the re 
module in most cases anymore. The parsing functions for Makefile and pyconfig.h 
are only used by distutils.

The patch moves "import re" inside three functions.

--
Added file: http://bugs.python.org/file32023/sysconfig_delay_re.patch

___
Python tracker 

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



[issue19185] Allow multiprocessing Pool initializer to return values

2013-10-09 Thread Matteo Cafasso

Matteo Cafasso added the comment:

On 07/10/13 13:32, Richard Oudkerk wrote:
> Richard Oudkerk added the comment:
>
> I think "misuse" is an exageration.  Various functions change some state and 
> return a value that is usually ignored, e.g. os.umask(), signal.signal().
These functions are compliant with POSIX standards and the return values 
are actually useful, they return the previously set masks and handlers, 
often are ignored but in complex cases it's good to know their previous 
state.

The problem here is quite different, the interface is giving the 
opportunity of executing a function but it ignores the returned values, 
this is pretty limiting from an API point of view. It is quite 
counterintuitive and also not documented, proof is the amount of 
questions on how to use the initializer (just a couple of examples):
http://stackoverflow.com/questions/10117073/how-to-use-initializer-to-set-up-my-multiprocess-pool
http://stackoverflow.com/questions/9944370/use-of-initialize-in-python-multiprocessing-worker-pool
>
>> Global variables usage is a pattern which might lead to code errors and many
>> developers discourage from following it.
> What sort of code errors?  This really seems a stylistic point.  Maybe such 
> developers would be happier using class methods and class variables rather 
> than functions and globals variables.
http://c2.com/cgi/wiki?GlobalVariablesAreBad

It is a pretty common code practice to avoid global variables whenever 
possible; as always: is the way a tool is used to make it evil not the 
tool itself; yet I agree with the fact that a global variable change is 
hard to track down into the code and when the code grows it can lead to 
very tricky errors.
>
> Out of interest, what do you usually do in your initializer functions?
I mainly develop back-end systems which take great advantage from the 
Worker Pool pattern. We are talking about services which uses third 
party libraries to execute CPU bounded tasks trying to scale up with the 
number of CPU cores. Many of these libraries, unfortunately, are 
stateful (I would say "state-full") and their initialization is 
time-consuming.

Typically a worker initializes some of those objects (which currently 
are stored in global variables) and starts crunching some data, 
meanwhile the state of these objects keeps changing and here the global 
variables pattern shows its worst side.

>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue19187] Use a set for interned strings

2013-10-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +loewis

___
Python tracker 

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



[issue19187] Use a set for interned strings

2013-10-09 Thread STINNER Victor

STINNER Victor added the comment:

Raymond> FWIW, I'm dubious that there will be any benefit from this at all.  
The savings of one-pointer is the dictionary is likely to be insignificant 
compared to the size of the string object themselves.

As I wrote in python-dev, the dictionary is usually the largest memory block, 
at least at Python startup. The dictionary (without counting the string, just 
the dict) is between 192 KB and 1.5 MB on x86_64.

In the implementation of the PEP 454, issue #18874, I added a function to get 
the length and size of the dictionary of Unicode interned strings.

Objects/unicodeobject.c:

PyObject*
_PyUnicode_GetInterned(void)
{
return interned;
}

tracemalloc.get_unicode_interned():

http://hg.python.org/features/tracemalloc/file/b797779940a5/Modules/_tracemalloc.c#l4606

You can use this function to see how many KB are saved. In embedded systems, 
every byte of memory counts :-)

--

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-09 Thread Christian Heimes

Christian Heimes added the comment:

The speedup is minimal but it's a start.

--

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-09 Thread STINNER Victor

STINNER Victor added the comment:

os_no_copyreg.patch looks good to me.

--

___
Python tracker 

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



[issue19145] Inconsistent behaviour in itertools.repeat when using negative times

2013-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Raymond's patch looks even more cumbersome than previous code. And it doesn't 
work in some cases:

>>> it = itertools.cycle([-2, -1])
>>> class Index:
... def __index__(self): return next(it)
... 
>>> itertools.repeat(42, times=Index())
repeat(42, -1)

--

___
Python tracker 

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



[issue19209] Remove import copyreg from os module

2013-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't think we should tangent code for such tiny benefit. copyreg is 
lightweight module specially designed to break coupling of the code.

--

___
Python tracker 

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



[issue19187] Use a set for interned strings

2013-10-09 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> In embedded systems, every byte of memory counts 

It is not just embedded systems.  The range 192 KB to 1.5 MB is where typical 
L2 cache sizes are these days.  I would expect that the intern dictionary is 
accessed very often and much more often than the actual strings.  In theory, if 
it fits in L2 cache, the performance will be much higher than if it is even 
slightly over.

This said, when I was looking at this 3-4 years ago, I did not see measurable 
improvements in my programs.

--

___
Python tracker 

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



[issue19187] Use a set for interned strings

2013-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I afraid that adding new parameter to the set_contains_key function will slow 
down other set operations. It will be better return a key as the result of the 
function (NULL if not found).

--

___
Python tracker 

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



[issue19185] Allow multiprocessing Pool initializer to return values

2013-10-09 Thread Richard Oudkerk

Richard Oudkerk added the comment:

> These functions are compliant with POSIX standards and the return values 
> are actually useful, they return the previously set masks and handlers, 
> often are ignored but in complex cases it's good to know their previous 
> state.

Yes.  But my point was that somebody might have used such a function as the 
initializer argument.  The proposed change would break a program which does

with Pool(initializer=os.nice, initargs=(incr,)) as p:
...

--

___
Python tracker 

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



[issue16355] inspect.getcomments() does not work in the interactive shell

2013-10-09 Thread R. David Murray

R. David Murray added the comment:

Looking at the source, the suppression of errors is clearly intentional.  
Looking at the change that added the TypeError check, we see this from Jeremy 
Hilton in March 2002 (9c2ca37bdeec):

It appears that getcomments() can get called for classes defined in
C.  Since these don't have source code, it can't do anything useful.
A function buried many levels deep was raising a TypeError that was
not caught.

Who knows why this broke...

Which implies that getcomments was being called from somewhere in Python 
itself...at least back then.

The check for OSError (IOError, then) was from shortly after the module was 
first added, in February of 2001 by Ka-Ping Yee.

So, the motivation behind this behavior are shrouded in the mists of time :)

Should we really be changing something of that long standing, when it raising a 
TypeError previously clearly broke something?

I'm thinking not.  I'm thinking we should leave well enough alone.  It is, 
after all, working as documentedin the doc string, from the time Jeremy 
made the TypeError change.  So after all this work (sorry people, I do 
appreciate the work!), I think we should just make a doc fix that copies the 
line about returning None if source can't be found into the rst docs.

--

___
Python tracker 

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



[issue17134] Use Windows' certificate store for CA certs

2013-10-09 Thread Christian Heimes

Christian Heimes added the comment:

The current implementation doesn't check the trust settings and purpose of 
certs.

CertGetCertificateContextProperty() with CERT_ENHKEY_USAGE_PROP_ID returns a 
ASN.1 structure. I just have to figure out how to parse the CTL_USAGE struct ...

http://msdn.microsoft.com/en-us/library/aa376079%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/aa381493%28v=vs.85%29.aspx
http://www.alvestrand.no/objectid/1.3.6.1.5.5.7.3.html

--

___
Python tracker 

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



[issue18891] Master patch for content manager addtion to email package.

2013-10-09 Thread R. David Murray

R. David Murray added the comment:

Updating the patch to address Stephen's review comments (thanks, Stephen!).  
The biggest change is adding a MIMEPart class, and renaming MIMEMessage to 
EmailMessage.  Other significant changes are: only moving 'Content-*' headers 
in 'make' methods, adding 'clear' and 'clear_content' methods (and calling 
clear_content in the 'make' methods), and raising a TypeError if set_content is 
called on a multipart.

The documentation is complete, but not completely proofread/edited.  I can 
always finish that after the Beta if I don't get to it before (though I expect 
to).  There are probably some missing docstrings as well; same comment applies 
:).

I have not addressed the MIMEType idea.  I will deal with that as a separate 
issue (and not for 3.4), since it has implications throughout the package, not 
just in the code I'm enhancing.

I think this is ready for commit review, assuming I haven't forgotten anything. 
 (I'll close the earlier issues.)

--
stage: patch review -> commit review
Added file: http://bugs.python.org/file32024/master_content_manager.patch

___
Python tracker 

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



[issue14984] netrc module allows read of non-secured .netrc file

2013-10-09 Thread bruno Piguet

bruno Piguet added the comment:

I apologise for coming back to this issue lately, after its closing.
I must have misconfigured something in my tracking system.

Thank-you everybody for the work done, especiallly the careful handling and 
documenting of the case "only if password is present in file". I recognise my 
proposed patch was a bit flacky.
However, I don't get the rationale behind the restriction to the sole case 
where the file is the default .netrc ?
If a clear text password is exposed in any file, it is also a security problem, 
isn't it ? This specific file might be more difficult to find for an attacker, 
but not impossible.
Feel free to redirect this discussion to some other place if you want to keep 
this issue close and still.

--

___
Python tracker 

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



[issue19212] Invitation to connect on LinkedIn

2013-10-09 Thread Caitlin Potter

New submission from Caitlin Potter:

LinkedIn


Python,

I'd like to add you to my professional network on LinkedIn.

- Caitlin

Caitlin Potter
Freelance Developer at freelance software developer "self employed"
Toronto, Canada Area

Confirm that you know Caitlin Potter:
https://www.linkedin.com/e/-3qcne3-hml1zaap-1f/isd/17195171015/l2fhHe9j/?hs=false&tok=2MQlcG4YvniRY1

--
You are receiving Invitation to Connect emails. Click to unsubscribe:
http://www.linkedin.com/e/-3qcne3-hml1zaap-1f/z2oU7dKDzpt2G7xQz2FC2SclHmnUGzmsk0c/goo/report%40bugs%2Epython%2Eorg/20061/I5707467440_1/?hs=false&tok=1rzhxcavbniRY1

(c) 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA.

--
messages: 199343
nosy: Caitlin.Potter
priority: normal
severity: normal
status: open
title: Invitation to connect on LinkedIn

___
Python tracker 

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



[issue19213] platform.linux_distribution detects Oracle Linux as Red Hat Enterprise Linux

2013-10-09 Thread Alexander Boyd

New submission from Alexander Boyd:

Tested on 3.3.2 and 2.6.6.

On Oracle Linux, platform.linux_distribution detects the current distribution 
as Red Hat Enterprise Linux:

>>> import platform
>>> platform.linux_distribution()
('Red Hat Enterprise Linux Server', '6.2', 'Santiago')

I would have expected something along the lines of:

>>> import platform
>>> platform.linux_distribution()
('Oracle Linux', '6.2', '')

Or perhaps ('Oracle Linux Server', '6.2', '').

--
components: Library (Lib)
messages: 199345
nosy: javawizard
priority: normal
severity: normal
status: open
title: platform.linux_distribution detects Oracle Linux as Red Hat Enterprise 
Linux
type: behavior
versions: Python 2.6, Python 3.3

___
Python tracker 

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



[issue9548] locale can be imported at startup but relies on too many library modules

2013-10-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Updated patch for 3.4.

--
nosy: +benjamin.peterson, christian.heimes
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue9548] locale can be imported at startup but relies on too many library modules

2013-10-09 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Added file: http://bugs.python.org/file32025/bootlocale2.patch

___
Python tracker 

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



[issue18785] Add get_body and iter_attachments to provisional email API

2013-10-09 Thread R. David Murray

R. David Murray added the comment:

Serhiy's review comments were addressed by changes made on the master patch 
issue.

Closing this one in favor of that one.

--
resolution:  -> out of date
stage: patch review -> committed/rejected
superseder:  -> Master patch for content manager addtion to email package.

___
Python tracker 

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



[issue18785] Add get_body and iter_attachments to provisional email API

2013-10-09 Thread R. David Murray

Changes by R. David Murray :


--
status: open -> closed

___
Python tracker 

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



[issue18860] Add content manager API to email package

2013-10-09 Thread R. David Murray

R. David Murray added the comment:

Closing in favor of the master patch issue 18891.

--
resolution:  -> out of date
stage: patch review -> committed/rejected
status: open -> closed
superseder:  -> Master patch for content manager addtion to email package.

___
Python tracker 

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



[issue18890] Add a raw_data_manager content manager to the email package.

2013-10-09 Thread R. David Murray

R. David Murray added the comment:

Closing in favor of the master patch issue 18891.

--
resolution:  -> out of date
stage: patch review -> committed/rejected
status: open -> closed
superseder:  -> Master patch for content manager addtion to email package.

___
Python tracker 

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



[issue14984] netrc module allows read of non-secured .netrc file

2013-10-09 Thread R. David Murray

R. David Murray added the comment:

Nothing stops us from have a post-mortem discussion on a closed issue :)

The rationale for only doing the check for .netrc is that that is 
backward-compatibility-wise fairly safe, because other tools will already be 
insisting on the same security.  But for arbitrary files being parsed for 
arbitrary purposes by python-based tools, suddenly throwing an error if there 
is a password in the file could easily break things.

This doesn't necessarily prevent us from making the security even more strict 
in 3.4, but that is a more complex discussion (involving what purposes 
netrc-on-other-than-.netrc is used for in the real world), and should be a 
separate issue in this tracker, if you want to raise the proposal.

--

___
Python tracker 

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



[issue19212] Invitation to connect on LinkedIn

2013-10-09 Thread R. David Murray

Changes by R. David Murray :


--
Removed message: http://bugs.python.org/msg199343

___
Python tracker 

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



[issue19212] Spam

2013-10-09 Thread R. David Murray

Changes by R. David Murray :


--
status: open -> closed
title: Invitation to connect on LinkedIn -> Spam

___
Python tracker 

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



[issue17748] Condition.wait timeout can't be set to more than 50 ms

2013-10-09 Thread Bill Sobel

Bill Sobel added the comment:

I'd like to suggest a easy fix here (I saw this was closed, but the posters 
were asking for a behavior change).  With this fix there is no behavior change 
to callers or new parameters to the API.


if remaining >= 4.0:
maxDelay = 1
else:
maxDelay = .05
delay = min(delay * 2, remaining, maxDelay)

With this fix the loop waits 1 second until it is 'close' to the expiration 
time then goes into its normal 20 times per-second check.  For long waits this 
is what is causing the power issue and is alleviated by throttling back on the 
check when not close to expiration.

--
nosy: +Bill.Sobel

___
Python tracker 

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



[issue19213] platform.linux_distribution detects Oracle Linux as Red Hat Enterprise Linux

2013-10-09 Thread R. David Murray

R. David Murray added the comment:

You might expect that, but platform.linux_distribution is basing its report on 
what is in /etc/xxx-version or xxx-release.  Most likely this is an Oracle 
"bug", although they might be providing both their own version file and the 
version file for the RH release they are basing off of, in which case we could 
perhaps tweak the platform code to take that into account.  

Can you figure out which it is?

--
nosy: +lemburg, r.david.murray

___
Python tracker 

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



[issue19210] Unicode Objects in Tuples

2013-10-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Indeed, this is a feature, even though it may seem an odd one.

--
nosy: +pitrou
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue18177] Incorect quote marks in code section-headers in PDF version of docs

2013-10-09 Thread Tshepang Lekhonkhobe

Tshepang Lekhonkhobe added the comment:

A work-around: http://stackoverflow.com/a/16164658/321731.

--
versions: +Python 2.7

___
Python tracker 

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



  1   2   >