[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-06-01 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Ok, here is the updated patch based on R. David Murray's help. Thanks!

--
Added file: 
http://bugs.python.org/file35424/bytes_parser_dont_close_file_v4.patch

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



[issue21623] build ssl failed use vs2010 express

2014-06-01 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +steve.dower, zach.ware

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



[issue18132] buttons in turtledemo disappear on small screens

2014-06-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I believe I have read more than one warning to not mix grid and pack in the 
same master, as your patch does. For example: 
http://effbot.org/tkinterbook/grid.htm, An option would be to grid everything. 
I believe grid would also fix issue #21597, so I may try it and see if it fixes 
both issue without introducing a scrollbar problem.

--

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



[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit

2014-06-01 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Here's a patch with a unittest that reproduces the problem with fixes to stop 
using any end_fds.  The max fd is only ever used in the absolute fallback 
situation where no way to get a list of open fd's is available. In that case it 
is obtained from sysconf() at the time it is needed rather than module load 
time as sysconf() is async-signal-safe.

I'm not worried about calling close() an additional time on EINTR in the single 
threaded child process prior to exec().  The most that will happen is one extra 
call with a different error if the fd is in a bad state from the previous one.  
That is better than any chance of one being left open.

--
stage:  - patch review
type: security - behavior
Added file: http://bugs.python.org/file35425/issue21618-34-gps01.diff

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



[issue21592] Make statistics.median run in linear time

2014-06-01 Thread Stefan Behnel

Stefan Behnel added the comment:

I tried the same with a Cython compiled version of select.py in the latest 
CPython 3.5 build. It pretty clearly shows that select2 is pretty much always 
faster than sorting, by a factor of 2-5x or so. I'll also attach the annotated 
source file that Cython generates.

*** CPython 3.5 (de01f7c37b53)

== Single call mode ==
Nsort select7  select23 select47 select97 select   select2
       
50000.0000.0010.0010.0010.0010.0010.001
   10.0010.0030.0020.0020.0020.0030.002
   50.0050.0150.0100.0100.0100.0130.008
  100.0120.0320.0230.0230.0230.0270.017
  500.0850.1740.1310.1290.1550.1670.103
 1000.1900.3750.3000.2720.3110.4560.292
 2000.4220.8280.5880.5790.6890.8650.560
 3000.6801.1870.9180.9060.9151.4270.801
 4000.9481.5741.1801.1461.1771.6591.004
 5001.2532.0271.6841.5231.5981.8741.085
 6001.5772.4411.8921.7541.7872.6591.055
 7001.9342.8702.1282.0622.0933.2891.274
 8002.2793.3042.4302.4212.4712.5692.449
 9002.5603.7672.8352.7682.7713.0892.348
10002.7904.1233.1533.0443.0974.3663.764
11003.1994.6053.6583.4673.3833.8674.599
Total elapsed time: 9.13 minutes


*** Cython / CPython 3.5

== Single call mode ==
Nsort select7  select23 select47 select97 select   select2
       
50000.0000.0010.0000.0000.0010.0000.000
   10.0010.0010.0010.0010.0010.0000.000
   50.0060.0060.0050.0050.0060.0010.001
  100.0130.0140.0110.0120.0130.0040.004
  500.0890.0910.0730.0750.0790.0480.049
 1000.2000.1920.1560.1580.1940.0810.073
 2000.4510.4170.3240.3550.4040.2100.135
 3000.6780.6140.4960.5010.5300.2910.277
 4000.9800.8350.7200.6800.7180.4020.441
 5001.2761.1970.8460.8570.9050.4910.425
 6001.5351.2741.0671.0401.0870.5340.451
 7001.8421.5001.2261.2141.2790.5490.507
 8002.1681.7261.3841.3981.4910.5570.535
 9002.4381.9871.5661.5821.6600.9660.544
10002.7682.1871.7471.7731.9111.1160.640
11003.1162.4171.9221.9502.0631.2831.024
Total elapsed time: 5.48 minutes

--
nosy: +scoder
Added file: http://bugs.python.org/file35426/select.pxd

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



[issue21592] Make statistics.median run in linear time

2014-06-01 Thread Stefan Behnel

Changes by Stefan Behnel sco...@users.sourceforge.net:


Added file: http://bugs.python.org/file35427/select.html

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



[issue21592] Make statistics.median run in linear time

2014-06-01 Thread Stefan Behnel

Stefan Behnel added the comment:

Here's also the pathological average of three calls case. As Steven suggests, 
it shows that select() suffers quite heavily (algorithmically), but select2() 
also suffers enough to jump up to about 2/3 of the runtime of sorting (so it's 
still 1/3 faster even here). This sounds like select2 should be much faster on 
random data (run 1) and about as fast on sorted data (runs 2+3). Not 
unexpected, given the algorithmical characteristics of Timsort.

== Average of three calls mode ==
Nsort select7  select23 select47 select97 select   select2
       
50000.0000.0020.0010.0010.0020.0010.000
   10.0010.0040.0030.0030.0030.0010.001
   50.0060.0180.0170.0160.0160.0110.003
  100.0130.0370.0290.0310.0370.0160.009
  500.0910.2460.2040.2160.2270.2180.057
 1000.2050.5350.4430.4340.4590.5300.156
 2000.4581.1370.9170.9221.0522.1240.328
 3000.7341.7431.4481.5101.6072.8050.500
 4001.0102.4001.8882.0292.1573.0390.655
 5001.2783.0212.4582.4042.7174.7890.853
 6001.5713.6292.8733.0943.2794.1361.030
 7001.8844.2583.5203.6213.5307.7881.312
 8002.1984.9774.0424.1754.0809.0351.446
 9002.5255.5554.5394.7234.633   10.9331.608
10002.8446.3454.9295.0355.588   10.3981.852
11003.1947.0815.8225.9736.1838.2912.111
Total elapsed time: 13.33 minutes

--

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



[issue21605] Add tests for Tkinter images

2014-06-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fcbb15edb73a by Serhiy Storchaka in branch '2.7':
Issue #21605: Added tests for Tkinter images.
http://hg.python.org/cpython/rev/fcbb15edb73a

New changeset 6c8b2ab55976 by Serhiy Storchaka in branch '3.4':
Issue #21605: Added tests for Tkinter images.
http://hg.python.org/cpython/rev/6c8b2ab55976

New changeset 13254db884e9 by Serhiy Storchaka in branch 'default':
Issue #21605: Added tests for Tkinter images.
http://hg.python.org/cpython/rev/13254db884e9

--
nosy: +python-dev

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



[issue21605] Add tests for Tkinter images

2014-06-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue21459] DragonFlyBSD support

2014-06-01 Thread Thomas Klausner

Thomas Klausner added the comment:

Actually, there are even less changes needed nowadays.
Please apply this really small patch.

--
Added file: http://bugs.python.org/file35428/dragonfly.diff

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



[issue21459] DragonFlyBSD support

2014-06-01 Thread Thomas Klausner

Changes by Thomas Klausner t...@giga.or.at:


Removed file: http://bugs.python.org/file35195/dragonfly.diff

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



[issue21592] Make statistics.median run in linear time

2014-06-01 Thread Stefan Behnel

Stefan Behnel added the comment:

Updating the type declaration file to remove the dependency on the list builtin 
and allow arbitrary containers. The test code has this dependency (calls 
a.sort()), but the current statistics module in the stdlib does not (calls 
sorted()). Timings do not change, at least not more than you would expect by 
randomisation (i.e. repeated runs go up and down within the same bounds). Note 
that the timings are still specific to lists and would be higher for other 
containers.

--
Added file: http://bugs.python.org/file35429/select.pxd

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



[issue21592] Make statistics.median run in linear time

2014-06-01 Thread Stefan Behnel

Changes by Stefan Behnel sco...@users.sourceforge.net:


Added file: http://bugs.python.org/file35430/select.html

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



[issue21625] help()'s more-mode is frustrating

2014-06-01 Thread Ned Batchelder

New submission from Ned Batchelder:

From the #python IRC channel:

```
[07:55:29] tonysar   hello.new to programming and python, i use mac 
terminal but problem i have is , when i use help function of python to look up 
something , i lose my prompt and i have no idea how to go back , what i do is 
close the terminal and restart , is there any way to go back to prompt again ?
[07:57:12] nedbattonysar: type a q
[07:57:26] nedbattonysar: it works like the unix-standard more 
program.
[07:58:10] nedbattonysar: looking at it through your eyes, it's 
crazy-unhelpful that it only accepts a q
[07:58:42] tonysar   nedbat: thanks but i can not type anything , after 
using help(object) i get the info on object i look and there is END at the 
bottom of python terminal and i can not type anything after or before
[07:59:03] nedbattonysar: what happens if you type q ?
[07:59:24] nedbattonysar: just the single letter q
[07:59:41] tonysar   nedbat . thanks
[07:59:47] tonysar   the q worked
[08:01:08] tonysar   nedbat:Thanks. typing q got me back to prompt again . 
thanks again
```

Why does help() enter a more-mode for even short help?  Why doesn't ENTER get 
you out of it?  Why doesn't the prompt have a suggestion of how to get out of 
it?  Why does it clear the screen when you are done with it, removing all the 
help from the screen?

It seems very geeky, and not that help-ful.  I'm sure there's something we can 
do to make this a little easier for newbs.

--
messages: 219497
nosy: nedbat
priority: normal
severity: normal
status: open
title: help()'s more-mode is frustrating
versions: Python 2.7, Python 3.5

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



[issue21592] Make statistics.median run in linear time

2014-06-01 Thread Julian Taylor

Julian Taylor added the comment:

in the case of the median you can archive similar performance to a multiselect 
by simply calling min([len(data) // 2 + 1]) for the second order statistic 
which you need for the averaging of even number of elements.

maybe an interesting datapoint would be to compare with numpys selection 
algorithm which is a intromultiselect (implemented in C for native datattypes).
It uses a standard median of 3 quickselect with a cutoff in recursion depth to 
median of median of group of 5.
the multiselect is implemented using a sorted list of kth order statistics and 
reducing the search space for each kth by maintaining a stack of all visited 
pivots.
E.g. if you search for 30 and 100, when during the search for 30 one has 
visited pivot 70 and 110, the search for 100 only needs to select in l[70:110].
The not particularly readable implementation is in: 
./numpy/core/src/npysort/selection.c.src
unfortunately for object types it currently falls back to quicksort so you 
can't directly compare performance with the pure python variants.

--
nosy: +jtaylor

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



[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-06-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Removed file: http://bugs.python.org/file35402/tkinter_bytes.patch

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



[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-06-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Added file: http://bugs.python.org/file35431/tkinter_bytes.patch

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



[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-06-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Unfortunately we can't use this straightforward and universal solution in 
Python 2. Here is a patch which adds special workarounds to fix this issue in 
2.7.

--
Added file: http://bugs.python.org/file35432/tkinter_bytes-2.7.patch

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



[issue21459] DragonFlyBSD support

2014-06-01 Thread Thomas Klausner

Thomas Klausner added the comment:

Semaphore handling needs another change.
if sem_open etc. are not provided by the operating system, do not export them 
(Modules/_multiprocessing/multiprocessing.c). Updated diff attached.
That part of the diff might affect more operating systems.

--
Added file: http://bugs.python.org/file35433/dragonfly.diff

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



[issue21459] DragonFlyBSD support

2014-06-01 Thread Thomas Klausner

Changes by Thomas Klausner t...@giga.or.at:


Removed file: http://bugs.python.org/file35428/dragonfly.diff

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



[issue21552] String length overflow in Tkinter

2014-06-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue21626] Add options width and compact to pickle cli

2014-06-01 Thread B. Clausius

New submission from B. Clausius:

The attached patch add this options to python3 -m pickle cli:
  -w WIDTH, --width WIDTH
maximum number of characters per line
  -c, --compact display as many items as will fit on each output line
The options are forwarded as kwargs to pprint.pprint

--
components: Library (Lib)
files: pickle_cli-options_width_and_compact.patch
keywords: patch
messages: 219501
nosy: barcc
priority: normal
severity: normal
status: open
title: Add options width and compact to pickle cli
type: enhancement
versions: Python 3.5
Added file: 
http://bugs.python.org/file35434/pickle_cli-options_width_and_compact.patch

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



[issue21626] Add options width and compact to pickle cli

2014-06-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +alexandre.vassalotti, pitrou

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



[issue18504] IDLE:Improvements- Improving Mock_Text

2014-06-01 Thread Saimadhav Heblikar

Saimadhav Heblikar added the comment:

This patch tries to enable mock_Tk.Text._decode to handle the following patterns
insert linestart
insert lineend
insert wordstart
insert wordend
insert +x chars
insert -x chars

These additions are required for testing AutoExpand and are written keeping the 
same in mind. Also, adds respective tests for test_decode in test_text.py.

I would like to know if my approach is acceptable or whether it needs changes.

issue18292 is about adding unittests for AutoExpand.

(A 2.7 patch will be submitted once the above changes become acceptable)

--
nosy: +jesstess, sahutd
Added file: http://bugs.python.org/file35435/mock-text-_decode.diff

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



[issue21623] build ssl failed use vs2010 express

2014-06-01 Thread Mo Jia

Mo Jia added the comment:

Another error is .

  cd D:\Hg\Python\Python\PCbuild\
  D:\Hg\Python\Python\PCbuild\python_d.exe build_ssl.py Release Win32 -a

  Found a working perl at 'C:\Perl\bin\perl.exe'
  Traceback (most recent call last):
File build_ssl.py, line 253, in module
  main()
File build_ssl.py, line 181, in main
  ssl_dir = get_ssl_dir()
File build_ssl.py, line 70, in get_ssl_dir
  m = re.search('openssl-([^]+)', f.read())
  UnicodeDecodeError: 'gbk' codec can't decode byte 0xbf in position 2: illegal 
multibyte sequence
C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error 
MSB3073: The command cd D:\Hg\Python\Python\PCbuild\ 
[D:\Hg\Python\Python\PCbuild\ssl. vcxproj]
C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error 
MSB3073: D:\Hg\Python\Python\PCbuild\python_d.exe build_ssl.py Release Win32 
-a [D:\Hg\ Python\Python\PCbuild\ssl.vcxproj]
C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error 
MSB3073:  exited with code 1. [D:\Hg\Python\Python\PCbuild\ssl.vcxproj]

--

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



[issue18292] IDLE Improvements: Unit test for AutoExpand.py

2014-06-01 Thread Saimadhav Heblikar

Saimadhav Heblikar added the comment:

Attached patch adds unittest for idlelib`s AutoExpand.

Depends on issue18504 for Text's mocking abilities.

--
keywords: +patch
nosy: +jesstess, sahutd
Added file: http://bugs.python.org/file35436/test-autoexpand.diff

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



[issue21401] python2 -3 does not warn about str/unicode to bytes conversions and comparisons

2014-06-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think that even if we accept this change (I am unsure in this), a warning 
should be raised only when bytes and unicode objects are equal. When they are 
not equal, a warning should not be raised, because this matches Python 3 
behavior.

--

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



[issue1669539] Improve Windows os.path.join (ntpath.join) smart joining

2014-06-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
status: open - pending

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



[issue21231] Issue a python 3 warning when old style classes are defined.

2014-06-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
status: open - pending

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



[issue18492] Allow all resources if not running under regrtest.py

2014-06-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
assignee:  - zach.ware

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



[issue19656] Add Py3k warning for non-ascii bytes literals

2014-06-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Benjamin, what you think about this?

--

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



[issue20361] -W command line options and PYTHONWARNINGS environmental variable should not override -b / -bb command line options

2014-06-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
stage: patch review - needs patch

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



[issue20168] Derby: Convert the _tkinter module to use Argument Clinic

2014-06-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Synchronized with tip.

--
Added file: http://bugs.python.org/file35437/tkinter_clinic_3.patch

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



[issue20148] Derby: Convert the _sre module to use Argument Clinic

2014-06-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Added file: http://bugs.python.org/file35438/sre_clinic_3.patch

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



[issue14019] Unify tests for str.format and string.Formatter

2014-06-01 Thread moijes12

moijes12 added the comment:

 Note that this issue wasn't about the formatter module - it relates to the 
 str.format() method and the string.Formatter *class*.

I would tend to agree with Nick and Eric. From what I see in the patch, the 
tests are for formatter module and not the string.Formatter class.

--
nosy: +moijes12

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



[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit

2014-06-01 Thread Steven Stewart-Gallus

Steven Stewart-Gallus added the comment:

Thank you for the very quick patch Gregory P. Smith.

It's fair enough if you don't bother to fix the EINTR issue.

One small note:

 +Confirm that issue21618 is fixed (mail fail under valgrind).

That's a typo right? Shouldn't it be may instead of mail?

--

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



[issue21627] Concurrently closing files and iterating over the open files directory is not well specified

2014-06-01 Thread Steven Stewart-Gallus

New submission from Steven Stewart-Gallus:

Hello,

I noticed some possible bad behaviour while working on Python issue
21618 (see http://bugs.python.org/issue21618). Python has the
following code in _posixsubmodules.c for closing extra files before
spawning a process:

static void
_close_open_fd_range_safe(int start_fd, int end_fd, PyObject* py_fds_to_keep)
{
int fd_dir_fd;
if (start_fd = end_fd)
return;

fd_dir_fd = _Py_open(FD_DIR, O_RDONLY);
if (fd_dir_fd == -1) {
/* No way to get a list of open fds. */
_close_fds_by_brute_force(start_fd, end_fd, py_fds_to_keep);
return;
} else {
char buffer[sizeof(struct linux_dirent64)];
int bytes;
while ((bytes = syscall(SYS_getdents64, fd_dir_fd,
(struct linux_dirent64 *)buffer,
sizeof(buffer)))  0) {
struct linux_dirent64 *entry;
int offset;
for (offset = 0; offset  bytes; offset += entry-d_reclen) {
int fd;
entry = (struct linux_dirent64 *)(buffer + offset);
if ((fd = _pos_int_from_ascii(entry-d_name))  0)
continue;  /* Not a number. */
if (fd != fd_dir_fd  fd = start_fd  fd  end_fd 
!_is_fd_in_sorted_fd_sequence(fd, py_fds_to_keep)) {
while (close(fd)  0  errno == EINTR);
}
}
}
close(fd_dir_fd);
}
}

In the code FD_DIR is /proc/self/fd on Linux. I'm not sure this code
is correct. This seems as if it would have the same problems as
iterating over a list and modifying it at the same time.

I can think of a few solutions but they all have problems.

One could allocate a list of open files once and then iterate through
that list and close the files but this is not signal safe so this
solution is incorrect. One possible workaround is to use mmap to
allocate the memory. This is a direct system call and I don't see a
reason for it not to be signal safe but I'm not sure. One neat hack
would be too mmap the memory ahead of time and then rely on lazy
paging to allocate the memory lazily. Another solution is to search
for the largest open file and then iterate over and close all the
possible file descriptors in between. So far most possible solutions
just seem really hacky to me though.

I feel the best solution is to let the OS close the files and to set
the O_CLOEXEC flag on the files that need to be closed.

--
messages: 219510
nosy: sstewartgallus
priority: normal
severity: normal
status: open
title: Concurrently closing files and iterating over the open files directory 
is not well specified

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



[issue21628] 2to3 does not fix zip in some cases

2014-06-01 Thread RobertG

New submission from RobertG:

Consider this program

def foo(a,b):
return min(zip(a,b)[2])

print foo(range(5), (0,9,-9))

With the default options, 2to3 rewrites this as

def foo(a,b):
return min(zip(a,b)[2])

print(foo(list(range(5)), (0,9,-9)))

For some reason, 2to3 fails to wrap the call to zip in a list, even though the 
2to3 documentation says that there is a fixer which does this. Obviously, the 
generated code will not work in Python 3 since you can't subscript an iterator.

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 219511
nosy: RobertG
priority: normal
severity: normal
status: open
title: 2to3 does not fix zip in some cases
versions: Python 3.4

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



[issue21629] clinic.py --converters fails

2014-06-01 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

$ ./python Tools/clinic/clinic.py --converters

Legacy converters:
Traceback (most recent call last):
  File Tools/clinic/clinic.py, line 4199, in module
sys.exit(main(sys.argv[1:]))
  File Tools/clinic/clinic.py, line 4131, in main
print('' + ' '.join(c for c in legacy if c[0].isupper()))
  File Tools/clinic/clinic.py, line 4131, in genexpr
print('' + ' '.join(c for c in legacy if c[0].isupper()))
IndexError: string index out of range

As I see, the problem is in the self converter which has empty format_unit.

--
components: Demos and Tools
messages: 219512
nosy: larry, serhiy.storchaka
priority: normal
severity: normal
status: open
title: clinic.py --converters fails
type: behavior
versions: Python 3.4, Python 3.5

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



[issue21630] List Dict bug?

2014-06-01 Thread Robert w

New submission from Robert w:

outer for loop loops n  1 times, when it should loop one time.

Variations are possible tht the bug doesn't occur.

--
components: Interpreter Core
files: bug.py
messages: 219513
nosy: Robert.w
priority: normal
severity: normal
status: open
title: List Dict bug?
type: behavior
versions: Python 2.7, Python 3.3
Added file: http://bugs.python.org/file35439/bug.py

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



[issue21630] List Dict bug?

2014-06-01 Thread Robert w

Changes by Robert w robert...@googlemail.com:


--
status: open - closed

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



[issue21631] List/Dict Combination Bug

2014-06-01 Thread Robert w

New submission from Robert w:

outer for loop loops more than one time, which should be impossible.

--
components: Interpreter Core
files: bug.py
messages: 219514
nosy: Robert.w
priority: normal
severity: normal
status: open
title: List/Dict Combination Bug
type: behavior
versions: Python 2.7, Python 3.3
Added file: http://bugs.python.org/file35440/bug.py

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



[issue21631] List/Dict Combination Bug

2014-06-01 Thread SilentGhost

SilentGhost added the comment:

Robert, could you please post a reduced code that generates the bug. 
Preferably, a interpreter output. Including information about your python 
version, OS, etc. For example:

Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type help, copyright, credits or license for more information.
 elements = [{'type': 2, 'data': {'elements': ['83H', '0FAH', '9AH', '27H', 
 '81H', '49H', '0CEH', '11H']}}]
 for i in elements:
...  print(i)
...
{'data': {'elements': ['83H', '0FAH', '9AH', '27H', '81H', '49H', '0CEH', 
'11H']}, 'type': 2}

As you see from my example, I wasn't able to reproduce the issue you're 
reporting.

--
nosy: +SilentGhost

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



[issue21625] help()'s more-mode is frustrating

2014-06-01 Thread eryksun

eryksun added the comment:

 Why does help() enter a more-mode for even short help?  

`more` exits if there's less than a page of a text. The default for `less` is 
to quit when q is entered. You may be interested in the option -e 
(quit-at-eof).

 Why doesn't ENTER get you out of it?  

ENTER scrolls. Type a number N to scroll by N lines.

 Why does it clear the screen when you are done with it, 
 removing all the help from the screen?

The option -X (no-init) should stop `less` from clearing the screen.

 Why doesn't the prompt have a suggestion of how to get out of it?  

I guess no one thought to add that when `less` is used.

You can customize the pager using the PAGER environment variable, as used by 
other commands such as `man`.

$ PAGER='less -eX' python3 -c 'help(help)'
Help on _Helper in module site object:

class _Helper(builtins.object)
[...]

You can also set pydoc.pager directly, which is what IDLE does:

 pydoc.pager = pydoc.plainpager
 help(help)
Help on _Helper in module site object:
[...]

plainpager is the default if the TERM environment variable is dumb or emacs, or 
if sys.stdout isn't a tty. Otheriwse if the system has neither `less` nor 
`more`, the pager is set to pydoc.ttypager. 

On Windows, text is written to a temp file using tempfilepager. Other platforms 
pipe the text using pipepager. This should also work for Windows in Python 3, 
which implements os.popen with subprocess.Popen. Here's a test using GnuWin32 
head.exe and tr.exe:

 cmd = 'head -n3 | tr [:lower:] [:upper:]'
 pydoc.pager = lambda t: pydoc.pipepager(t, cmd)
 help(help)
HELP ON _HELPER IN MODULE _SITEBUILTINS OBJECT:

CLASS _HELPER(BUILTINS.OBJECT)

--
nosy: +eryksun

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



[issue21628] 2to3 does not fix zip in some cases

2014-06-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +benjamin.peterson

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



[issue21630] List Dict bug?

2014-06-01 Thread R. David Murray

R. David Murray added the comment:

If I put a 'print(one iteration) at the top of the loop, that string is 
printed exactly once.  I presume you realized that and that is why you closed 
this?

--
nosy: +r.david.murray
resolution:  - not a bug

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



[issue21631] List/Dict Combination Bug

2014-06-01 Thread R. David Murray

R. David Murray added the comment:

Oh, this is the same code as in issue 21630 that you closed.  Since the loop is 
only executed once (as confirmed by adding a print), I suspect you have a bug 
in your expectations of the output :)

--
nosy: +r.david.murray

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



[issue19656] Add Py3k warning for non-ascii bytes literals

2014-06-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6bd21268876e by Serhiy Storchaka in branch '2.7':
Issue #19656: Running Python with the -3 option now also warns about
http://hg.python.org/cpython/rev/6bd21268876e

--
nosy: +python-dev

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



[issue19656] Add Py3k warning for non-ascii bytes literals

2014-06-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
assignee:  - serhiy.storchaka
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue21625] help()'s more-mode is frustrating

2014-06-01 Thread Ned Batchelder

Ned Batchelder added the comment:

Thanks, this is a very complete explanation of the machinery behind the scenes. 
 I think we would do beginners a service if we made the behavior a bit less 
obscure.  Are there ways that we could (for example) have the prompt say END 
(q to quit) instead of just END?

--

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



[issue21632] Idle: sychronize text files across versions as appropriate.

2014-06-01 Thread Terry J. Reedy

New submission from Terry J. Reedy:

Spinoff of #7136: In pushing the patch for that issue, I discovered that 
formatting changes for help.txt (and maybe /Doc/library/idle.rst) had been 
applied unevenly. See msg192141, which suggests this issue. 3.3 versus 3.4 
differences are moot, so this now means 2.7 versus 3.4+.

--
assignee: terry.reedy
messages: 219521
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Idle: sychronize text files across versions as appropriate.
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5

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



[issue20886] Disabling logging to ~/.python_history is not simple enough

2014-06-01 Thread Jakub Wilk

Changes by Jakub Wilk jw...@jwilk.net:


--
nosy: +jwilk

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



[issue10652] test___all_ + test_tcl fails (Windows installed binary)

2014-06-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Zach, do you have any further thoughts in light of patches pushed since? 
What do you think is the exact remaining issue?

--
assignee: terry.reedy - 

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



[issue21468] NNTPLib connections become corrupt after long periods of activity

2014-06-01 Thread Jakub Wilk

Changes by Jakub Wilk jw...@jwilk.net:


--
nosy: +jwilk

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



[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit

2014-06-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5453b9c59cd7 by Gregory P. Smith in branch '3.4':
Don't restrict ourselves to a max fd when closing fds before exec()
http://hg.python.org/cpython/rev/5453b9c59cd7

New changeset 012329c8c4ec by Gregory P. Smith in branch 'default':
Don't restrict ourselves to a max fd when closing fds before exec()
http://hg.python.org/cpython/rev/012329c8c4ec

--
nosy: +python-dev

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



[issue21573] Clean up turtle.py code formatting

2014-06-01 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I would like to provide a final review before of any proposed changes.

Also, along the way, I would happy to provide suggestions for more substantive 
changes (instead of shallow PEP 8 or PyLint changes).  

The primary defect in the modules is that the code got adultified somewhere 
along the way and needs to migrate back to the sort of straight-forward code 
that kids can read and model their code after.

I've use this code to help train adults to teach kids and found that it needs 
to use a simpler feature set.

--
nosy: +rhettinger

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



[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit

2014-06-01 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Backported to subprocess32 in 
https://code.google.com/p/python-subprocess32/source/detail?r=1c27bfe7e98f78e6aaa746b5c0a4d902a956e2a5

--
resolution:  - fixed
stage: patch review - commit review
status: open - closed
versions: +Python 3.5

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



[issue20640] Idle: test configHelpSourceEdit

2014-06-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Please redo 3.3 patch for current 3.4 (after htest change).

--
title: Adds idle test for configHelpSourceEdit - Idle: test 
configHelpSourceEdit
versions: +Python 3.5 -Python 3.3

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



[issue18410] Idle: test SearchDialog.py

2014-06-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

#18592 has a patch for SearchDialogBase.

--
title: IDLE Improvements: Unit test for SearchDialog.py - Idle: test 
SearchDialog.py
versions: +Python 3.5 -Python 3.3

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



[issue20567] test_idle causes test_ttk_guionly 'can't invoke event command: application has been destroyed' messages from Tk

2014-06-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Probably still need to add note to idle_test/README.txt.

--
stage: commit review - needs patch
versions: +Python 3.5 -Python 3.3

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



[issue20800] Cannot run gui tests twice.

2014-06-01 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
versions: +Python 3.5 -Python 3.3

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



[issue20800] Cannot run gui tests twice.

2014-06-01 Thread Ned Deily

Ned Deily added the comment:

For what it's worth, I don't see the problem on OS X (haven't tried it recently 
on a Linux system), so it might be a Windows only issue. It's become clearer 
that some test combinations can only be safely run with the regrtest -j option 
to run them as separate subprocesses. I Does -m test -j2 -ugui 
test_ttk_guionly test_ttk_guionly help?

--

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



[issue18409] Idle: test AutoComplete.py

2014-06-01 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
stage: needs patch - patch review
title: IDLE Improvements: Unit test for AutoComplete.py - Idle: test 
AutoComplete.py
versions: +Python 3.5 -Python 3.3

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



[issue18592] Idle: test SearchDialogBase.py

2014-06-01 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
title: IDLE: Unit test for SearchDialogBase.py - Idle:  test 
SearchDialogBase.py
versions: +Python 3.5 -Python 3.3

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



[issue18910] IDle: test textView.py

2014-06-01 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
stage:  - patch review
title: IDLE: Unit test for textView.py - IDle: test textView.py
versions: +Python 3.5 -Python 3.3

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



[issue20792] Idle: test PathBrowser more

2014-06-01 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
title: IDLE: Extend tests for PathBrowser - Idle: test PathBrowser more
versions: +Python 2.7, Python 3.5

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



[issue21611] int() docstring - unclear what number is

2014-06-01 Thread Raymond Hettinger

Raymond Hettinger added the comment:

 I think there should be a precise definition of what is 
 considered to be a number there.

Sometimes precise definitions make the docs harder to use rather than easier. 
 It is the goal of these docs to basically tell what int() does, not to provide 
a spec for it.

For most users for the past 20+ years, what we already have was sufficient for 
them to understand that int('42') returned the integer 42 and that int('xyz') 
did not have a valid interpretation as an integer.

FWIW, there are other parts of the docs that do have more precise specs about 
precisely specifies what can go in floats, identifiers, etc.  Those parts of 
the docs are rarely used or read however, because what we have gets the job 
done reasonably well.

For comparison look at the docs in other languages where the descriptions tend 
to be more much pithy, leaving intelligent people to fill in the blanks in a 
reasonable way.

--
nosy: +rhettinger

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



[issue21612] IDLE should not open multiple instances of one file

2014-06-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Your report is a bit vague. Idle is supposed to only open a file once in a 
particular Idle process. If you have seen otherwise (but see below first), 
please complete the report: OS, exact Python version (x.y.z), exactly what you 
did.

If you right-clicked in a file browser, then you open the file in a new idle 
process each time. This is routine and the issue should be closed.

--
nosy: +terry.reedy

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



[issue21631] List/Dict Combination Bug

2014-06-01 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I've traced through your code and it doing exactly what it is specified to be 
doing (meaning that Python itself seems to be behaving correctly).  Perhaps you 
wanted it to do something else, but that would be a bug in your own code.

Please use the Python bug tracker for actual bugs in Python, not as a place to 
figure-out what your own code is doing.  There are other forums that might be 
suitable (python-tutor, stackoverflow, etc).  Thank you.

--
nosy: +rhettinger
resolution:  - not a bug
status: open - closed

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



[issue21197] venv does not create lib64 directory and appropriate symlinks

2014-06-01 Thread Ned Deily

Ned Deily added the comment:

The added 64-bit test unnecessary adds an import for struct.  The documented 
preferred test is:

sys.maxsize  2**32

https://docs.python.org/dev/library/platform.html#platform.architecture

--

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



[issue21633] Argparse does not propagate HelpFormatter class to subparsers

2014-06-01 Thread Michael Cohen

New submission from Michael Cohen:

Argparse has an option to set the custom help formatter class as a kwarg. For 
example one can define:


class MyHelpFormatter(argparse.RawDescriptionHelpFormatter):
def add_argument(self, action):
if action.dest != SUPPRESS:
super(RekallHelpFormatter, self).add_argument(action)


parser = ArguementParser(
   formatter_class=MyHelpFormatter)


But when one creates a subparser there is no way to define the formatter class 
for it - i.e. parser.add_subparsers() does not accept a formatter_class 
parameter. Instead we see this code:

def add_subparsers(self, **kwargs):
...
# add the parser class to the arguments if it's not present
kwargs.setdefault('parser_class', type(self))

The only way to make this work is to extend ArguementParser to force it to use 
the formatter_class through inheritance:

class MyArgParser(argparse.ArgumentParser):

def __init__(self, **kwargs):
kwargs[formatter_class] = MyHelpFormatter
super(MyArgParser, self).__init__(**kwargs)

this is counter intuitive since formatter_class can be passed to the 
constructor but then it is not propagated to subparsers.

IMHO the expect action here is to have the formatter_class automatically 
propagates to subparsers as well. Short of that we need to be able to specific 
it in add_subparser() call.

--
components: Extension Modules
messages: 219534
nosy: Michael.Cohen
priority: normal
severity: normal
status: open
title: Argparse does not propagate HelpFormatter class to subparsers
type: behavior
versions: Python 2.7

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



[issue21477] Idle: improve idle_test.htest

2014-06-01 Thread Ned Deily

Ned Deily added the comment:

this patch includes a call to macosxSupport. _initializeTkVariantTests(root) 
in htest.run. Does this work on mac or is something else needed (like doing the 
same for individual tests that create another root)?

That looks good and, in a quick spot check running a few tests, seems to work 
fine.

--

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



[issue21573] Clean up turtle.py code formatting

2014-06-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I think the *some* of the 'adultification' that you refer to is a result of 
Gregor reimplementing turtle in a tkinter-independent intermediate language or 
two, the lowest layer of which he then implemented in tkinter as one particular 
backend. He intended to implement that next-to-lowest layer with other backends 
for use outside the stdlib. But unless we were to replace tkinter, that 
flexibility is just added and unneeded complexity for turtle in the stdlib.

I originally read turtle.py to learn how to program the tkinter canvas. I hoped 
to see how visible turtle actions, especially animations, translated to canvas 
calls. I just downloaded 2.5.6 turtle.py (26kb instead of 145kb). At first 
glance, it seems more suited to that particular need. You would find it a 
better example of 'straight-forward code' for your classes. I just ran it from 
2.7.6 Idle and the end-of-file demo runs.

I have no knowledge of why the 2.5 turtle was replaced instead of being patched 
and upgraded. At the time, I was just a casual Python user who had never used 
turtle.

--

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



[issue21573] Clean up turtle.py code formatting

2014-06-01 Thread Lita Cho

Lita Cho added the comment:

Thank you so much for your support, Terry. I really appreciate all your 
feedback. Your comments have been very helpful as I am learning Turtle and 
Tkinter.

Most of my changes are related to spacing, visual indentation, consistent line 
spaces between method definitions, and making sure all the code falls within 80 
lines. They have been all been minor changes that wouldn't change the logic of 
the code. I haven't gotten to removing the commented out code yet.

I will wait to commit this till I fix a bug in Turtle.

--

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



[issue21548] pydoc -k IndexError on empty docstring

2014-06-01 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
keywords: +easy

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



[issue21597] Allow turtledemo code pane to get wider.

2014-06-01 Thread Lita Cho

Changes by Lita Cho lita@gmail.com:


--
nosy: +jesstess

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



[issue17172] Add turtledemo to IDLE menu

2014-06-01 Thread Lita Cho

Lita Cho added the comment:

Okay! That makes sense. Any bugs that Turtle has, people will assume IDLE has 
them too if they launch it from IDLE.

I will take on #21597, and work on that instead. Thanks!

--

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



[issue21597] Allow turtledemo code pane to get wider.

2014-06-01 Thread Lita Cho

Lita Cho added the comment:

I'll take this on.

--
nosy: +Lita.Cho

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



[issue21612] IDLE should not open multiple instances of one file

2014-06-01 Thread irdb

irdb added the comment:

Yes, I am right-clicking the file through Windows Explorer as in some 
situations it seems much faster. (Opening through IDLE's file menu in a 
particular process works fine)

If this is supposed to be so please close the issue. Although I don't 
understand why one would want this feature. This is not the case when I use 
Adobe Reader to open a pdf file, Notepad++ to open a text file, or MS Word to 
open a .doc file.

I'm using Windows 8 x64/Python 2.7.6 (32 bit version)

--
type:  - behavior
versions: +Python 2.7

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



[issue21627] Concurrently closing files and iterating over the open files directory is not well specified

2014-06-01 Thread Steven Stewart-Gallus

Steven Stewart-Gallus added the comment:

Okay, I've made a simple proof of concept patch.

--

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



[issue21627] Concurrently closing files and iterating over the open files directory is not well specified

2014-06-01 Thread Steven Stewart-Gallus

Steven Stewart-Gallus added the comment:

Gah, I had trouble figuring out mecurial.

Close files after reading open files and not concurrently

This commit removes the old behaviour of closing files concurrently
with reading the system's list of open files and instead closes the
files after the list has been read.

Because no memory can be allocated in that specific context the
approach of setting the CLOEXEC flag and letting the following exec
close the files has been used.

For consistency, the brute force approach to closing the files has
also been modified to set the CLOEXEC flag.

--
keywords: +patch
Added file: http://bugs.python.org/file35441/cloexec.patch

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



[issue21597] Allow turtledemo code pane to get wider.

2014-06-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The patch for #18132 replaced pack with grid, But the replacement seemed 
partial even within the top frame (but I may have misread). Mixing the two is 
known to be a bad idea. http://effbot.org/tkinterbook/grid.htm has a big 
warning box about this. I think we can fix both issues with a 2row x 4col grid. 
The first col would have a minsize as now but be expandable. The canvas would 
have a rowspan of 3. The bottom row would have a fixed size so it does not 
disappear. I don't know if gridding a frame with a widget and scrollbars packed 
inside is ok or not.  If not, it should be possible to grid widget and 
scrollbars instead. In any case, the result should be a bit simpler, with at 
least 1 less intermediate frame (for the 3 buttons under the canvas. Unless 
someone else would rather, I will do a final review, test, and commit. 

If you try an approach that does not work, say so and I will know not to 
suggest it ;-).

--
assignee:  - terry.reedy

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



[issue21612] IDLE should not open multiple instances of one file

2014-06-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Notepad++, for instance (which I use), has one version installed, multiple 
panes, and only allows one instance to run. It matches Idle in only allowing a 
file to be opened in one process, which happens to be the only process.

Idle, by contrast, can have multiple versions (and I do), multiple instances of 
one version, and, at the moment, one file per window. I sometimes open a file 
with multiple versions to test. Yes, I have to be careful if I want to make a 
change. One person did not like the title bar change because it is bad for how 
he uses Idle, which is to open one file per process on Win7 in order to have a 
separate task bar icon for each, just like on XP. If one is doing something 
that might crash Idle (once all too common, now mostly fixed), a separate 
process makes sense.

--
resolution:  - wont fix
stage:  - resolved
status: open - closed

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



[issue13630] IDLE: Find(ed) text is not highlighted while dialog box is open

2014-06-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I currently have the same problem with Idle's builtin Search and Replace 
dialogs. In that respect, this is a duplicate of #18590. Since the discussion 
here shifted to a third party extension, I am closing this issue and leaving 
the other one open.

--
resolution:  - duplicate
stage:  - resolved
status: open - closed
superseder:  - 'Search' and 'Replace' dialogs don't work on quoted text in 
Windows

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



[issue18590] 'Search' and 'Replace' dialogs don't work on quoted text in Windows

2014-06-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I closed #18590 as a duplicate of this.

--
nosy: +terry.reedy

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



[issue18292] Idle: test AutoExpand.py

2014-06-01 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
stage:  - patch review
title: IDLE Improvements: Unit test for AutoExpand.py - Idle: test 
AutoExpand.py
versions: +Python 3.5 -Python 3.3

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



[issue21625] help()'s more-mode is frustrating

2014-06-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 Are there ways that we could (for example) have the prompt say END (q to 
 quit) instead of just END?

Add following command to your profile file (~/.profile, ~/bashrc, or 
~/.bash_aliases):

export LESS='-PEND (q to quit)'

And please don't break help(). It works as expected (to Unix users) and is 
enough configurable.

--
nosy: +serhiy.storchaka

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



[issue20800] Cannot run gui tests twice.

2014-06-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Does recent patch for issue20035 help?

--

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



[issue18292] Idle: test AutoExpand.py

2014-06-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

For tests that use a Text widget, I want the first version to be a gui test 
using tkinter.Text. This removes mock Text as an issue in writing the tests. I 
will not commit without running the test 'live' at least once.

Once the file (or at least a TestCase) is complete, we can then consider 
replacing the real Text with the mock. The gui code is commented out, rather 
than deleted, in case there is ever a need to switch back. See 
test_searchengine.py (#18489), where this was done,  (Even partial conversions 
are worthwhile if complete conversion is not possible.) Did I forget to say 
this in idle_test/README.txt? (I know I forget to mention this directly before 
now, Sorry ;-).

Some modules import tkinter and instantiate widgets either upon import or 
during testing, (This is different from taking a widget instance as an argument 
in .__init__.) If so  a gui-free test requires that the module be 
monkey-patched with mocks. For SearchEngine, the only widgets are XyzVars and 
TkMessageBox, for which we do have mocks. AutoExpand does not import tkinter, 
so it is fine as is.

In your patch, comment out from idlelib.idle_test.mock_tk import Text and add 
the needed gui code. See the commented out code in 
test_searchengine.

--
stage: patch review - needs patch

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