[issue24399] Backports Arch Linux support for platform.linux_distribution()

2015-06-06 Thread Nathan Ringo

New submission from Nathan Ringo:

On Arch Linux, running `python2 -c import platform; print 
platform.linux_distribution()'

Before patch: ('', '', '')
After patch: ('arch', 'Arch', 'Linux')

This matches the Python 3 behavior:
`python3 -c import platform; print(platform.linux_distribution())'

('arch', 'Arch', 'Linux')

--
files: support_dist_arch.patch
keywords: patch
messages: 244925
nosy: Nathan Ringo
priority: normal
severity: normal
status: open
title: Backports Arch Linux support for platform.linux_distribution()
versions: Python 2.7
Added file: http://bugs.python.org/file39644/support_dist_arch.patch

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



[issue24399] Backports Arch Linux support for platform.linux_distribution()

2015-06-06 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report. This is a duplicate of issue 20454.

--
nosy: +berker.peksag
resolution:  - duplicate
stage:  - resolved
status: open - closed
superseder:  - platform.linux_distribution() returns empty value on Archlinux 
and python 2.7

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



[issue20454] platform.linux_distribution() returns empty value on Archlinux and python 2.7

2015-06-06 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
nosy: +Nathan Ringo

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



[issue20454] platform.linux_distribution() returns empty value on Archlinux and python 2.7

2015-06-06 Thread Nathan Ringo

Nathan Ringo added the comment:

The problem is, existing software (Ansible) relies on linux_distribution()

--

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



[issue14373] C implementation of functools.lru_cache

2015-06-06 Thread Tim Graham

Tim Graham added the comment:

This changed caused a problem in Django's test suite (bisected to 
0d0989359bbb0).

  File /home/tim/code/django/django/db/models/options.py, line 709, in 
_populate_directed_relation_graph
all_models = self.apps.get_models(include_auto_created=True)
TypeError: get_models() missing 1 required positional argument: 'self'

The get_models() method is decorated with @lru_cache.lru_cache(maxsize=None)

https://github.com/django/django/blob/c2b4967e76fd671e6199e4dd54d2a2c1f096b8eb/django/apps/registry.py#L157-L179

--
nosy: +Tim.Graham

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



[issue24390] Python 3.4.3 64 bits is not high dpi aware

2015-06-06 Thread Ivan Bykov

New submission from Ivan Bykov:

Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit 
(AMD64)] on win32
Type copyright, credits or license() for more information.
 SM_CYSCREEN = 1
 from ctypes import windll
 GetSystemMetrics = windll.user32.GetSystemMetrics
 GetSystemMetrics(SM_CYSCREEN)
1067
 'really this value is 1600'
 'executable must be labeled as high dpi aware'

--
components: Windows
messages: 244894
nosy: ivb, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python 3.4.3 64 bits is not high dpi aware
type: behavior
versions: Python 3.4

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



[issue24391] Better repr for threading objects

2015-06-06 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
stage: patch review - commit review

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



[issue24120] pathlib.(r)glob stops on PermissionDenied exception

2015-06-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The glob module is not affected because it ignores all OSErrors (including 
Permission denied and Too many levels of symbolic links).

 import glob
 glob.glob('**/*', recursive=True)
['dir2/file1', 'dir2/file2', 'dir2/dir3', 'dir1/file1', 'dir1/file2']

There is no special test for PermissionError.

--
nosy: +serhiy.storchaka

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



[issue18003] lzma module very slow with line-oriented reading.

2015-06-06 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
priority: normal - release blocker

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



[issue24391] Better repr for threading objects

2015-06-06 Thread Serhiy Storchaka

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


--
keywords: +patch
Added file: http://bugs.python.org/file39637/threading_objects_reprs.patch

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



[issue24391] Better repr for threading objects

2015-06-06 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch adds makes reprs of threading objects Semaphore, 
BoundedSemaphore, Event, and Barrier expose their public states. This will help 
for debugging.

Examples:

Semaphore: 10 at 0xb710ec8c
BoundedSemaphore: 7/10 at 0xb6ff1d6c
unset Event at 0xb710ec8c
set Event at 0xb710ec8c
Barrier: 0/10 at 0xb6ff1d6c
Barrier: 3/10 at 0xb6ff1d6c
broken Barrier: 3/10 at 0xb6ff1d6c

--
components: Library (Lib)
messages: 244896
nosy: berker.peksag, brett.cannon, pitrou, rhettinger, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Better repr for threading objects
type: enhancement
versions: Python 3.6

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



[issue24392] pop functioning

2015-06-06 Thread Padmanabhan Tr

New submission from Padmanabhan Tr:

I have attached the python sequence  my comments. I use Python version 3.4.2
I guess a bug need be corrected

--
components: Regular Expressions
files: bug_a
messages: 244897
nosy: Padmanabhan.Tr, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: pop functioning
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file39638/bug_a

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



[issue24391] Better repr for threading objects

2015-06-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

+1. The patch looks good to me.

--

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



[issue24391] Better repr for threading objects

2015-06-06 Thread Brett Cannon

Brett Cannon added the comment:

While I like the concept, I don't like the reprs where the type is not the 
first thing listed, e.g., set Event not having Event first. The default 
repr and typical practice of having the type come first makes my brain 
initially read that repr as a set of Events instead of an Event that is set.

--

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



[issue24391] Better repr for threading objects

2015-06-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is for consistency with reprs of lock objects (issue21137):

unlocked _thread.lock object at 0xb6f2b188
locked _thread.lock object at 0xb6f2b188
unlocked _thread.RLock object owner=0 count=0 at 0xb6f2b0b0
locked _thread.RLock object owner=-1219680512 count=2 at 0xb6f2b0b0

--

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



[issue24391] Better repr for threading objects

2015-06-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I'd like to see this in 3.5. This is a no-brainer improvement and has very 
little chance of breaking anything compared to a new OrderedDict implementation.

--
nosy: +larry
versions: +Python 3.5

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



[issue24383] consider implementing __await__ on concurrent.futures.Future

2015-06-06 Thread Stefan Behnel

Stefan Behnel added the comment:

(Copying my review comment here so that it doesn't get lost as it's more of a 
general design thing than a specific review comment.)

Having Future know and deal with asyncio seems wrong to me. asyncio should be 
able to deal *somehow* with a Future that is being awaited, but a Future 
shouldn't require asyncio in order to be awaited.

--

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



[issue24394] TypeError: popitem() takes no keyword arguments

2015-06-06 Thread Ram Rachum

Ram Rachum added the comment:

I'm seeing a similar problem with `move_to_end` and its `last` keyword argument.

--

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



[issue24395] webbrowser.py update to use argparse.py

2015-06-06 Thread Hasan Diwan

New submission from Hasan Diwan:

The webbrowser module uses getopt, which needs to be ripped out and replaced 
with argparse. The attached file does just this.

--
components: Library (Lib)
files: webbrowser.py
messages: 244913
nosy: Hasan Diwan, georg.brandl
priority: normal
severity: normal
status: open
title: webbrowser.py update to use argparse.py
type: enhancement
versions: Python 2.7
Added file: http://bugs.python.org/file39641/webbrowser.py

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



[issue24195] Add `Executor.filter` to concurrent.futures

2015-06-06 Thread Ram Rachum

Ram Rachum added the comment:

A problem I just realized with Brian's 2-line implementation of `filter`: It 
doesn't work for iterables which aren't sequences, since it attempts to exhaust 
the iterable twice. So if you have a non-sequence you'll have to make it into a 
sequence first.

--

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



[issue24255] Replace debuglevel-related logic with logging

2015-06-06 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
nosy: +berker.peksag

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



[issue24391] Better repr for threading objects

2015-06-06 Thread Larry Hastings

Larry Hastings added the comment:

I'll allow it.  But I agree with Brett, I really would prefer that the type be 
the first thing in the repr.  I'd rather fix the lock objects than compound our 
error.

--

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



[issue18003] lzma module very slow with line-oriented reading.

2015-06-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

bz2 will gain great benefit from such optimization too.

Microbenchmark results:

$ ./python -m timeit -s import gzip -- f=gzip.GzipFile('words.gz', 'r') 
for line in f: pass
2.7: 10 loops, best of 3: 374 msec per loop
3.2: 10 loops, best of 3: 325 msec per loop
3.3: 10 loops, best of 3: 311 msec per loop
3.4: 10 loops, best of 3: 328 msec per loop
3.5: 10 loops, best of 3: 325 msec per loop
3.5+decomp-optim.v3: 10 loops, best of 3: 61.2 msec per loop

$ ./python -m timeit -s import bz2 -- f=bz2.BZ2File('words.bz2', 'r') for 
line in f: pass
2.7: 10 loops, best of 3: 92.1 msec per loop
3.2: 10 loops, best of 3: 92.4 msec per loop
3.3: 10 loops, best of 3: 567 msec per loop
3.4: 10 loops, best of 3: 535 msec per loop
3.5: 10 loops, best of 3: 603 msec per loop
3.5+decomp-optim.v2: 10 loops, best of 3: 525 msec per loop
3.5+decomp-optim.v3: 10 loops, best of 3: 131 msec per loop

$ python -m timeit -s import lzma -- f=lzma.LZMAFile('words.xz', 'r') for 
line in f: pass
2.7: 10 loops, best of 3: 49.4 msec per loop
3.3: 10 loops, best of 3: 1.67 sec per loop
3.4: 10 loops, best of 3: 400 msec per loop
3.5: 10 loops, best of 3: 423 msec per loop
3.5+decomp-optim.v3: 10 loops, best of 3: 89.6 msec per loop

The fact that bz2 and lzma have 5-15% regression in 3.5 (comparing to 3.4) 
makes applying this patch to 3.5 more desirable.

--
Added file: http://bugs.python.org/file39640/decomp-optim.v3.patch

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



[issue24391] Better repr for threading objects

2015-06-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Would following reprs good?

Event: set at 0xb710ec8c
Event: unset at 0xb710ec8c

(what is better: unset or clear?)

Should the repr contain the module name (threading.Event: set at 0xb710ec8c)?

--

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



[issue24394] TypeError: popitem() takes no keyword arguments

2015-06-06 Thread Eric Snow

Eric Snow added the comment:

This has been fixed in issue24368.  The fix came just after the beta 2 release.

--
resolution:  - duplicate
stage:  - resolved
status: open - closed
superseder:  - Some C OrderedDict methods need to support keyword arguments.

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



[issue24255] Replace debuglevel-related logic with logging

2015-06-06 Thread Eryn Wells

Eryn Wells added the comment:

Hi. This is my first issue, but I'd be willing to have a go at updating this 
module. Do either of you have specific ideas about what changes you want here? 

My thought was to import logging, create a logger object, and start by 
replacing all the self.debuglevel stuff with appropriate log statements. Does 
that make sense? Do each of the classes need separate loggers, or is just one 
module-level logger enough?

--
nosy: +erynofwales

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



[issue24395] webbrowser.py update to use argparse.py

2015-06-06 Thread Berker Peksag

Berker Peksag added the comment:

Thanks!

A few comments:

* New features like this can only go into Python 3.6 (the default branch)
* The CLI is partially tested (see Lib/test/test_webbrowser.py). You'll need to 
add additional tests (e.g. add tests for the -t and -h options)
* It would be nice if you could send your changes in a patch format. Please see 
https://docs.python.org/devguide/patch.html for more information

--
nosy: +berker.peksag
stage:  - needs patch
versions: +Python 3.6 -Python 2.7

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



[issue24396] Provide convenience function for paths relative to the current module

2015-06-06 Thread Madison May

New submission from Madison May:

I often find myself trying to access a file relative to the module I'm working 
on.  When this occurs, I'll often use something like the following:

```
os.path.abspath(os.path.join(os.path.dirname(__file__), data/resource.pkl))
```

I have good reason to believe that I'm not the only one, as searching for other 
examples of this code on github returns ~20k exact matches: 
https://github.com/search?utf8=%E2%9C%93q=%22os.path.abspath%28os.path.join%28os.path.dirname%28__file__%29%22+type=Coderef=searchresults


Low priority, but a more concise way of achieving the same result would be much 
appreciated.

--
components: Library (Lib)
messages: 244920
nosy: madison.may
priority: normal
severity: normal
status: open
title: Provide convenience function for paths relative to the current module
type: enhancement
versions: Python 3.5, Python 3.6

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



[issue24394] TypeError: popitem() takes no keyword arguments

2015-06-06 Thread Ram Rachum

New submission from Ram Rachum:

Python 3.5.0b2 (v3.5.0b2:7a088af5615b, May 31 2015, 06:22:19) [MSC v.1900 64 
bit (AMD64)] on win32  
Type help, copyright, credits or license for more information.  

 import collections  
 
 o=collections.OrderedDict() 
 
 o.popitem(last=True)
 
Traceback (most recent call last):  

  File stdin, line 1, in module   

TypeError: popitem() takes no keyword arguments

--
messages: 244906
nosy: cool-RR
priority: normal
severity: normal
status: open
title: TypeError: popitem() takes no keyword arguments

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



[issue24391] Better repr for threading objects

2015-06-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I think the module name is useful, since there are also multiprocessing events 
and semaphores. Also, Event is a fairly generic name which may be used in other 
contexts (e.g. GUI libraries).

set and unset sound good to me.

--

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



[issue24391] Better repr for threading objects

2015-06-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is updated patch. Now the repr always starts with the qualified class name.

threading.Semaphore: 10 at 0xb710ec8c
threading.BoundedSemaphore: 7/10 at 0xb6ff1d6c
threading.Event: unset at 0xb710ec8c
threading.Event: set at 0xb710ec8c
threading.Barrier: 0/10 at 0xb6ff1d6c
threading.Barrier: 3/10 at 0xb6ff1d6c
threading.Barrier: 0/10, broken at 0xb6ff1d6c

But there is other question. Should reprs be consistent with reprs of 
corresponding classes in multiprocessing and asyncio modules?

In multiprocessing:

Semaphore(value=10)
BoundedSemaphore(value=10, maxvalue=10)

In asyncio:

asyncio.locks.Event object at 0xb6fa180c [unset]
asyncio.locks.Event object at 0xb6fa180c [set]
asyncio.locks.Event object at 0xb6fa180c [unset,waiters:3]
asyncio.locks.Semaphore object at 0xb6cec26c [unlocked,value:10]
asyncio.locks.Semaphore object at 0xb6cec26c [locked]
asyncio.locks.Semaphore object at 0xb6cec26c [locked, waiters:3]

--
Added file: http://bugs.python.org/file39642/threading_objects_reprs_2.patch

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



[issue24395] webbrowser.py update to use argparse.py

2015-06-06 Thread Mark Lawrence

Mark Lawrence added the comment:

This strikes me as pointless code churn.

--
nosy: +BreamoreBoy

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



[issue24396] Provide convenience function for paths relative to the current module

2015-06-06 Thread Martin Panter

Martin Panter added the comment:

There is also pkgutil.get_data(), but that returns the file contents rather 
than file path, which has rarely been useful to me.

--

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



[issue24398] Update test_capi to use test.support.script_helper

2015-06-06 Thread Christie

Christie added the comment:

I can't seem to get test_no_FatalError_infinite_loop to fail - I tried 
reverting the fix that this was verifying, but the test still passed and no 
infinite loop to be seen. I'm wondering if this is because I can't reproduce it 
on a mac.

--

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



[issue24252] IDLE removes elements from tracebacks.

2015-06-06 Thread ppperry

ppperry added the comment:

Another example of this overzealous removing is when you create a module named 
rpc, run, RemoteDebugger, or bdb. 
For example (in this environment, a file in the current directory named rpc.py 
exists and refers to the undefined name bar):
import rpc
Traceback (most recent call last):
  File pyshell#x, line 1, in module
import rpc
NameError: name 'bar' is not defined

The correct traceback is:
Traceback (most recent call last):
  File pyshell#x, line 1, in module
  File rpc.py, line 2, in module
bar
NameError: name 'bar' is not defined

The IDLE debugger also refuses to debug code in the above file (only if it is 
named rpc not any of the other names).

--

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



[issue14586] TypeError: truncate() takes no keyword arguments

2015-06-06 Thread Martin Panter

Martin Panter added the comment:

See also Issue 23738 and PEP 457 for fixing the documentation instead, possibly 
something like truncate(size=None, /). Also, Issue 17003 has changed some of 
the keywords to be more consistent, making parts of this patch incorrect.

--
nosy: +vadmium

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



[issue24033] Update _test_multiprocessing.py to use script helpers

2015-06-06 Thread Christie

Christie added the comment:

run_python and spawn_python are basically the same, I need to reconcile those.

--

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



[issue18576] Document test.support.script_helper

2015-06-06 Thread Christie

Christie added the comment:

@ncoghlan I've taken the test.rst changes from the previous diff and reviewed 
them against the latest script_helper (including updates from issue24033). 
Nothing had fallen behind, but I've added what was missing.

* I've realized that spawn_python and the helper run_python I added in 
issue24033 are basically the same so I will reconcile those
* Is there some way to load the docstrings from script_helper.py in test.rst 
instead of writing explanations for each method twice?

--
Added file: http://bugs.python.org/file39645/issue18576.patch

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



[issue23981] Update test_unicodedata.py to use script_helpers

2015-06-06 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
stage:  - patch review
versions: +Python 3.6

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



[issue24252] IDLE removes elements from tracebacks.

2015-06-06 Thread ppperry

ppperry added the comment:

Is there any reason why the end of the traceback, rather then just the 
beginning, needs to be pruned in the first place?

Additionally, the search for pdb in the tb method will still undesirably 
prune the traceback if someone invents there own buggy debugger that subclasses 
from bdb.Bdb.

Would this cleanup function work?
def cleanup_traceback(tb):
idle_directory = os.path.dirname(__file__)
while os.path.dirname(tb[0][0]) == idle_directory:
del tb[0]
[rest of code not having to do with pruning tracebacks]
The only situation that this function would behave wrongly is when someone 
launches IDLE from the shell (Why would they do that?)

--

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



[issue24396] Provide convenience function for paths relative to the current module

2015-06-06 Thread Martin Panter

Martin Panter added the comment:

This feature could be handy for finding test files in test suites.  However I 
don’t think the abspath() step is necessary. We kind of want a urljoin() for OS 
paths, that automatically removes the current file name. As a new feature I 
think it would be too late for 3.5.

There is the recently added “pathlib” module. I haven’t used it much, and it 
doesn’t have the perfect API for the job, but maybe this is good enough:

vadmium@localhost:~/proj/python/lib$ cat demo_package/__init__.py
from pathlib import PurePath
print(PurePath(__file__).with_name(sibling.pkl))
print(PurePath(__file__).parent.joinpath(data/resource.pkl))
vadmium@localhost:~/proj/python/lib$ python3 -bWall -c 'import demo_package'
/home/proj/python/lib/demo_package/sibling.pkl
/home/proj/python/lib/demo_package/data/resource.pkl

--
nosy: +vadmium
versions:  -Python 3.5

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



[issue18576] Document test.support.script_helper

2015-06-06 Thread Martin Panter

Martin Panter added the comment:

If you diffed your patch from a public revision in the main repository, there 
should be a nice “Review” link. Anyway, here are some comments on 
issue18576.patch:

+.. function:: assert_python_ok(*args, **env_vars)
+
+   Runs the interpreter with *args* and optional environment
+   variables, asserting that *env_vars* succeeds (``rc == 0``).

Perhaps you mean *env_vars* are the optional environment variables, and that 
the interpreter is asserted to have succeeded.

Also maybe clarify where the *__cleanenv* and *__isolated* keywords come from? 
Function signatures? Also applies to assert_python_failure(), 
run_python/_until_end().

Maybe it is worth mentioning that assert_python_ok/failure() strip whitespace 
from the stderr stream. I seem to remember being tricked by this (writing a 
test to ensure stderr ended in a newline or something).

+   ``stdout`` are configured as binary pipes and ``stderr`` is merged with
+   ``stdout``..

There are two full stops above here..

I encourage you to start sentences with capital letters (although I admit 
sometimes other people do not agree with this). Suggestions:

+   *kw* is passed through to subprocess.Popen as additional keyword
+   arguments.
= The *kw* arguments are passed through to subprocess.Popen.

+   *source* is a Unicode string which will be written to the file as UTF-8.
= The *source* argument is a Unicode string which will be written to the file 
as UTF-8.

+   *depth* controls how many deeply nested the package is.
= The *depth* argument controls how deeply nested the package is.

+   Creates a new zip archive in the given directory, containing the specified
+   Python script/module

Needs one of those full stops I mentioned earlier :)

--
nosy: +vadmium

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



[issue24396] Provide convenience function for paths relative to the current module

2015-06-06 Thread R. David Murray

R. David Murray added the comment:

The pkguitil.get_data function is the *right* way to access package-relative 
data (because in the general case the data may not be on the file system), and 
IMO it would not be a good idea to make it easier to do things the wrong way. 
 Any deficiencies with get_data (and its visibility) will, I think, be 
addressed as part of the ongoing effort to make using zipped applications more 
convenient.

So I'm -1 on adding a convenience function for this.

--
nosy: +r.david.murray

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



[issue24397] Test asynchat makes wrong assumptions

2015-06-06 Thread R. David Murray

R. David Murray added the comment:

Your emendation doesn't seem to do anything differently (logic wise) than the 
original code.  Unless I am missing something, it is pointless to track the 
length of the buffer separately from the contents of the buffer.  The buffer 
knows its length.

--
nosy: +r.david.murray

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



[issue24400] Awaitable ABC incompatible with functools.singledispatch

2015-06-06 Thread Ben Darnell

New submission from Ben Darnell:

The new collections.abc.Awaitable ABC relies on __instancecheck__, which makes 
it incompatible with functools.singledispatch (singledispatch works based on 
args[0].__class__; any instance-level information is discarded). This surprised 
me because the first thing I tried to do with Awaitable was add it to my 
singledispatch-based coroutine compatibility layer.

Ideally coroutine would be an actual subclass of generator, instead of a 
generator with an extra bit set on the instance that changes how it answers 
isinstance() checks. That would be a big change, though, so it might be better 
to just document that Awaitable is kind of unusual (if we weren't already in 
the beta period I might argue that the ABCs should be removed and we should 
just use the functions in the inspect module instead).

--
components: asyncio
messages: 244942
nosy: Ben.Darnell, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: Awaitable ABC incompatible with functools.singledispatch
versions: Python 3.5

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



[issue18576] Document test.support.script_helper

2015-06-06 Thread Nick Coghlan

Nick Coghlan added the comment:

As far as using docstrings for the online docs goes, there are some useful 
Sphinx add-ons that we've never enabled for the main Python docs (like autodoc, 
blockdiag, seqdiag) that could be good options to have available. For autodoc 
in particular, we prefer to avoid it for the main docs because good docstring 
and good prose documentation don't necessarily look alike. For ease of 
maintenance of test.support though, I think the write a good docstring, get 
the online docs for free rationale is a compelling one (since these docs are 
core contributor facing, rather than being aimed at Python users in general)

d...@python.org would be the place to ask about the appropriateness of enabling 
some Sphinx add-ons. While enabling them seems like a reasonable idea to me, I 
don't personally know if there are actually technical issues with the idea, or 
if there just hasn't been a volunteer to add/enable them and update 
https://docs.python.org/devguide/documenting.html accordingly.

--

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



[issue24393] Test urllib2_localnet fails depending on host proxy configuration

2015-06-06 Thread Ned Deily

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


--
nosy: +orsenthil
stage:  - patch review
versions: +Python 3.6 -Python 3.2, Python 3.3

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



[issue24397] Test asynchat makes wrong assumptions

2015-06-06 Thread Étienne Buira

New submission from Étienne Buira:

Amount of data the server could not send back is not a reliable indication on 
how much data it received.

--
components: Tests
files: test_asynchat_check_received_len_if_received_len_matters.diff
keywords: patch
messages: 244922
nosy: eacb
priority: normal
severity: normal
status: open
title: Test asynchat makes wrong assumptions
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5
Added file: 
http://bugs.python.org/file39643/test_asynchat_check_received_len_if_received_len_matters.diff

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



[issue9517] Make test.script_helper more comprehensive, and use it in the test suite

2015-06-06 Thread Christie

Christie added the comment:

Created issue24398 for updating test_capi.

--

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



[issue24398] Update test_capi to use test.support.script_helper

2015-06-06 Thread Christie

New submission from Christie:

As described in Issue9517, many test modules do not make use of the helpers in 
script_helpers.py to invoke the python interpreter in a subprocess. Issue9517 
will be broken down into several smaller issues so we can address smaller 
change sets.

This issue is to update test_capi.py to use script_helpers.py.

--
messages: 244923
nosy: bobcatfish
priority: normal
severity: normal
status: open
title: Update test_capi to use test.support.script_helper
versions: Python 3.6

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



[issue24393] Test urllib2_localnet fails depending on host proxy configuration

2015-06-06 Thread Étienne Buira

Étienne Buira added the comment:

Patch was for 2.7

Hunks about no_proxy are also relevant for other branches.

--
versions: +Python 3.2, Python 3.3, Python 3.4, Python 3.5

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