[issue16500] Add an 'atfork' module

2013-12-26 Thread xupeng

Changes by xupeng :


--
nosy: +xupeng

___
Python tracker 

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



[issue20069] Add unit test for os.chown

2013-12-26 Thread Vajrasky Kok

New submission from Vajrasky Kok:

There is no tests for os.chown except for the invalid input.

Attached the patch to add tests for os.chown. This test has not exercised the 
keyword `dir_fd` and `follow_symlinks` because `follow_symlinks` (I think) is 
kinda broken on Windows and I prefer to add unit test for `dir_fd` keyword in 
different ticket.

--
components: Tests
files: add_unit_test_os_chown.patch
keywords: patch
messages: 206936
nosy: vajrasky
priority: normal
severity: normal
status: open
title: Add unit test for os.chown
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file33266/add_unit_test_os_chown.patch

___
Python tracker 

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



[issue20069] Add unit test for os.chown

2013-12-26 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Here is the patch for Python 2.7.

--
Added file: 
http://bugs.python.org/file33267/add_unit_test_os_chown_python27.patch

___
Python tracker 

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



[issue9291] mimetypes initialization fails on Windows because of non-Latin characters in registry

2013-12-26 Thread Alexandr Zarubkin

Alexandr Zarubkin added the comment:

An alternative solution, which worked for me, is:
add file named sitecustomize.py in Lib\site-packages folder.

The contents of the file:
import sys
sys.setdefaultencoding("cp1251")

The default encoding should be determined for every localized Windows version.
Also, when creating virtual environments, the same file should be placed in 
site-packages folder of virtual environment being created prior to installing 
setuptools in it.

--
nosy: +me21
Added file: http://bugs.python.org/file33268/sitecustomize.py

___
Python tracker 

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



[issue19683] test_minidom has many empty tests

2013-12-26 Thread Zachary Ware

Zachary Ware added the comment:

Some refactoring of the tests is certainly acceptable.  If there are some tests 
that can be merged together, it is fine to do so; also for removing ones that 
don't make any sense (it's not like they've ever tested anything anyway :)).  
We don't have anyone listed as an expert on xml.dom.minidom (or the xml package 
as a whole), so we kind of have to just muddle along on our own with this.  Any 
tests you come up with to fill the empty ones will be better than no tests at 
all.  If someone with more experience with minidom comes along later and 
improves your tests, that will be great; but considering how long there have 
been this many empty tests in the file, I don't think that's terribly likely.

In fact, having looked at the test module in a bit more detail, it's in pretty 
sore need of an overall modernization.  The 'confirm' method is just a thin 
wrapper around assertTrue with an extremely unhelpful default message, and is 
used almost exclusively for all tests in the file.  So currently if anything 
breaks the tests will say "this failed, but I won't tell you why.  Good luck 
figuring it out!"  'confirm' should be removed, and all of the huge conditions 
passed into it throughout the file should be converted into individual 
assert*() calls.  It also looks like we could make use of setUp/tearDown to 
eliminate a lot of repetition (such as creating a base Document and 
subsequently removing it).

--

___
Python tracker 

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



[issue19938] Re-enable test_bug_1333982 on 3.x

2013-12-26 Thread Zachary Ware

Zachary Ware added the comment:

Here's a much better patch to 3.4.

--
Added file: http://bugs.python.org/file33269/test_dis_1333982-3.4.v2.diff

___
Python tracker 

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



[issue19938] Re-enable test_bug_1333982 on 3.x

2013-12-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
assignee:  -> zach.ware
stage: patch review -> commit review

___
Python tracker 

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



[issue20070] test_urllib2net is run even when the network resource is disabled

2013-12-26 Thread Matthias Klose

New submission from Matthias Klose:

test_urllib2net is run even when the network resource is disabled, unlike 
test_urllibnet:

run_tests.py -j 1 -w -uall,-network,-urlfetch
...
[349/380/6] test_urllib2net
Resource 'http://www.python.org/' is not available
Resource 'http://www.example.com' is not available
Resource 'http://bitly.com/urllibredirecttest' is not available
Resource 'http://www.imdb.com' is not available
Resource 'http://docs.python.org/2/glossary.html#glossary' is not available
Resource 'ftp://ftp.mirror.nl/pub/gnu/' is not available
Resource 'ftp://ftp.mirror.nl/pub/gnu/' is not available
Resource 'ftp://ftp.mirror.nl/pub/gnu/' is not available
Resource 'ftp://ftp.mirror.nl/pub/gnu/' is not available
Resource 'http://www.python.org' is not available
Resource 'http://www.python.org' is not available
Resource 'http://www.python.org' is not available
Resource 'http://www.python.org' is not available
[350/380/6] test_urllib_response
[351/380/6] test_urllibnet
test_urllibnet skipped -- Use of the 'network' resource not enabled
[352/380/6] test_urlparse
...

--
components: Tests
messages: 206942
nosy: doko
priority: normal
severity: normal
status: open
title: test_urllib2net is run even when the network resource is disabled
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



[issue20070] test_urllib2net is run even when the network resource is disabled

2013-12-26 Thread Matthias Klose

Changes by Matthias Klose :


--
nosy: +zach.ware

___
Python tracker 

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



[issue19938] Re-enable test_bug_1333982 on 3.x

2013-12-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e04fc45b7555 by Zachary Ware in branch '3.3':
Issue #19938: Re-enabled test_bug_1333982 in test_dis, which had been
http://hg.python.org/cpython/rev/e04fc45b7555

New changeset 285313c95e37 by Zachary Ware in branch 'default':
Issue #19938: Re-enabled test_bug_1333982 in test_dis, which had been
http://hg.python.org/cpython/rev/285313c95e37

--
nosy: +python-dev

___
Python tracker 

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



[issue19938] Re-enable test_bug_1333982 on 3.x

2013-12-26 Thread Zachary Ware

Zachary Ware added the comment:

Committed; thanks for the review, Serhiy!  I made similar changes to the 3.3 
patch before committing.

--
resolution:  -> fixed
stage: commit 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



[issue20070] test_urllib2net is run even when the network resource is disabled

2013-12-26 Thread Matthias Klose

Matthias Klose added the comment:

this fixes it for me:

--- a/Lib/test/test_urllib2net.py   Wed Dec 25 17:36:20 2013 +0200
+++ b/Lib/test/test_urllib2net.py   Thu Dec 26 17:05:47 2013 +0100
@@ -14,6 +14,8 @@
 except ImportError:
 ssl = None
 
+support.requires("network")
+
 TIMEOUT = 60  # seconds
 
 
@@ -339,5 +341,4 @@
 
 
 if __name__ == "__main__":
-support.requires("network")
 unittest.main()

--

___
Python tracker 

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



[issue20070] test_urllib2net is run even when the network resource is disabled

2013-12-26 Thread Zachary Ware

Zachary Ware added the comment:

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



[issue20070] test_urllib2net is run even when the network resource is disabled

2013-12-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e00bfb70a0c0 by doko in branch 'default':
- Issue #20070: Don't run test_urllib2net when network resources are not
http://hg.python.org/cpython/rev/e00bfb70a0c0

--
nosy: +python-dev

___
Python tracker 

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



[issue20071] What should happen if someone runs ./python -m ensurepip in the build environment?

2013-12-26 Thread R. David Murray

New submission from R. David Murray:

Someone on IRC reported doing this, and it (logically enough) gave a permission 
error trying to install into /opt.  That may be exactly what it should do...but 
if he'd done it as root, presumably it would have tried to install PIP without 
python having been installed first, which might be wrong.

(Donald says it would indeed install it, creating the directories as needed.)

--
messages: 206948
nosy: r.david.murray
priority: normal
severity: normal
status: open
title: What should happen if someone runs ./python -m ensurepip in the build 
environment?

___
Python tracker 

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



[issue20070] test_urllib2net is run even when the network resource is disabled

2013-12-26 Thread Matthias Klose

Matthias Klose added the comment:

fixed

--
status: open -> closed

___
Python tracker 

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



[issue20067] Tkinter variables no works with wantobject is false

2013-12-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b13c15a9ae54 by Serhiy Storchaka in branch '2.7':
Issue #20067: Tkinter variables now work when wantobjects is false.
http://hg.python.org/cpython/rev/b13c15a9ae54

New changeset fbc1a39b68e4 by Serhiy Storchaka in branch '3.3':
Issue #20067: Tkinter variables now work when wantobjects is false.
http://hg.python.org/cpython/rev/fbc1a39b68e4

New changeset 99df5128d978 by Serhiy Storchaka in branch 'default':
Issue #20067: Tkinter variables now work when wantobjects is false.
http://hg.python.org/cpython/rev/99df5128d978

--
nosy: +python-dev

___
Python tracker 

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



[issue20067] Tkinter variables no works with wantobject is false

2013-12-26 Thread Serhiy Storchaka

Changes by 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



[issue20072] Ttk tests fail when wantobjects is false

2013-12-26 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Ttk tests fail when wantobjects is false. See attached log file.

--
assignee: serhiy.storchaka
components: Tkinter
files: test_ttk_guionly.log
messages: 206951
nosy: gpolo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Ttk tests fail when wantobjects is false
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file33270/test_ttk_guionly.log

___
Python tracker 

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



[issue20072] Ttk tests fail when wantobjects is false

2013-12-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch fixes tkinter so that it now works when wantobjects is false (at 
least functions and methods return more sensible results) and fixes ttk tests 
so they conform to current behavior. If wantobjects is true, the behavior 
should not be changed.

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

___
Python tracker 

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



[issue20027] Fixed support for Indian locales

2013-12-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please make a decision about last patch, Marc-Andre?

--

___
Python tracker 

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



[issue20027] Fixed support for Indian locales

2013-12-26 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 26.12.2013 19:59, Serhiy Storchaka wrote:
> 
> Could you please make a decision about last patch, Marc-Andre?

Looks good. Thanks, Serhiy.

--

___
Python tracker 

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



[issue20027] Fixed support for Indian locales

2013-12-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset aad582f717da by Serhiy Storchaka in branch '2.7':
Issue #20027: Fixed locale aliases for devanagari locales.
http://hg.python.org/cpython/rev/aad582f717da

New changeset 7615c009e925 by Serhiy Storchaka in branch '3.3':
Issue #20027: Fixed locale aliases for devanagari locales.
http://hg.python.org/cpython/rev/7615c009e925

New changeset fff3f28733b4 by Serhiy Storchaka in branch 'default':
Issue #20027: Fixed locale aliases for devanagari locales.
http://hg.python.org/cpython/rev/fff3f28733b4

--
nosy: +python-dev

___
Python tracker 

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



[issue20027] Fixed support for Indian locales

2013-12-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> 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



[issue20074] open() of read-write non-seekable streams broken

2013-12-26 Thread Dolda2000

New submission from Dolda2000:

It seems open() is slightly broken in Python 3, in that one cannot open 
non-seekable files in read-write mode. One such common use is open("/dev/tty", 
"r+") for interacting directly with the controlling TTY regardless of standard 
stream redirections. Note that this is a regression for Python 2, where this 
worked as expected.

What happens is the following:
>>> open("/dev/tty", "r+")
Traceback (most recent call last):
  File "", line 1, in 
io.UnsupportedOperation: File or stream is not seekable.

Just for the record, the same thing happens with "w+" and "rb+".

This also means that the getpass module is slightly broken, since it will 
always fail whenever stdin is redirected.

--
components: IO
messages: 206957
nosy: Dolda2000
priority: normal
severity: normal
status: open
title: open() of read-write non-seekable streams broken
type: behavior
versions: Python 3.1, Python 3.3

___
Python tracker 

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



[issue16351] Add a function to get GC statistics

2013-12-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 17bd04fbf3d3 by R David Murray in branch 'default':
whatsnew for gc.get_stats, plus doc tweaks.
http://hg.python.org/cpython/rev/17bd04fbf3d3

--

___
Python tracker 

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



[issue20046] Optimize locale aliases table

2013-12-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is updated patch. It doesn't include any additions to locale alias table 
(including devanagari). Added several tests cases (many other test cases for 
removed aliases already exist). optimize() is called only once, looks as second 
run has no effect until UTF-8 aliases are enabled.

--
versions: +Python 3.4
Added file: http://bugs.python.org/file33272/locale_optimize_aliases_2.patch

___
Python tracker 

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



[issue20073] IDLE crashes on Unicode characters

2013-12-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> ronaldoussoren
components: +Macintosh
nosy: +hynek, kbk, ned.deily, roger.serwy, ronaldoussoren, terry.reedy

___
Python tracker 

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



[issue20074] open() of read-write non-seekable streams broken

2013-12-26 Thread R. David Murray

R. David Murray added the comment:

I don't think getpass will fail, since it uses os.open, not open.

Presumably you can work around the problem by opening the stream twice: once 
for reading and once for writing.  I'll leave it to Antoine to say whether or 
not that is in fact the expected solution, or if this is a design bug.

--
nosy: +pitrou, r.david.murray
versions: +Python 3.4 -Python 3.1

___
Python tracker 

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



[issue20074] open() of read-write non-seekable streams broken

2013-12-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Use unbuffered binary file.

>>> open("/dev/tty", "r+b", buffering=0)
<_io.FileIO name='/dev/tty' mode='rb+'>

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue20075] help(open) eats first line

2013-12-26 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The output of help(open) (and `pydoc open`) in 3.4 is:

Help on built-in function open in module io:

open(...)
errors=None, newline=None, closefd=True, opener=None) -> file object

Open file and return a stream.  Raise IOError upon failure.
...

In 3.3 and older it works correctly:

Help on built-in function open in module io:

open(...)
open(file, mode='r', buffering=-1, encoding=None,
 errors=None, newline=None, closefd=True, opener=None) -> file object

Open file and return a stream.  Raise IOError upon failure.
...

--
components: Interpreter Core
keywords: 3.3regression
messages: 206962
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: help(open) eats first line
type: behavior
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



[issue20073] IDLE crashes on Unicode characters

2013-12-26 Thread Ned Deily

Ned Deily added the comment:

Please follow the instructions at http://www.python.org/getit/mac/tcltk/ and 
install an up-to-date third-party version of Tcl/Tk 8.5 such as ActiveTcl 
8.5.15.0.  This crash has been fixed in the newer versions of Cocoa Tk but 
still present in the Apple-supplied Tk 8.5 in OS X.

--
resolution:  -> duplicate
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



[issue20046] Optimize locale aliases table

2013-12-26 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 26.12.2013 21:19, Serhiy Storchaka wrote:
> 
> Here is updated patch. It doesn't include any additions to locale alias table 
> (including devanagari). Added several tests cases (many other test cases for 
> removed aliases already exist). optimize() is called only once, looks as 
> second run has no effect until UTF-8 aliases are enabled.

Looks good. Could you add a test for the optimization function ?

It should make sure that a complete set of now removed locale
names are properly optimized away, e.g.

 'nl_nl':'nl_NL.ISO8859-1',
-'nl_nl.88591':  'nl_NL.ISO8859-1',
-'nl_nl.iso88591':   'nl_NL.ISO8859-1',
-'nl_nl.iso885915':  'nl_NL.ISO8859-15',
-'nl_nl.iso885915@euro': 'nl_NL.ISO8859-15',
-'nl_nl.utf8@euro':  'nl_NL.UTF-8',
-'nl_nl@euro':   'nl_NL.ISO8859-15',

and

 'ja_jp':'ja_JP.eucJP',
-'ja_jp.ajec':   'ja_JP.eucJP',
 'ja_jp.euc':'ja_JP.eucJP',
-'ja_jp.eucjp':  'ja_JP.eucJP',
-'ja_jp.iso-2022-jp':'ja_JP.JIS7',
-'ja_jp.iso2022jp':  'ja_JP.JIS7',
-'ja_jp.jis':'ja_JP.JIS7',
-'ja_jp.jis7':   'ja_JP.JIS7',
 'ja_jp.mscode': 'ja_JP.SJIS',
 'ja_jp.pck':'ja_JP.SJIS',
-'ja_jp.sjis':   'ja_JP.SJIS',
-'ja_jp.ujis':   'ja_JP.eucJP',

This should then cover all the Latin-1 encodings and also
an Asian one.

Thanks,
-- 
Marc-Andre Lemburg
eGenix.com

--

___
Python tracker 

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



[issue20075] help(open) eats first line

2013-12-26 Thread Zachary Ware

Zachary Ware added the comment:

Interestingly, it doesn't look like pydoc's fault:

P:\ath\to\cpython\>PCbuild\python_d.exe -ISc "import 
sys;print(sys.version);print(open.__doc__[:75]);print('pydoc' in sys.modules)"
3.4.0b1 (default:94a04b8b3a12, Dec 26 2013, 09:27:14) [MSC v.1600 32 bit 
(Intel)]
 errors=None, newline=None, closefd=True, opener=None) -> file object


False

--
nosy: +zach.ware

___
Python tracker 

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



[issue20046] Optimize locale aliases table

2013-12-26 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 26.12.2013 22:43, Serhiy Storchaka wrote:
> 
> Serhiy Storchaka added the comment:
> 
>> Could you add a test for the optimization function ?
> 
> I have no ideas. The optimization function is a part of the 
> makelocalealias.py 
> which ran manually very rarely (last time 3.5 year ago). It isn't exposed 
> outside the script and I'm not sure that it worths the complication of the 
> testing.

I probably wasn't clear: I meant some tests that show that the
alias definitions (on the left) from the X11 file are actually mapped to the
correct alias locales (on the right).

>> It should make sure that a complete set of now removed locale
>> names are properly optimized away, e.g.
>>
>>  'nl_nl':'nl_NL.ISO8859-1',
>> -'nl_nl.88591':  'nl_NL.ISO8859-1',
>> -'nl_nl.iso88591':   'nl_NL.ISO8859-1',
>> -'nl_nl.iso885915':  'nl_NL.ISO8859-15',
>> -'nl_nl.iso885915@euro': 'nl_NL.ISO8859-15',
>> -'nl_nl.utf8@euro':  'nl_NL.UTF-8',
>> -'nl_nl@euro':   'nl_NL.ISO8859-15',
> 
> These cases are covered by test_english and test_euro_modifier.

Ok.

>>  'ja_jp':'ja_JP.eucJP',
>> -'ja_jp.ajec':   'ja_JP.eucJP',
>>  'ja_jp.euc':'ja_JP.eucJP',
>> -'ja_jp.eucjp':  'ja_JP.eucJP',
>> -'ja_jp.iso-2022-jp':'ja_JP.JIS7',
>> -'ja_jp.iso2022jp':  'ja_JP.JIS7',
>> -'ja_jp.jis':'ja_JP.JIS7',
>> -'ja_jp.jis7':   'ja_JP.JIS7',
>>  'ja_jp.mscode': 'ja_JP.SJIS',
>>  'ja_jp.pck':'ja_JP.SJIS',
>> -'ja_jp.sjis':   'ja_JP.SJIS',
>> -'ja_jp.ujis':   'ja_JP.eucJP',
> 
> Here is a test which includes tests for japanese cases end tests for the euc 
> encoding (it maps to different encodings depending on language).

Thanks. I think this is good enough now.

--

___
Python tracker 

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



[issue20075] help(open) eats first line

2013-12-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Indeed. However in Modules/_io/_iomodule.c:

PyDoc_STRVAR(open_doc,
"open(file, mode='r', buffering=-1, encoding=None,\n"
" errors=None, newline=None, closefd=True, opener=None) -> file object\n"
"\n"
"Open file and return a stream.  Raise IOError upon failure.\n"
...

Perhaps Larry has relations to this.

--
nosy: +larry

___
Python tracker 

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



[issue20075] help(open) eats first line

2013-12-26 Thread Meador Inge

Meador Inge added the comment:

Looks like the changes from 78ec18f5cb45 attempt to skip the signature,
but can't handle multi-line signatures.

--
nosy: +meador.inge

___
Python tracker 

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



[issue20046] Optimize locale aliases table

2013-12-26 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 26.12.2013 23:19, Serhiy Storchaka wrote:
> 
> Serhiy Storchaka added the comment:
> 
>> I probably wasn't clear: I meant some tests that show that the
>> alias definitions (on the left) from the X11 file are actually mapped to the
>> correct alias locales (on the right).
> 
> This is how the optimization function works. It updates alias table with the 
> X11 file, and then removes the alias entities one by one and checks that the 
> alias definition are mapped to to correct alias locales.
> 
> Here is a patch which adds a self-check in the makelocalealias.py script.

Thanks, this makes that part of the implementation waterproof as well.

Good to go, I guess.

--

___
Python tracker 

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



[issue20046] Optimize locale aliases table

2013-12-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 63bc68d7f449 by Serhiy Storchaka in branch 'default':
Issue #20046: Locale alias table no longer contains entities which can be
http://hg.python.org/cpython/rev/63bc68d7f449

--
nosy: +python-dev

___
Python tracker 

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



[issue20046] Optimize locale aliases table

2013-12-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Marc-Andre for your reviews.

--
assignee:  -> 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



[issue20076] Add UTF-8 locale aliases

2013-12-26 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The makelocalealias.py ignores UTF-8 mapping. Expected that this encoding is 
available for all locales. After enabling UTF-8 mapping in makelocalealias.py 
most aliases are optimized out except following:

+'be_bg.utf8':   'bg_BG.UTF-8',
+'c.utf8':   'en_US.UTF-8',
+'en_dl.utf8':   'en_DL.UTF-8',
+'en_zw.utf8':   'en_ZS.UTF-8',
+'ks_in@devanagari.utf8':'ks_IN.UTF-8@devanagari',
+'pa_pk.utf8':   'pa_PK.UTF-8',
+'sd_in@devanagari.utf8':'sd_IN.UTF-8@devanagari',
+'sr_yu.utf8':   'sr_RS.UTF-8',
+'sr_yu.utf8@cyrillic':  'sr_RS.UTF-8',
+'te_in.utf8':   'te_IN.UTF-8',
+'zh_sg.utf8':   'zh_SG.UTF-8',

Some of them maps to other country (en_zw.utf8 to en_ZS.UTF-8, sr_yu.utf8 to 
sr_RS.UTF-8) and these mappings are different from base mappings (en_zw to 
en_ZW.ISO8859-1, sr_yu to sr_RS.UTF-8@latin). The devanagari mappings just maps 
illformed locales. c.utf8 is yet one special case. Other mappings have no base 
entity without encoding.

Here is a patch which enables UTF-8 mapping in makelocalealias.py and adds all 
these mappings to locale alias table.

--
components: Library (Lib)
files: locale_utf8_aliases.patch
keywords: patch
messages: 206974
nosy: lemburg, loewis, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Add UTF-8 locale aliases
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file33275/locale_utf8_aliases.patch

___
Python tracker 

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



[issue20075] help(open) eats first line

2013-12-26 Thread Gennadiy Zlobin

Gennadiy Zlobin added the comment:

Hi guys,

probably this patch can fix it?

--
keywords: +patch
nosy: +gennad
Added file: http://bugs.python.org/file33276/20075.patch

___
Python tracker 

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



[issue20054] IDLE won't work (Mac)

2013-12-26 Thread Sophie Chancheong

Sophie Chancheong added the comment:

Sorry for not replying,

I followed the solution on the other thread and got it to work! Thank you so 
much for your help!!

--

___
Python tracker 

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



[issue20077] Format of TypeError differs between comparison and arithmetic operators

2013-12-26 Thread Mitchell Model

New submission from Mitchell Model:

[ctypes correct component for this?]

The TypeError messages given for incompatible types in comparison operators 
differ from incompatible types in arithmetic operators. The arithmetic operator 
error messages show the names of the types in single quotes, while the 
comparison error messages do not use quotes but follow the name of the type 
with a pair of parens. Seems like these should be analogous.

 class foo(): pass
... 
>>> foo() + 1
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unsupported operand type(s) for +: 'foo' and 'int'
>>> foo() < 1
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unorderable types: foo() < int()

--
components: ctypes
messages: 206977
nosy: MLModel
priority: normal
severity: normal
status: open
title: Format of TypeError differs between comparison and arithmetic operators
type: behavior
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue20078] zipfile - ZipExtFile.read goes into 100% CPU infinite loop on maliciously binary edited zips

2013-12-26 Thread Nandiya

New submission from Nandiya:

I am using the zipfile module on a webserver which provides a service which 
processes files in zips uploaded by users, while hardening against zip bombs, I 
tried binary editing a zip to put in false file size information. The result is 
interesting, when with a ZIP_STORED file, or with carefully crafted 
ZIP_DEFLATED file (and perhaps ZIP_BZIP2 and ZIP_LZMA for craftier hackers than 
I), when the stated file size exceeds the size of the archive itself, 
ZipExtFile.read goes into an infinite loop, consuming 100% CPU.

The following methods on such an archive all result in an infinite loop:
ZipExtFile.read
ZipExtFile.read(n)
ZipExtFile.readlines
ZipFile.extract
ZipFile.extractall


ZipExtFile.read1 silently returns corrupt data but does not hang.

Obviously the module doesn't need to bend over backwards to deal gracefully 
with deliberately and maliciously crafted input, since all the user hopes for 
is to bring the program crashing down, but the 100% CPU infinite loop is 
probably one of the less satisfactory possible failure modes. It should either 
raise an exception or do something like read1 and silently return corrupt data.

This is low priority except for security since unless a zip is maliciously 
crafted some kind of exception will almost certainly be raised due to a 
decompression or invalid zip exception.

--
components: IO, Library (Lib)
files: malzip.py
messages: 206978
nosy: nandiya
priority: normal
severity: normal
status: open
title: zipfile - ZipExtFile.read goes into 100% CPU infinite loop on 
maliciously binary edited zips
type: security
versions: Python 2.7, Python 3.3
Added file: http://bugs.python.org/file33277/malzip.py

___
Python tracker 

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



[issue19683] test_minidom has many empty tests

2013-12-26 Thread Julian Gindi

Julian Gindi added the comment:

Modernizing these tests will be a decent undertaking but seems important. I'll 
go a head and try to fix these up further. Thanks for the guidance and 
motivation on this one :)

--

___
Python tracker 

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



[issue20074] open() of read-write non-seekable streams broken

2013-12-26 Thread Dolda2000

Dolda2000 added the comment:

>I don't think getpass will fail, since it uses os.open, not open.

It also uses fdopen() on the resulting file descriptor, however, which has the 
same problem.

>Use unbuffered binary file.

It's nice that that's at least possible, but I, for one, would still consider 
it a bug that it isn't possible to open it in text mode.

--

___
Python tracker 

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



[issue20076] Add UTF-8 locale aliases

2013-12-26 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue20074] open() of read-write non-seekable streams broken

2013-12-26 Thread Dolda2000

Dolda2000 added the comment:

Just to demonstrate failure of getpass, by the way:

$ cat >/tmp/pwtest.py
import getpass
print(getpass.getpass())
$ python3 /tmp/pwtest.py 
print(getpass.getpass())
  File "/usr/lib/python3.3/getpass.py", line 83, in unix_getpass
passwd = fallback_getpass(prompt, stream)
  File "/usr/lib/python3.3/getpass.py", line 118, in fallback_getpass
return _raw_input(prompt, stream)
  File "/usr/lib/python3.3/getpass.py", line 134, in _raw_input
raise EOFError
EOFError

--

___
Python tracker 

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



[issue20074] open() of read-write non-seekable streams broken

2013-12-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> It's nice that that's at least possible, but I, for one, would still consider 
> it a bug that it isn't possible to open it in text mode.

>>> io.TextIOWrapper(open("/dev/tty", "r+b", buffering=0))
<_io.TextIOWrapper name='/dev/tty' encoding='UTF-8'>

> Just to demonstrate failure of getpass, by the way:

Looks as this was fixed in issue18116 for 3.4. David, perhaps issue18116 should 
be backported to older Python versions.

--
nosy: +benjamin.peterson, hynek, stutzbach

___
Python tracker 

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



[issue20074] open() of read-write non-seekable streams broken

2013-12-26 Thread Dolda2000

Dolda2000 added the comment:

Python 3.3.3 (default, Dec  8 2013, 14:51:59) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import io
>>> io.TextIOWrapper(open("/dev/tty", "rb+"))
Traceback (most recent call last):
  File "", line 1, in 
io.UnsupportedOperation: File or stream is not seekable.

Was this also fixed in 3.4?

--

___
Python tracker 

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



[issue20075] help(open) eats first line

2013-12-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
stage:  -> commit review

___
Python tracker 

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