[issue30608] argparse calculates string widths incorrectly

2017-06-08 Thread Vanessa McHale

New submission from Vanessa McHale:

Currently, python computes string widths based on number of characters. 
However, this will not work in general because some languages have e.g. vowel 
markers: 'བོད' for instance is three characters but its width should be two. 

I have an example repo here: https://github.com/vmchale/argparse-min-example

--
components: Library (Lib)
messages: 295490
nosy: Vanessa McHale
priority: normal
severity: normal
status: open
title: argparse calculates string widths incorrectly
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue30604] co_extra_freefuncs is stored thread locally and can lead to crashes

2017-06-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

User code shouldn't allocate PyInterpreterState and PyThreadState structures, 
it only uses structures created by the interpreter. Changing the size of 
PyInterpreterState should be safe. The only possible breaking compatibility is 
if user code directly access co_extra_user_count, co_extra_freefuncs, 
async_gen_firstiter or async_gen_finalizer rather than using the API: 
_PyEval_RequestCodeExtraIndex(), _PyCode_GetExtra(), _PyCode_SetExtra(), 
_PyEval_GetAsyncGenFirstiter(), _PyEval_SetAsyncGenFirstiter(), 
_PyEval_GetAsyncGenFinalizer() and _PyEval_SetAsyncGenFinalizer().

Nick's idea about _preserve_36_ABI_1 and _preserve_36_ABI_2 should   address 
concerns about direct access to async_gen_firstiter and async_gen_finalizer. 
Direct access to co_extra_user_count and co_extra_freefuncs obviously can't be 
preserved.

PyInterpreterState and PyThreadState are not in the stable ABI. They are opaque 
types when use limited API. May be they should be made opaque for all user code 
(in 3.7+).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30303] IDLE: Add _utest to textview and add textview tests

2017-06-08 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +2084

___
Python tracker 

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



[issue30038] Race condition in how trip_signal writes to wakeup fd

2017-06-08 Thread Nathaniel Smith

Nathaniel Smith added the comment:

I guess now would be a good time to decide whether this should be backported to 
3.6, with 3.6.2 coming out in a few days :-). (Or if not, then it can probably 
be closed?)

--

___
Python tracker 

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



[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-06-08 Thread Nathaniel Smith

Nathaniel Smith added the comment:

Looks good to me, thanks Serhiy.

--

___
Python tracker 

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



[issue27838] test_os.test_chown() failure on koobs-freebsd-{current, 9}

2017-06-08 Thread Kubilay Kocak

Changes by Kubilay Kocak :


Added file: http://bugs.python.org/file46937/python-sudo.txt

___
Python tracker 

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



[issue27838] test_os.test_chown() failure on koobs-freebsd-{current, 9}

2017-06-08 Thread Kubilay Kocak

Kubilay Kocak added the comment:

as per msg280837, this beings to happen when I restart the buildbot worker via 
sudo (does not fail on initial startup, executed/invoked using the same script, 
which does not use sudo) and the environment the worker starts with appears to 
be relevant.

Attached are the environments for the worker at initial startup 
(python-initial) and subsequent service restart using sudo (python-sudo, which 
fails tests).


The delta between the two is:

--- python-initial  2017-06-09 14:35:49.557098000 +1000
+++ python-sudo 2017-06-09 14:35:13.665893000 +1000
@@ -6,17 +6,29 @@
   BLOCKSIZE=K
   EDITOR=vi
   GROUP=buildbot
-  HOME=/
+  HOME=/root
   HOST=CURRENT-amd64
   HOSTTYPE=FreeBSD
-  LOGNAME=buildbot
+  LANG=en_US.UTF-8
+  LC_ALL=en_US.UTF-8
+  LC_CTYPE=en_US.UTF-8
+  LOGNAME=root
   MACHTYPE=x86_64
+  MAIL=/var/mail/root
   OSTYPE=FreeBSD
   PAGER=more
-  PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin://bin
+  PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
+  PS1=%B[%{%}%n%{%}%b@%B%{%}%m%b%{%}:%~%B]%b
   PWD=/usr/home/buildbot/python/3.6.koobs-freebsd-current.nondebug/build
-  RC_PID=23
+  RC_PID=22356
+  SHELL=/bin/csh
   SHLVL=1
-  USER=buildbot
+  SUDO_COMMAND=/usr/local/etc/rc.d/buildslave restart
+  SUDO_GID=1001
+  SUDO_UID=1001
+  SUDO_USER=koobs
+  TERM=screen-256color
+  USER=root
+  USERNAME=root
   VENDOR=amd
  using PTY: False

--
Added file: http://bugs.python.org/file46936/python-initial.txt

___
Python tracker 

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



[issue30597] Show expected input in custom "print" error message

2017-06-08 Thread Nick Coghlan

Nick Coghlan added the comment:

It looks like the current right-shift error message is already distinctive 
enough to get people to answers explaining the culprit: 
https://www.google.com.au/search?q=TypeError:+unsupported+operand+type(s)+for+>>:+'builtin_function_or_method'+and+'_io.TextIOWrapper'

--

___
Python tracker 

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



[issue30597] Show expected input in custom "print" error message

2017-06-08 Thread Nick Coghlan

Nick Coghlan added the comment:

Ah, re-reading the comments when reviewing Sanyam's patch, I just remembered 
the problem with the "print >> sys.stderr, output" case, which is that it isn't 
a syntax error, it's a runtime type error:

```
>>> print >> sys.stderr, "message"
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and 
'_io.TextIOWrapper'
```

So if we ever wanted to provide a specialised prompt for that, it would need to 
go into the right-shift operator implementation as a final check before raising 
the type error, rather than here.

That reduces the cases we need to handle here to just the default one and the 
softspace one, where a trailing comma in the statement text gets replaced with 
", end=' '".

--

___
Python tracker 

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



[issue30597] Show expected input in custom "print" error message

2017-06-08 Thread Nick Coghlan

Nick Coghlan added the comment:

Eric, right, I left a couple of logical leaps out of my reply as well. My first 
thought was the same as yours but then I went:

- that means we need to split on commas
- which means we need to track whether or not we're inside a quoted string or 
not
- which is probably more complexity than is warranted just to produce a 
slightly better hint to the user

Result: let's just use "" as a placeholder for "the thing you were trying 
to print"

Although now that I put it that way, "" is probably a better 
user-oriented placeholder, since "expr" (short for expression) is a very 
language-developer-oriented term, while "print()" is closer to 
pseudocode.

--

___
Python tracker 

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



[issue30607] Extract documentation theme into a separate package

2017-06-08 Thread Jon Wayne Parrott

Changes by Jon Wayne Parrott :


--
pull_requests: +2083

___
Python tracker 

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



[issue30606] Spam

2017-06-08 Thread Berker Peksag

Changes by Berker Peksag :


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

___
Python tracker 

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



[issue30606] Spam

2017-06-08 Thread Berker Peksag

Changes by Berker Peksag :


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

___
Python tracker 

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



[issue30606] Spam

2017-06-08 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy:  -Love
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
title: The reply's additional 'Re' is ok -> Spam

___
Python tracker 

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



[issue30607] Extract documentation theme into a separate package

2017-06-08 Thread Jon Wayne Parrott

New submission from Jon Wayne Parrott:

As part of an effort to align the packaging documentation 
(packaging.python.org) with the CPython docs, PyPA has extracted the theme used 
in the CPython documentation into a separate repository and package 
(https://github.com/python/python-docs-theme).

This bug is to track removing the now duplicate theme code from CPython and 
relying on the externalized version.


Context links:
1. https://mail.python.org/pipermail/python-dev/2017-May/148029.html
2. https://github.com/pypa/python-packaging-user-guide/pull/305

--
assignee: docs@python
components: Documentation
messages: 295482
nosy: Jon Wayne Parrott, brett.cannon, docs@python, dstufft, ncoghlan
priority: normal
severity: normal
status: open
title: Extract documentation theme into a separate package
type: enhancement
versions: Python 3.7

___
Python tracker 

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



Re: Psycopg2 pool clarification

2017-06-08 Thread Ian Kelly
On Thu, Jun 8, 2017 at 10:47 AM, Israel Brewster  wrote:
>> On Jun 7, 2017, at 10:31 PM, dieter  wrote:
>>
>> israel  writes:
>>> On 2017-06-06 22:53, dieter wrote:
>>> ...
>>> As such, using psycopg2's pool is essentially
>>> worthless for me (plenty of use for it, i'm sure, just not for me/my
>>> use case).
>>
>> Could you not simply adjust the value for the "min" parameter?
>> If you want at least "n" open connections, then set "min" to "n".
>
> Well, sure, if I didn't care about wasting resources (which, I guess many 
> people don't). I could set "n" to some magic number that would always give 
> "enough" connections, such that my application never has to open additional 
> connections, then adjust that number every few months as usage changes. In 
> fact, now that I know how the logic of the pool works, that's exactly what 
> I'm doing until I am confident that my caching replacement is solid.
>
> Of course, in order to avoid having to open/close a bunch of connections 
> during the times when it is most critical - that is, when the server is under 
> heavy load - I have to set that number arbitrarily high. Furthermore, that 
> means that much of the time many, if not most, of those connections would be 
> idle. Each connection uses a certain amount of RAM on the server, not to 
> mention using up limited connection slots, so now I've got to think about if 
> my server is sized properly to be able to handle that load not just 
> occasionally, but constantly - when reducing server load by reducing the 
> frequency of connections being opened/closed was the goal in the first place. 
> So all I've done is trade dynamic load for static load - increasing 
> performance at the cost of resources, rather than more intelligently using 
> the available resources. All-in-all, not the best solution, though it does 
> work. Maybe if load was fairly constant it would make more sense though. So 
> like I said *my* use case, whi
 ch
>   is a number of web apps with varying loads, loads that also vary from 
> day-to-day and hour-to-hour.
>
> On the other hand, a pool that caches connections using the logic I laid out 
> in my original post would avoid the issue. Under heavy load, it could open 
> additional connections as needed - a performance penalty for the first few 
> users over the min threshold, but only the first few, rather than all the 
> users over a certain threshold ("n"). Those connections would then remain 
> available for the duration of the load, so it doesn't need to open/close 
> numerous connections. Then, during periods of lighter load, the unused 
> connections can drop off, freeing up server resources for other uses. A 
> well-written pool could even do something like see that the available 
> connection pool is running low, and open a few more connections in the 
> background, thus completely avoiding the connection overhead on requests 
> while never having more than a few "extra" connections at any given time. 
> Even if you left of the expiration logic, it would still be an improvement, 
> because while unused connections wouldn't
  d
>  rop, the "n" open connections could scale up dynamically until you have 
> "enough" connections, without having to figure out and hard-code that "magic 
> number" of open connections.
>
> Why wouldn't I want something like that? It's not like its hard to code - 
> took me about an hour and a half to get to a working prototype yesterday. 
> Still need to write tests and add some polish, but it works. Perhaps, though, 
> the common thought is just "throw more hardware at it and keep a lot of 
> connections open at all time?" Maybe I was raised to conservatively, or the 
> company I work for is too poor :-D

Psycopg is first and foremost a database adapter. To quote from the
psycopg2.pool module documentation, "This module offers a few pure
Python classes implementing *simple* connection pooling directly in
the client application" (emphasis added). The advertised list of
features at http://initd.org/psycopg/features/ doesn't even mention
connection pooling. In short, you're getting what you paid for.

It sounds like your needs are beyond what the psycopg2.pool module
provides. I suggest looking into a dedicated connection pooler like
PgBouncer. You'll find that it's much more feature-rich and
configurable than psycopg2.pool. It's production-ready, unlike your
prototype. And since it's a proxy, it can take connections from
multiple client apps and tune the pool to your overall load rather
than on an app-by-app basis (and thus risk overloading the backend if
multiple apps unexpectedly peak together).

As for why psycopg2.pool is the way it is, maybe most users don't have
your situation of serving multiple apps with loads varying on
different cycles. Most are probably only serving a single app, or if
serving multiple apps then they likely have common user bases with
similar peak times. You 

[issue30606] The reply's additional 'Re' is ok

2017-06-08 Thread Lovelyn

New submission from Lovelyn:

lovecoli...@gmail.com

--
messages: 295479
nosy: Love
priority: normal
severity: normal
status: open
title: The reply's additional 'Re' is ok

___
Python tracker 

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



[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-06-08 Thread Ned Deily

Ned Deily added the comment:

As a followup, Nathanial, are you satisfied with the resolution here for the 
upcoming 3.6.2?

--

___
Python tracker 

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



[issue30606] The reply's additional 'Re' is ok

2017-06-08 Thread Lovelyn

Lovelyn added the comment:

lovecoli...@gmail.com

On Jun 9, 2017 9:19 AM, wrote:

lovecoli...@gmail.com

--

___
Python tracker 

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



Re: How to run self-contained Python scripts who don't need Python installation?

2017-06-08 Thread Michael Torrie
On 06/08/2017 07:40 PM, Juan C. wrote:
> 2. I'd like to create a simple BAT to run my Python script, so there
> would be only 2 things (a 'dist' folder with everything and a run.bat
> to make it clear what should be run), for example:

Sure you can. You just have to do it like this (untested; I haven't used
Windows in many years):

@echo off

start %~dp0dist\python-3.6.0-embed-win32\python.exe %~dp0dist\app.py %*

I think %* expands to all the commandline parameters, apparently
excluding %0, which would be the command name itself.





-- 
https://mail.python.org/mailman/listinfo/python-list


[issue23519] using asyncio.iscoroutinefunction() on a functools.partial object

2017-06-08 Thread Guido van Rossum

Guido van Rossum added the comment:

Use a lambda instead of partial. It's more pythonic.

--

___
Python tracker 

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



[issue30486] Allow setting cell value

2017-06-08 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



How to run self-contained Python scripts who don't need Python installation?

2017-06-08 Thread Juan C.
I need to run some Python 3.6.0 scripts on the users' machines (W7 and
W10) in an enterprise environment, but I can't install Python on those
machines. I tried looking for those "py to exe", but sadly they don't
support Python 3.6.0. Then I found out about "Windows x86/x86-64
embeddable zip file" that Python.org made available since 3.5.0, and I
thought it would be the right thing for my case.

I have some questions regarding embeddable Python:

1. How can I install custom modules using pip?

2. I'd like to create a simple BAT to run my Python script, so there
would be only 2 things (a 'dist' folder with everything and a run.bat
to make it clear what should be run), for example:
@echo off
start %~dp0dist\python-3.6.0-embed-win32\python.exe %~dp0dist\app.py

The issue is that I can't parse args to app.py in this case. How would
that be possible? In the example above, if Python was fully installed,
I would give a file as argument to app.py, generally clicking and
dragging the file into the app.py icon so that it would start.

3. Is there a better approach for my case other than embedded Python?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30604] co_extra_freefuncs is stored thread locally and can lead to crashes

2017-06-08 Thread Ned Deily

Ned Deily added the comment:

See review comments on PR 2015.

--
nosy: +ned.deily
versions: +Python 3.7

___
Python tracker 

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



[issue30486] Allow setting cell value

2017-06-08 Thread Lisa Roach

Lisa Roach added the comment:

Thank you for you guidance, Serhiy!

On Thu, Jun 8, 2017 at 4:45 AM, Serhiy Storchaka 
wrote:

>
> Serhiy Storchaka added the comment:
>
> Thank you for your contribution Lisa!
>
> --
> resolution:  -> fixed
> stage: patch review -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-06-08 Thread Dino Viehland

Changes by Dino Viehland :


--
pull_requests: +2082

___
Python tracker 

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



[issue23519] using asyncio.iscoroutinefunction() on a functools.partial object

2017-06-08 Thread Curt McDowell

Curt McDowell added the comment:

There are use cases for this. I hit the problem and eventually wound up here, 
so I'd like to make a case to re-open.

My project has a callback registry of asyncio handler routines.

register_callback(condition1, handler1)
register_callback(condition2, handler2)
...

I want to register many callbacks, but use only one handler and an argument to 
differentiate it. I realize our callback systems should provide for a cookie, 
but it doesn't. 

register_callback(condition1, functools.partial(handler, 'detail1'))
register_callback(condition2, functools.partial(handler, 'detail2'))

The callback registry makes sure iscoroutinefunction(handler) because we don't 
want to defer error checking to the distant future. But iscoroutinefunction() 
returns False for the partial function. I was hopeful that this might work, but 
alas, no:

register_callback(condition1,
  asyncio.coroutine(functools.partial(handler, 'detail1')))

--
nosy: +curtmcd

___
Python tracker 

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



[issue30605] re.compile fails when compiling bytes under `-bb` mode

2017-06-08 Thread Roy Williams

Changes by Roy Williams :


--
pull_requests: +2081

___
Python tracker 

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



[issue30605] re.compile fails when compiling bytes under `-bb` mode

2017-06-08 Thread Roy Williams

Roy Williams added the comment:

Repro:

```
import re
re.compile(br'^(.*?)$(?m)')
```

Results in
```
Traceback (most recent call last):
  File "test_compile.py", line 2, in 
re.compile(br'^(.*?)$(?m)')
  File "/usr/lib/python3.6/re.py", line 233, in compile
return _compile(pattern, flags)
  File "/usr/lib/python3.6/re.py", line 301, in _compile
p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.6/sre_compile.py", line 562, in compile
p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.6/sre_parse.py", line 856, in parse
p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, False)
  File "/usr/lib/python3.6/sre_parse.py", line 415, in _parse_sub
itemsappend(_parse(source, state, verbose))
  File "/usr/lib/python3.6/sre_parse.py", line 741, in _parse
' (truncated)' if len(source.string) > 20 else '',
BytesWarning: str() on a bytes instance
```

--

___
Python tracker 

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



[issue30605] re.compile fails when compiling bytes under `-bb` mode

2017-06-08 Thread Roy Williams

New submission from Roy Williams:

import re
re.compile(br'^(.*?)$(?m)')

--
components: Regular Expressions
messages: 295473
nosy: Roy Williams, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: re.compile fails when compiling bytes under `-bb` mode
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue27645] Supporting native backup facility of SQLite

2017-06-08 Thread R. David Murray

R. David Murray added the comment:

There's a good chance, yes.  You'll have to keep periodically pinging the issue 
(say once a month :), and if you can specifically talk someone into doing a 
review your chances go up :)   For it to go in we need a review from a 
core-dev, but one or more reviews from non-core-devs will help it move along as 
well (less for the core-dev to do when they find the time to do the review).

--
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue27534] IDLE: Reduce number and time for user process imports

2017-06-08 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Yes, I ran test_idle before I submitted the pull request.  I wasn't sure if I 
was missing something based on your comments of the test failing.

--

___
Python tracker 

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



[issue27534] IDLE: Reduce number and time for user process imports

2017-06-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Yes, I do want to continue this.  As I explained in msg270522, I shelved (but 
not abandoned) the autocomplete patch because it caused a test failure I did 
not (and do not) understand, and because I found another fix for that issue.  
The reductions I noted above were for the patch I did apply, not this one.

Update: I just created pr_2011 and test_idle passes.  I'm puzzled. I don't 
remember patching autocomplete since last July.  Anyway, if the patch works, I 
can now decide if I really want to go this route.  It makes sense to keep 
related functions together.  It also makes sense to keep functions that run in 
the same process together.  I should see if this patch has any noticeable 
benefit (time and import reduction) and if a similar patch for call tips works 
and has benefit.

--
versions: +Python 3.7

___
Python tracker 

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



[issue30604] co_extra_freefuncs is stored thread locally and can lead to crashes

2017-06-08 Thread Dino Viehland

Changes by Dino Viehland :


--
pull_requests: +2080

___
Python tracker 

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



[issue30529] Incorrect error messages for invalid whitespaces in f-string subexpressions

2017-06-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Eric.

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

___
Python tracker 

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



[issue30529] Incorrect error messages for invalid whitespaces in f-string subexpressions

2017-06-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 570b1c971c31cd08dbf060f4e21636c40aa47786 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-30529: Fix errors for invalid whitespaces in f-string subexpressions. 
(GH-1888) (#2013)
https://github.com/python/cpython/commit/570b1c971c31cd08dbf060f4e21636c40aa47786


--

___
Python tracker 

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



[issue30604] co_extra_freefuncs is stored thread locally and can lead to crashes

2017-06-08 Thread Dino Viehland

New submission from Dino Viehland:

The co_extra_freefuncs are stored in PyThreadState.  When calling 
_PyEval_RequestCodeExtraIndex you are given a thread specific index.  The code 
object can then lose it's last reference on a different thread, and the wrong 
free function can be called if users of the extra space have made calls to get 
their index in different orders.  

This can also lead to crashes if the extra thread hasn't yet requested extra 
indexes either.

--
assignee: dino.viehland
components: Interpreter Core
keywords: patch
messages: 295467
nosy: brett.cannon, dino.viehland, yselivanov
priority: normal
severity: normal
stage: patch review
status: open
title: co_extra_freefuncs is stored thread locally and can lead to crashes
type: crash
versions: Python 3.6

___
Python tracker 

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



[issue30603] textwrap: declining indent level has no test case

2017-06-08 Thread Jonathan Eunice

Changes by Jonathan Eunice :


--
pull_requests: +2079

___
Python tracker 

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



Re: New to Python - Career question

2017-06-08 Thread Fred Stluka
   On 6/6/17 5:39 PM, [1]pta...@gmail.com wrote:

 New to Python and have been at it for about a month now. I'm doing well and 
like it very much. Considering a career change down the road and have been 
wondering... What are the job prospects for a middle age entry level 
programmer. Just trying to get a better understanding where I stand career 
wise.  Appreciate all feed back. Thanks!

   Are you asking about job prospects based on experience with Python
   vs other languages?

   If so, here's a site that shows the relative demand for various
   programming languages over time.  Based on its huge database of
   job listings.  Also shows the relative supply of programmers in
   various languages over time.  You can specify which languages
   or other marketable skills to show in the graph:
   -
   
[2]https://www.indeed.com/jobtrends/q-python-q-ruby-q-php-q-javascript-q-java-q-perl.html

   Hope this helps,
   --Fred

   --

   Fred Stluka -- [3]mailto:f...@bristle.com -- [4]http://bristle.com/~fred/
   Bristle Software, Inc -- [5]http://bristle.com -- Glad to be of service!
   Open Source: Without walls and fences, we need no Windows or Gates.

   --

References

   Visible links
   1. mailto:pta...@gmail.com
   2. 
https://www.indeed.com/jobtrends/q-python-q-ruby-q-php-q-javascript-q-java-q-perl.html
   3. mailto:f...@bristle.com
   4. http://bristle.com/~fred/
   5. http://bristle.com/
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30418] test_communicate_epipe() of test_subprocess fails randomly on AMD64 Windows7 SP1 3.x

2017-06-08 Thread STINNER Victor

STINNER Victor added the comment:


New changeset b319d09ee4427aac1ee8f298692127d34ef57dc0 by Victor Stinner in 
branch '3.6':
bpo-30418: Popen.communicate() always ignore EINVAL (#2002) (#2004)
https://github.com/python/cpython/commit/b319d09ee4427aac1ee8f298692127d34ef57dc0


--

___
Python tracker 

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



[issue30601] [Windows] test_winconsoleio leaks references

2017-06-08 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 31b950ab86f5c99a18c16dbf1900b854b94e0659 by Victor Stinner in 
branch '3.6':
bpo-30601: Fix a refleak in WindowsConsoleIO (#2003) (#2008)
https://github.com/python/cpython/commit/31b950ab86f5c99a18c16dbf1900b854b94e0659


--

___
Python tracker 

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



[issue30603] textwrap: declining indent level has no test case

2017-06-08 Thread Jonathan Eunice

New submission from Jonathan Eunice:

The case where textwrap.dedent() handles a declining indent level, requiring it 
to revise its margin estimate downward, remains untested.

This issue is opened in support of an imminent PR that adds an appropriate test.

--
components: Library (Lib)
messages: 295464
nosy: jonathaneunice
priority: normal
severity: normal
status: open
title: textwrap: declining indent level has no test case
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue30529] Incorrect error messages for invalid whitespaces in f-string subexpressions

2017-06-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +2078

___
Python tracker 

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



[issue30529] Incorrect error messages for invalid whitespaces in f-string subexpressions

2017-06-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 2e9cd5825c5ccdbb6f65a57c0c7941078e003c14 by Serhiy Storchaka in 
branch 'master':
bpo-30529: Fix errors for invalid whitespaces in f-string subexpressions. 
(#1888)
https://github.com/python/cpython/commit/2e9cd5825c5ccdbb6f65a57c0c7941078e003c14


--

___
Python tracker 

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



[issue30602] [Windows] os.spawn*() tests of test_os leak references on Windows

2017-06-08 Thread Eryk Sun

Eryk Sun added the comment:

The memory leak is in os_spawnv_impl and os_spawnve_impl in 
Modules/posixmodule.c. The call fails with a ValueError when the first argument 
in the argv list is an empty string, in which case these functions both 
mistakenly pass i (0) to free_string_array() as the count of strings to free. 
But the conversion was successful, so it needs to include the current string in 
the count, i.e. `i + 1`.

The fix for this could also address the following two issues, which are mostly 
cosmetic in nature. os_spawnve_impl needs its TypeError message to be special 
cased the same as in os_spawnv_impl, i.e. "spawnve() arg 2 must contain only 
strings". Currently it uses the default message from the failed conversion: 
"expected str, bytes or os.PathLike object, not %.200s". Also, its ValueError 
message needs to reference "spawnve()" instead of "spawnv()".

--
nosy: +eryksun

___
Python tracker 

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



[issue30596] Add close() to multiprocessing.Process

2017-06-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

close() wouldn't terminate the underlying process, so the process would still 
exist (and wouldn't easily be stoppable from Python anymore) if you were to 
call close() before terminate() or join().

Perhaps we should instead mandate people call join() before close()?

--

___
Python tracker 

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



[issue30596] Add close() to multiprocessing.Process

2017-06-08 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +asksol

___
Python tracker 

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



[issue27534] IDLE: Reduce number and time for user process imports

2017-06-08 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +2077

___
Python tracker 

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



[issue27534] IDLE: Reduce number and time for user process imports

2017-06-08 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Terry,

I've applied this patch to 3.7 and made a pull request.  This seemed like a fix 
you wanted to move forward with, so I hope that's helpful.

--
nosy: +csabella

___
Python tracker 

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



[issue30596] Add close() to multiprocessing.Process

2017-06-08 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
pull_requests: +2076

___
Python tracker 

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



[issue29237] Create enum for pstats sorting options

2017-06-08 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks for checking in, Ethan.

Sorry, since this was first assigned to me, I got pre-occupied with other 
issues and projects in the core-workflow.

Ratnadeep, if you are still interested, please go ahead with this issue. I've 
unassigned myself.

Thanks.

--
assignee: Mariatta -> 

___
Python tracker 

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



PyDev 5.8.0: Code Coverage fixes, IronPython debugging

2017-06-08 Thread Fabio Zadrozny
PyDev 5.8.0 Release Highlights

   -

   *Important* PyDev now requires Java 8 and Eclipse 4.6 (Neon) onwards.
   - PyDev 5.2.0 is the last release supporting Eclipse 4.5 (Mars).
   -

   *Code Analysis*
   - Fixed issue getting existing PyLint markers.
  - There's now an Info and an Ignore level.
   -

   *Debugger*
   - The debugger now provides hooks for clients and provides ways to
  extend the handling of custom types. See:
  
https://github.com/fabioz/PyDev.Debugger/tree/master/pydevd_plugins/extensions
(patch
  by *Yuli Fiterman*).
  - Fixed issue where the debugger could end up removing quotes on
  args. *#PyDev-797*
  - The debugger now works with IronPython again -- although note that
  *IronPython* *2.7.6* and *2.7.7* have a critical bug which prevents
  IronPython from working in PyDev:
  https://github.com/IronLanguages/main/issues/1663
   -

   *Code Coverage*
   - Fixed issue getting code-coverage version. *#PyDev-791*
  - Properly works when running with pytest (provided that pytest-cov
  is installed).
   -

   *Others*
   - Update .yaml file for google app engine project templates (patch by
  *JunjieW*).
  - Upgraded Lucene to 6.1.0 (patch by *Sopot Cela*).
  - Update docstring from parameters (Ctrl+1 on *def*) properly
  considers sphinx with types. *#PyDev-787*
  - Code Completion: Properly finding *__init__* from superclass in
  inherited classes. *#PyDev-802*
  - No longer showing icon to start interactive console in toolbar
  because Eclipse could end up creating multiple entries which were shown
  forever. *#PyDev-708*
  - Other minor bugfixes.

What is PyDev?

PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and
IronPython development.

It comes with goodies such as code completion, syntax highlighting, syntax
analysis, code analysis, refactor, debug, interactive console, etc.

Details on PyDev: http://pydev.org
Details on its development: http://pydev.blogspot.com
What is LiClipse?

LiClipse is a PyDev standalone with goodies such as support for Multiple
cursors, theming, TextMate bundles and a number of other languages such as
Django Templates, Jinja2, Kivy Language, Mako Templates, Html, Javascript,
etc.

It's also a commercial counterpart which helps supporting the development
of PyDev.

Details on LiClipse: http://www.liclipse.com/

Cheers,

--
Fabio Zadrozny
--

Software Developer

LiClipse
http://www.liclipse.com

PyDev - Python Development Environment for Eclipse
http://pydev.org
http://pydev.blogspot.com

PyVmMonitor - Python Profiler
http://www.pyvmmonitor.com/
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29237] Create enum for pstats sorting options

2017-06-08 Thread Ethan Furman

Ethan Furman added the comment:

Marriatta, perhaps it is time to let Ratnadeep work on this issue?

--

___
Python tracker 

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



[issue30545] Enum equality across modules: comparing objects instead of values

2017-06-08 Thread Ethan Furman

Ethan Furman added the comment:

No test code has been provided, so lacking any evidence of this problem I am 
closing this issue.

Do not reopen without testable code to show the failure.

--
resolution:  -> not a bug
stage: test needed -> resolved
status: open -> closed

___
Python tracker 

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



Re: Reg : Wikipedia 1.4 package

2017-06-08 Thread Ned Batchelder
On Thursday, June 8, 2017 at 11:10:49 AM UTC-4, Siva Kumar S wrote:
> Dear members,
> 
> how to install wikipedia 1.4 package in python 2.7 above without PIP.

Why don't you want to use pip?

You can probably just download the .tar.gz, unpack it, and run:

python setup.py install

but pip will be better.

--Ned.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30597] Show expected input in custom "print" error message

2017-06-08 Thread Sanyam Khurana

Changes by Sanyam Khurana :


--
pull_requests: +2075

___
Python tracker 

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



Re: python certification

2017-06-08 Thread justin walters
On Thu, Jun 8, 2017 at 4:49 AM, Gonzalo V  wrote:

> hi,
> good day.
> where can i get a python certification?
>
> thanks!
> --
> https://mail.python.org/mailman/listinfo/python-list
>

I don't believe there is any official certification. Nor do I believe that
a Python
certification would be something employers are even looking for.

That said, if you really need some document that says you know Python,
edX and udacity do offer completion certificates for their courses I
believe.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python certification

2017-06-08 Thread Bob Gailer
On Jun 8, 2017 7:58 AM, "Gonzalo V"  wrote:
>
> hi,
> good day.
> where can i get a python certification?
I'm not sure there is such a thing. Try Googling.
> thanks!
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Psycopg2 pool clarification

2017-06-08 Thread Israel Brewster

---
Israel Brewster
Systems Analyst II
Ravn Alaska
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7293
---




> On Jun 7, 2017, at 10:31 PM, dieter  wrote:
> 
> israel  writes:
>> On 2017-06-06 22:53, dieter wrote:
>> ...
>> As such, using psycopg2's pool is essentially
>> worthless for me (plenty of use for it, i'm sure, just not for me/my
>> use case).
> 
> Could you not simply adjust the value for the "min" parameter?
> If you want at least "n" open connections, then set "min" to "n".

Well, sure, if I didn't care about wasting resources (which, I guess many 
people don't). I could set "n" to some magic number that would always give 
"enough" connections, such that my application never has to open additional 
connections, then adjust that number every few months as usage changes. In 
fact, now that I know how the logic of the pool works, that's exactly what I'm 
doing until I am confident that my caching replacement is solid. 

Of course, in order to avoid having to open/close a bunch of connections during 
the times when it is most critical - that is, when the server is under heavy 
load - I have to set that number arbitrarily high. Furthermore, that means that 
much of the time many, if not most, of those connections would be idle. Each 
connection uses a certain amount of RAM on the server, not to mention using up 
limited connection slots, so now I've got to think about if my server is sized 
properly to be able to handle that load not just occasionally, but constantly - 
when reducing server load by reducing the frequency of connections being 
opened/closed was the goal in the first place. So all I've done is trade 
dynamic load for static load - increasing performance at the cost of resources, 
rather than more intelligently using the available resources. All-in-all, not 
the best solution, though it does work. Maybe if load was fairly constant it 
would make more sense though. So like I said *my* use case, which
  is a number of web apps with varying loads, loads that also vary from 
day-to-day and hour-to-hour.

On the other hand, a pool that caches connections using the logic I laid out in 
my original post would avoid the issue. Under heavy load, it could open 
additional connections as needed - a performance penalty for the first few 
users over the min threshold, but only the first few, rather than all the users 
over a certain threshold ("n"). Those connections would then remain available 
for the duration of the load, so it doesn't need to open/close numerous 
connections. Then, during periods of lighter load, the unused connections can 
drop off, freeing up server resources for other uses. A well-written pool could 
even do something like see that the available connection pool is running low, 
and open a few more connections in the background, thus completely avoiding the 
connection overhead on requests while never having more than a few "extra" 
connections at any given time. Even if you left of the expiration logic, it 
would still be an improvement, because while unused connections wouldn't d
 rop, the "n" open connections could scale up dynamically until you have 
"enough" connections, without having to figure out and hard-code that "magic 
number" of open connections.

Why wouldn't I want something like that? It's not like its hard to code - took 
me about an hour and a half to get to a working prototype yesterday. Still need 
to write tests and add some polish, but it works. Perhaps, though, the common 
thought is just "throw more hardware at it and keep a lot of connections open 
at all time?" Maybe I was raised to conservatively, or the company I work for 
is too poor :-D

> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30601] [Windows] test_winconsoleio leaks references

2017-06-08 Thread Eryk Sun

Eryk Sun added the comment:

Segev included a fix for this leak in PR 1927 for bpo30555, but I suppose it's 
better to fix it separately.

--
nosy: +Segev Finer, eryksun

___
Python tracker 

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




[issue27645] Supporting native backup facility of SQLite

2017-06-08 Thread Lele Gaifax

Lele Gaifax added the comment:

Is there any chance this could be accepted for Python 3.7?

--

___
Python tracker 

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



[issue30418] test_communicate_epipe() of test_subprocess fails randomly on AMD64 Windows7 SP1 3.x

2017-06-08 Thread STINNER Victor

STINNER Victor added the comment:


New changeset e5bdad2201de45c203037e59491e4fea56def56d by Victor Stinner in 
branch '2.7':
bpo-30418: Popen.communicate() always ignore EINVAL (#2002) (#2006)
https://github.com/python/cpython/commit/e5bdad2201de45c203037e59491e4fea56def56d


--

___
Python tracker 

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



[issue30418] test_communicate_epipe() of test_subprocess fails randomly on AMD64 Windows7 SP1 3.x

2017-06-08 Thread STINNER Victor

STINNER Victor added the comment:


New changeset df04c088493bdbc2defea5e225a94e9bdd8e759f by Victor Stinner in 
branch '3.5':
bpo-30418: Popen.communicate() always ignore EINVAL (#2002) (#2005)
https://github.com/python/cpython/commit/df04c088493bdbc2defea5e225a94e9bdd8e759f


--

___
Python tracker 

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



[issue30601] [Windows] test_winconsoleio leaks references

2017-06-08 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2074

___
Python tracker 

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



[issue30601] [Windows] test_winconsoleio leaks references

2017-06-08 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 29adc13bd797d9c9e7fcb893a7c49ce7f7ad388c by Victor Stinner in 
branch 'master':
bpo-30601: Fix a refleak in WindowsConsoleIO (#2003)
https://github.com/python/cpython/commit/29adc13bd797d9c9e7fcb893a7c49ce7f7ad388c


--

___
Python tracker 

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



[issue30602] [Windows] os.spawn*() tests of test_os leak references on Windows

2017-06-08 Thread STINNER Victor

New submission from STINNER Victor:

The leak can be reproduced with the minimum attached test_os.py:

C:\haypo\python>PCbuild\amd64\python_d.exe -m test -R 3:3 test_os
Run tests sequentially
0:00:00 [1/1] test_os
beginning 6 repetitions
123456
..
test_os leaked [2, 2, 2] memory blocks, sum=6
test_os failed

1 test failed:
test_os

Total duration: 172 ms
Tests result: FAILURE

--
components: Tests, Windows
files: test_os.py
messages: 295451
nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: [Windows] os.spawn*() tests of test_os leak references on Windows
type: resource usage
versions: Python 3.7
Added file: http://bugs.python.org/file46935/test_os.py

___
Python tracker 

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



[issue29512] regrtest refleak: implement bisection feature

2017-06-08 Thread STINNER Victor

STINNER Victor added the comment:

Oops, I uploaded the wrong version. It should now work.

--
Added file: http://bugs.python.org/file46934/bisect_test.py

___
Python tracker 

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



[issue29512] regrtest refleak: implement bisection feature

2017-06-08 Thread STINNER Victor

STINNER Victor added the comment:

Updated script: support Windows, fix cmdline help.

--
Added file: http://bugs.python.org/file46933/bisect_test.py

___
Python tracker 

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



[issue30418] test_communicate_epipe() of test_subprocess fails randomly on AMD64 Windows7 SP1 3.x

2017-06-08 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2073

___
Python tracker 

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



[issue30418] test_communicate_epipe() of test_subprocess fails randomly on AMD64 Windows7 SP1 3.x

2017-06-08 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2072

___
Python tracker 

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



[issue30418] test_communicate_epipe() of test_subprocess fails randomly on AMD64 Windows7 SP1 3.x

2017-06-08 Thread STINNER Victor

Changes by STINNER Victor :


--
versions: +Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue30418] test_communicate_epipe() of test_subprocess fails randomly on AMD64 Windows7 SP1 3.x

2017-06-08 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2071

___
Python tracker 

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



[issue30418] test_communicate_epipe() of test_subprocess fails randomly on AMD64 Windows7 SP1 3.x

2017-06-08 Thread STINNER Victor

STINNER Victor added the comment:


New changeset d52aa31378ae43e044a300edfe8285954c167216 by Victor Stinner in 
branch 'master':
bpo-30418: Popen.communicate() always ignore EINVAL (#2002)
https://github.com/python/cpython/commit/d52aa31378ae43e044a300edfe8285954c167216


--

___
Python tracker 

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



[issue30601] [Windows] test_winconsoleio leaks references

2017-06-08 Thread STINNER Victor

STINNER Victor added the comment:

With https://github.com/python/cpython/pull/2003 test_winconsoleio doesn't leak 
anymore.

--

___
Python tracker 

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



[issue30601] [Windows] test_winconsoleio leaks references

2017-06-08 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2070

___
Python tracker 

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



Reg : Wikipedia 1.4 package

2017-06-08 Thread Siva Kumar S
Dear members,

How to install Wikipedia 1.4 package in python 2.7 above without PIP.

from,
Sivakumar S
-- 
https://mail.python.org/mailman/listinfo/python-list


Reg : Wikipedia 1.4 package

2017-06-08 Thread Siva Kumar S
Dear members,

how to install wikipedia 1.4 package in python 2.7 above without PIP.

from,
Sivakumar S
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30601] [Windows] test_winconsoleio leaks references

2017-06-08 Thread STINNER Victor

STINNER Victor added the comment:

The following code leaks one reference:

f = _io._WindowsConsoleIO('CONIO$', 'r')
f.close()
f = None

--

___
Python tracker 

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



[issue30601] [Windows] test_winconsoleio leaks references

2017-06-08 Thread STINNER Victor

New submission from STINNER Victor:

http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Refleaks%203.x/builds/22/steps/test/logs/stdio

0:00:12 [  7/405/1] test_winconsoleio failed
beginning 6 repetitions
123456
..
test_winconsoleio leaked [43, 43, 43] references, sum=129

--
components: Tests, Windows
messages: 295445
nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: [Windows] test_winconsoleio leaks references
type: resource usage
versions: Python 3.7

___
Python tracker 

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



[issue30597] Show expected input in custom "print" error message

2017-06-08 Thread Eric V. Smith

Eric V. Smith added the comment:

That sounds good to me.

Just to elaborate on my earlier message, since it might have been too terse:

I think it would be misleading to give in error at:

print >>sys.stderr, "message"

and say:
Did you mean 'print("message")'?

since they're not equivalent. If you can produce the equivalent text in the 
error message, then that's fine with me:

Did you mean 'print("message", file=sys.stderr)'?

--

___
Python tracker 

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



[issue30418] test_communicate_epipe() of test_subprocess fails randomly on AMD64 Windows7 SP1 3.x

2017-06-08 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2069

___
Python tracker 

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



[issue27321] Email parser creates a message object that can't be flattened

2017-06-08 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

ok, I have tested on 3.6 and 3.5, just with the test. and in this case, we get 
the errors on both.
if we apply the patch of Johannes, the test passes and there is no issues.

+1 the backports for 3.5 and 3.6 is just a git cherry-picking.

--

___
Python tracker 

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



[issue27321] Email parser creates a message object that can't be flattened

2017-06-08 Thread R. David Murray

R. David Murray added the comment:

I'm going to try to review this this weekend.

--

___
Python tracker 

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



[issue30599] os.register_at_fork(): allow to unregister callbacks -- test_threaded_import leaks references

2017-06-08 Thread STINNER Victor

STINNER Victor added the comment:

With https://github.com/python/cpython/pull/2001 test_threaded_import doesn't 
leak anymore.

--

___
Python tracker 

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



[issue30599] os.register_at_fork(): allow to unregister callbacks -- test_threaded_import leaks references

2017-06-08 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2068

___
Python tracker 

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



[issue30599] os.register_at_fork(): allow to unregister callbacks -- test_threaded_import leaks references

2017-06-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Agreed with Serhiy.  test_threaded_import should just re-import a module which 
has less side effects.

--

___
Python tracker 

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



[issue30597] Show expected input in custom "print" error message

2017-06-08 Thread Nick Coghlan

Nick Coghlan added the comment:

Those are easy enough to check with strncmp() even in C, so we could make them 
manageable by just including "" in the error message, rather than the 
full text of the original statement.

That is:

Did you mean 'print()'? # Default 
Did you mean 'print(, file=)'?  # starts with '>>'
Did you mean 'print(, end=' ')'?# ends with ','

That's basically correct even when printing multiple arguments, so I'd avoid 
the temptation to detect commas within the line (particularly since they might 
be inside a string).

--

___
Python tracker 

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



[issue30592] Bad error message 'bool()() takes no keyword arguments'

2017-06-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

We don't have such code currently. The function name containing "()" looks 
silly. But funcname is not always a constant string, you can set it to 
arbitrary string when create a BaseException subclass.

--

___
Python tracker 

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



[issue30600] Error message incorrect when index is called with keyword argument ("[].index(x=2)")

2017-06-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, pleas do this.

--

___
Python tracker 

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



[issue30599] os.register_at_fork(): allow to unregister callbacks -- test_threaded_import leaks references

2017-06-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This make the API and implementation more complex. I prefer making tests not 
creating several instances of the random module. Or do this in a short-living 
subprocess.

--
nosy: +rhettinger

___
Python tracker 

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



[issue30592] Bad error message 'bool()() takes no keyword arguments'

2017-06-08 Thread STINNER Victor

STINNER Victor added the comment:

> If add an assertion, the user code could provoke a crash by creating an 
> exception type with a name containing "()": type('E()', (BaseException,), {}).

Right. Do we have such code currently? If not, we can remove the assertion 
later if we want to use such error message.

> Thus this should be a runtime check that raises an exception. What the type 
> of an exception should be raised?

Sorry, I don't understand. funcname is not always a constant string like "func"?

Well, it was just an idea. Ignore it if you see practical issues.

--

___
Python tracker 

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



Re: Hello from a super noob!

2017-06-08 Thread Andre Müller
Hello,

you can refactor your code a little bit and learn more about exceptions:

def get_numbers():
first = None
second = None
while True:
try:
if first is None:
first = int(input('Enter your first number: '))
if second is None:
second = int(input('Enter your second number: '))
except ValueError:
print('You have to enter a number')
continue
else:
return first, second


Am 08.06.2017 um 01:56 schrieb CB:
> Hi everyone,
> I am taking a python class and I'm stuck in an exercise.
>
> what am i doing wrong? Can anyone try to run it? Thanks so much! 
>
> #Description:Input validation and while loops.
>
>
> import random
> def main(): #main function need in all programs for automated testing
> 
>
> #your program goes here
> 
> print()
>
>
>
> 
> print("This program will help us practice input validation and while 
> loops.")
> print("The user will be asked to enter two numbers which will both be 
> validated. ")
> print("The sum of the numbers will then be displayed in a complex print 
> statement ")
> print("and the user will be asked if they would like to run the program 
> again."
> )
> print()
> print()
> 
> while True:
> FirstNumber = input ("Please enter the first number: ")
> if FirstNumber.isdigit ():
> FirstNumber = int(FirstNumber)
> break 
> else:
>   print ("Invalid response. Please enter a whole number. " )
> 
> while True:
> 
> SecondNumber = input ("Please enter the second number: " )
> if SecondNumber.isdigit():
> SecondNumber= int(SecondNumber)
>
> break
> else:
> print("Invalid response. Please enter a whole number." )
> 
> print()
> print (str(FirstNumber) + " + " + str(SecondNumber)+ " = " + 
> str(FirstNumber + SecondNumber))
> print()
> 
> while True:
> 
> ans= input('Would you like to run the program again (Y/N) : ')
> if ans== 'Y' or ans== 'N':
> break
>
> else:
> print(" lnvalid response. Please answer with 'Y' or 'N' ")
>
> if ans== 'N':
> break
>   
>




signature.asc
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30600] Error message incorrect when index is called with keyword argument ("[].index(x=2)")

2017-06-08 Thread SylvainDe

SylvainDe added the comment:

Can I give this a try or is anyone working on this already ?

--

___
Python tracker 

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



[issue30584] test_os fails on non-English (Russian) Windows

2017-06-08 Thread STINNER Victor

STINNER Victor added the comment:

Thanks Denis Osipov for the fix and backports!

--

___
Python tracker 

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



[issue30600] Error message incorrect when index is called with keyword argument ("[].index(x=2)")

2017-06-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Good catch! This issue is similar to issue30534, but caused by generated code.

The solution is easy: make Argument Clinic (Tools/clinic/clinic.py) generating 
_PyArg_NoStackKeywords() before _PyArg_ParseStack() and regenerate all 
generated by Argument Clinic code (make clinic).

--
components: +Argument Clinic
keywords: +easy
nosy: +larry, serhiy.storchaka
stage:  -> needs patch
versions: +Python 3.6

___
Python tracker 

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



[issue30599] test_threaded_import leaks references

2017-06-08 Thread STINNER Victor

STINNER Victor added the comment:

> The leak was introduced by the commit 
> 346cbd351ee0dd3ab9cb9f0e4cb625556707877e.

This commit "bpo-16500: Allow registering at-fork handlers" adds the following 
code to Lib/random.py:

+if hasattr(_os, "fork"):
+_os.register_at_fork(_inst.seed, when='child')

test_threaded_import creates fresh instance of the random module and so 
os.register_at_fork() is called multiple time with multiple different callbacks.

The problem is that it's not currently possible to remove callbacks. It would 
be nice to be able to unregister callbacks, at least a private for unit tests.

The minimum would be a os.unregister_at_fork() function.

I would prefer to have get/set functions to be able to restore callbacks once 
tests complete, but also to detect when an unexpected callback was registered. 
For example, write a new test in Lib/test/libregrtest/save_env.py for regrtest.

See also bpo-16500 which added the new API.

--
nosy: +pitrou, serhiy.storchaka

___
Python tracker 

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



[issue27321] Email parser creates a message object that can't be flattened

2017-06-08 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue27321] Email parser creates a message object that can't be flattened

2017-06-08 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

maybe we could merge the PR, and I could propose a backport for 3.5 and 3.6.

2.7 is affected ?

--
nosy: +matrixise

___
Python tracker 

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



[issue30599] os.register_at_fork(): allow to unregister callbacks -- test_threaded_import leaks references

2017-06-08 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
nosy: +matrixise

___
Python tracker 

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



[issue30599] os.register_at_fork(): allow to unregister callbacks -- test_threaded_import leaks references

2017-06-08 Thread STINNER Victor

Changes by STINNER Victor :


--
title: test_threaded_import leaks references -> os.register_at_fork(): allow to 
unregister callbacks -- test_threaded_import leaks references

___
Python tracker 

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



  1   2   >