[issue26789] Please do not log during shutdown

2017-02-21 Thread Vinay Sajip

Vinay Sajip added the comment:

> sys.is_finalizing()

Good to know. Is the "sys" binding guaranteed to be around even when other 
builtins like "open" aren't available? In order to handle things "nicely" 
during shutdown, what guarantees can logging code rely on in terms of what's 
available? I'm assuming handling things nicely doesn't mean just swallowing any 
exceptions raised.

--

___
Python tracker 

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



Re: python decorator

2017-02-21 Thread Argentinian Black ops lll
*** SOLVED ***
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python decorator

2017-02-21 Thread Argentinian Black ops lll
Thanks for the quick response...! you saved me a lot of time, thank you!
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue22273] abort when passing certain structs by value using ctypes

2017-02-21 Thread Vinay Sajip

Changes by Vinay Sajip :


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



Re: python decorator

2017-02-21 Thread Cameron Simpson

On 21Feb2017 22:44, alfredocabre...@gmail.com  wrote:

I have a python function and a decorator that works just fine.

def fun_cache(function):
   memo = {}
   def wrapper(*args):
   if args in memo:
   return memo[args]
   else:
   rv = function(*args)
   memo[args] = rv
   return rv
   return wrapper


@fun_cache
def fib(n):
   if (n < 2): return 1
   else: return fib(n-1) + fib(n-2)

assert(fib(0) == 1)
assert(fib(3) == 3)
assert(fib(6) == 13)
assert(fib(10) == 89)
assert(fib(30) == 1346269)
assert(fib(100) == 573147844013817084101)
assert(fib(400) == 
284812298108489611757988937681460995615380088782304890986477195645969271404032323901)


Now I will like to call the @fun_cache decorator like this :

@fun_cache(cache={})

Any help?


You need to write "fun_cache" as a function accepting a cache argument, and 
returning a decorator that uses that cache.


Like:

   def fun_cache(cache):
   def fun_cache_decorator(function):
   def wrapper(*args):
   ... save things in cache instead of memo ...
   return wrapper
   return fun_cache_decorator

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


[issue28624] Make the `cwd` argument to `subprocess.Popen` accept a `PathLike`

2017-02-21 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2017-02-21 Thread Vinay Sajip

Vinay Sajip added the comment:

Patch attached, including tests. If it looks halfway sensible, I can work up a 
PR.

--
Added file: http://bugs.python.org/file46660/fix-22273-02.diff

___
Python tracker 

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



Re: [ANN] New Slack Group Dedicated to learning Python

2017-02-21 Thread Joe Anonimist
On Wednesday, 22 February 2017 08:07:01 UTC+1, Joe Anonimist  wrote:
> Hello all!
> 
> Me and a few other Python enthusiasts started a Slack group dedicated to 
> learning Python. All of us know the basics of Python and our goal is to 
> acquire new skills that would help us get jobs as Python developers. Our plan 
> is to collaborate on Python projects to get experience and become Python 
> professionals.
> 
> If you are interested send me your email address and I'll send you an 
> invitation to join the group. If you have a Reddit account you can visit our 
> subreddit https://www.reddit.com/r/pystudygroup/ and PM me your mail for an 
> invitation.

Invitation sent :)
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29110] [patch] Fix file object leak in `aifc.open` when given invalid AIFF file.

2017-02-21 Thread INADA Naoki

INADA Naoki added the comment:


New changeset 03f68b60e17b57f6f13729ff73245dbb37b30a4c by INADA Naoki in branch 
'master':
bpo-29110: Fix file object leak in `aifc.open` when given invalid AIFF file. 
(GH-162)
https://github.com/python/cpython/commit/03f68b60e17b57f6f13729ff73245dbb37b30a4c


--
nosy: +inada.naoki

___
Python tracker 

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



[ANN] New Slack Group Dedicated to learning Python

2017-02-21 Thread Joe Anonimist
Hello all!

Me and a few other Python enthusiasts started a Slack group dedicated to 
learning Python. All of us know the basics of Python and our goal is to acquire 
new skills that would help us get jobs as Python developers. Our plan is to 
collaborate on Python projects to get experience and become Python 
professionals.

If you are interested send me your email address and I'll send you an 
invitation to join the group. If you have a Reddit account you can visit our 
subreddit https://www.reddit.com/r/pystudygroup/ and PM me your mail for an 
invitation.
-- 
https://mail.python.org/mailman/listinfo/python-list


python decorator

2017-02-21 Thread alfredocabrera4
I have a python function and a decorator that works just fine.

def fun_cache(function):
memo = {}
def wrapper(*args):
if args in memo:
return memo[args]
else:
rv = function(*args)
memo[args] = rv
return rv
return wrapper


@fun_cache
def fib(n):
if (n < 2): return 1
else: return fib(n-1) + fib(n-2)

assert(fib(0) == 1)
assert(fib(3) == 3)
assert(fib(6) == 13)
assert(fib(10) == 89)
assert(fib(30) == 1346269)
assert(fib(100) == 573147844013817084101)
assert(fib(400) == 
284812298108489611757988937681460995615380088782304890986477195645969271404032323901)


Now I will like to call the @fun_cache decorator like this :

@fun_cache(cache={})

Any help?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29589] test_asyncio & test_multiprocessing_forkserver failed

2017-02-21 Thread Xiang Zhang

Xiang Zhang added the comment:

Hmm, it seems not Python's fault. I can't reproduce the failure either. So I am 
going to close this issue.

--
resolution:  -> works for me
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



[issue29589] test_asyncio & test_multiprocessing_forkserver failed

2017-02-21 Thread Louie Lu

Louie Lu added the comment:

Both test_asyncio & test_multiprocessing_forkserver passed on latest 3.6 and 
4.8.3-1-ARCH.

--
nosy: +louielu

___
Python tracker 

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



[issue29565] Still broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2017-02-21 Thread Vinay Sajip

Vinay Sajip added the comment:


New changeset 3cc5817cfaf5663645f4ee447eaed603d2ad290a by GitHub in branch 
'3.6':
Fixed bpo-29565: Corrected ctypes passing of large structs by value on Windows 
AMD64. (#168) (#220)
https://github.com/python/cpython/commit/3cc5817cfaf5663645f4ee447eaed603d2ad290a


--

___
Python tracker 

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



[issue29565] Still broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2017-02-21 Thread Vinay Sajip

Vinay Sajip added the comment:


New changeset 8fa7e22134ac9626b2188ff877f6aeecd3c9e618 by GitHub in branch 
'3.5':
Fixed bpo-29565: Corrected ctypes passing of large structs by value on Windows 
AMD64. (#168) (#221)
https://github.com/python/cpython/commit/8fa7e22134ac9626b2188ff877f6aeecd3c9e618


--

___
Python tracker 

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



[issue29589] test_asyncio & test_multiprocessing_forkserver failed

2017-02-21 Thread Marcel Widjaja

Marcel Widjaja added the comment:

Both test_asyncio & test_multiprocessing_forkserver work for me. I'm on the 
latest 3.6 and Mac OS 10.11.6

--
nosy: +mawidjaj

___
Python tracker 

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



[issue29617] Drop Python 3.4 support from asyncio

2017-02-21 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +195

___
Python tracker 

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



[issue28814] Deprecation notice on inspect.getargvalues() is incorrect

2017-02-21 Thread Berker Peksag

Berker Peksag added the comment:


New changeset 0899b9809547ec2894dcf88cf4bba732c5d47d0d by Berker Peksag in 
branch 'master':
bpo-28814: Undeprecate inadvertently deprecated inspect functions. (#122)
https://github.com/python/cpython/commit/0899b9809547ec2894dcf88cf4bba732c5d47d0d


--

___
Python tracker 

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



[issue20438] inspect: Deprecate getfullargspec?

2017-02-21 Thread Berker Peksag

Berker Peksag added the comment:


New changeset 0899b9809547ec2894dcf88cf4bba732c5d47d0d by Berker Peksag in 
branch 'master':
bpo-28814: Undeprecate inadvertently deprecated inspect functions. (#122)
https://github.com/python/cpython/commit/0899b9809547ec2894dcf88cf4bba732c5d47d0d


--

___
Python tracker 

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



[issue29617] Drop Python 3.4 support from asyncio

2017-02-21 Thread INADA Naoki

New submission from INADA Naoki:

asyncio for Python 3.3 has not been released for two years.
https://pypi.python.org/pypi/asyncio

We have many code in asyncio for support Python 3.3.
How about removing them?

--
components: asyncio
messages: 288332
nosy: gvanrossum, inada.naoki, yselivanov
priority: normal
severity: normal
status: open
title: Drop Python 3.4 support from asyncio
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



[issue7769] SimpleXMLRPCServer.SimpleXMLRPCServer.register_function as decorator

2017-02-21 Thread Xiang Zhang

Changes by Xiang Zhang :


--
pull_requests: +194

___
Python tracker 

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



[issue10701] Error pickling objects with mutating __getstate__

2017-02-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> not a bug
stage: needs patch -> 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



[issue29616] input() after restarting causes bug

2017-02-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
status: open -> pending

___
Python tracker 

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



[issue29614] Additional implementation alternative to DictReader

2017-02-21 Thread INADA Naoki

INADA Naoki added the comment:

I don't feel TableReader is really useful.

Would you show some realistic example when TableReader is better than
normal csv.Reader?

--
nosy: +inada.naoki

___
Python tracker 

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



[issue29616] input() after restarting causes bug

2017-02-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I am not sure what you mean by 'this bug'.  I presume by 'take input' you mean 
'display keystrokes on the input line'.  If so, the behavior you describe for 
3.6 is the correct behavior and not a bug: accept kestrokes until 'Enter' is 
pressed or until the process awaiting input is killed.  F5 kills the current 
user code execution process, as opposed to the IDLE GUI interaction process, 
and starts a new one.  That is what 'Restart' means.

Experimenting with IDLE on 3.5 and 3.6 on Windows 10, I experienced the 
(correct) behavior described above.  It does not make any difference whether 
there was any unsent input before hitting F5 or not.  I did not notice any 
difference between the two versions.  In both, hitting 'Enter' terminates input.

Unless you can provide more details that convince me otherwise, I will close 
this as 'not a bug'.

--

___
Python tracker 

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



[issue29403] mock's autospec's behavior on method-bound builtin functions is broken

2017-02-21 Thread Aaron Gallagher

Changes by Aaron Gallagher :


--
pull_requests: +193

___
Python tracker 

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



[issue26789] Please do not log during shutdown

2017-02-21 Thread INADA Naoki

INADA Naoki added the comment:

I'm -1 on suppress log silently.
While error message is bit surprising,

Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 93, in __del__
  File "/usr/lib/python3.5/asyncio/base_events.py", line 1160, in 
call_exception_handler
...
  File "/usr/lib/python3.5/logging/__init__.py", line 1037, in _open
NameError: name 'open' is not defined

This traceback is very meaningful.
You can read tasks.py:93, and find there are pending task remains.

Implementing fallback mechanism make potential risk to miss such very
important traceback.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue27660] Replace size_t with Py_ssize_t as the type of local variable in list_resize

2017-02-21 Thread Xiang Zhang

Xiang Zhang added the comment:


New changeset 4cee049f5b6864066b8315e9b54de955e5487dfc by GitHub in branch 
'master':
bpo-27660: remove unnecessary overflow checks in list_resize (GH-189)
https://github.com/python/cpython/commit/4cee049f5b6864066b8315e9b54de955e5487dfc


--

___
Python tracker 

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



[issue27660] Replace size_t with Py_ssize_t as the type of local variable in list_resize

2017-02-21 Thread Xiang Zhang

Changes by Xiang Zhang :


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



[issue22087] asyncio: support multiprocessing (support fork)

2017-02-21 Thread Alexander Mohr

Alexander Mohr added the comment:

I believe this is now worse due to https://github.com/python/asyncio/pull/452

before I was able to simply create a new run loop from sub-processes however 
you will now get the error "Cannot run the event loop while another loop is 
running".  The state of the run loop should not be preserved in sub-processes 
either.

--
nosy: +thehesiod
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



[issue16011] "in" should be consistent with return value of __contains__

2017-02-21 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag
stage: needs patch -> patch review
versions: +Python 3.5, Python 3.6, Python 3.7 -Python 3.2, Python 3.3, Python 
3.4

___
Python tracker 

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



[issue29554] profile/pstat doc clariification

2017-02-21 Thread Berker Peksag

Berker Peksag added the comment:


New changeset b067a5eef7fdf69264d3578654996fc3755df4ea by GitHub in branch 
'3.6':
bpo-29554: Improve docs for pstat module and profile. (#88) (#227)
https://github.com/python/cpython/commit/b067a5eef7fdf69264d3578654996fc3755df4ea


--

___
Python tracker 

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



[issue29554] profile/pstat doc clariification

2017-02-21 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue29554] profile/pstat doc clariification

2017-02-21 Thread Berker Peksag

Berker Peksag added the comment:


New changeset 6336f0d156feec0f109a8d01da108cf96e3d9c60 by GitHub in branch 
'3.5':
bpo-29554: Improve docs for pstat module and profile. (#88) (#228)
https://github.com/python/cpython/commit/6336f0d156feec0f109a8d01da108cf96e3d9c60


--

___
Python tracker 

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



[issue2771] Test issue

2017-02-21 Thread Ezio Melotti

Changes by Ezio Melotti :


--
pull_requests: +192

___
Python tracker 

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



[issue29554] profile/pstat doc clariification

2017-02-21 Thread Berker Peksag

Changes by Berker Peksag :


--
pull_requests: +191

___
Python tracker 

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



[issue29616] input() after restarting causes bug

2017-02-21 Thread Juan

New submission from Juan:

This bug can be recreated by opening a file whose content is "input()" with 
IDLE, press F5 and the shell opens as expected. Without making the input in the 
shell stop, press F5 in the script again. In Python 3.5 IDLE only take input 
until another F5 (or Ctrl+F6) in the script. In Python 3.6 IDLE only take input 
until an Enter is pressed or another F5 (or Ctrl+F6) in the script.

--
assignee: terry.reedy
components: IDLE
messages: 288324
nosy: Juan, terry.reedy
priority: normal
severity: normal
status: open
title: input() after restarting causes bug
type: behavior
versions: 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



[issue29554] profile/pstat doc clariification

2017-02-21 Thread Berker Peksag

Changes by Berker Peksag :


--
pull_requests: +190

___
Python tracker 

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



RE: Python application launcher (for Python code)

2017-02-21 Thread Deborah Swanson
Ethan Furman wrote, on February 21, 2017 1:13 PM
> 
> On 02/21/2017 11:59 AM, Deborah Swanson wrote:
> 
> > I think I'll have a go with Cooperative Linux first
> 
> It certainly looks interesting, but doesn't seem to have any 
> activity since late 2014.
> 
> --
> ~Ethan~

I can't remember where I picked up the link for Cooperative Linux (aka
coLinux), but the newsletter Import Python is a good bet, and it would
have been in an issue no more than 2 weeks ago.  Maybe somebody's trying
to revive it, or just spread the word. The article certainly glowed
about how useful it is.

Guess I'll download and try it, it's a sourceforge page. So if it
downloads and installs (that may be the tricky part), I'm probably set
to go.

I don't have a problem with old software and it seems some open software
isn't updated for long periods of time. If it works and does something
useful for me, I'm fine with it. Some of my oldest spreadsheets I use
daily are about 15 years old, and so is the Excel I run them in.  ;)

Deborah

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


[issue26789] Please do not log during shutdown

2017-02-21 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



[issue27850] Remove 3DES from cipher list (sweet32 CVE-2016-2183)

2017-02-21 Thread STINNER Victor

STINNER Victor added the comment:

Larry: "I agree completely Jim.  The problem is that OpenSSL regularly 
discovers face-meltingly bad security bugs, so it frequently pulls the 
"security exception" lever."

We chose to maintain our own cipher list, and so we have to maintain it.

I created a pull request to backport the fix to Python 3.4.

--
nosy: +haypo
pull_requests: +189

___
Python tracker 

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



[issue29565] Still broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2017-02-21 Thread Steve Dower

Steve Dower added the comment:

I approved the two backports. Thanks Vinay!

--

___
Python tracker 

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



Re: Python application launcher (for Python code)

2017-02-21 Thread Ethan Furman

On 02/21/2017 11:59 AM, Deborah Swanson wrote:


I think I'll have a go with Cooperative Linux first


It certainly looks interesting, but doesn't seem to have any activity since 
late 2014.

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


[issue26789] Please do not log during shutdown

2017-02-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> How does a particular piece of logging package code know it's being called 
> during Python finalization?

sys.is_finalizing()

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26789] Please do not log during shutdown

2017-02-21 Thread R. David Murray

R. David Murray added the comment:

If I understand correctly, the logging during shutdown coming out of asyncio 
helps debug errors in asyncio programs, and this logging can't happen before 
shutdown starts (so the application calling logging.shutdown would just hide 
the errors, I think).

Yes, the general problem affects more than just logging, and when it is 
reasonable to do so we try to fix (or at least cleanly report) these shutdown 
issues in stdlib code.  Whether it is reasonable to do so in this case I don't 
know.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue29614] Additional implementation alternative to DictReader

2017-02-21 Thread foxfluff

Changes by foxfluff :


--
pull_requests: +187

___
Python tracker 

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



[issue29532] functools.partial is not compatible between 2.7 and 3.5

2017-02-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +186

___
Python tracker 

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



RE: Python application launcher (for Python code)

2017-02-21 Thread Deborah Swanson

I wrote, on February 21, 2017 12:12 PM
> 
> Grant Edwards wrote, on February 21, 2017 11:21 AM
> > NB: I haven't used any of these lately...
> > 
>   http://unxutils.sourceforge.net/
>   http://www.mingw.org/  (look for msys)
>   https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058
> (git's bash-terminal)
>   https://sourceforge.net/projects/ezwinports/   
> 
> There were a couple another very highly recommended commercial Unix
> shell+utilities products (MKS Toolkit, Interix) that I used to
> use. But AFAIK, they all got bought and killed by Microsoft.
> 
> 
> Thanks Grant for these suggestions. Microsoft may have killed 
> them at the time, but useful software can resurface a number 
> of ways.  I'll keep your list and go looking for them 
> someday. I think something like Drawers or MyLauncher that 
> Jim mentioned would fit the bill for my immediate use, but 
> old Unix utilities sound kinda neat in themselves, and well 
> worth looking into in my free time. (haha, free time you say? 
> But seriously I'd like to check them out.)
> 
> Deborah

Whoops, I just noticed on rereading that only MKS Toolkit and Interix
were bought and killed by Microsoft, not your entire list. Guess they
can't buy open source code anyway.

While this is sad for MKS Toolkit and Interix, it does mean the others
are probably still available as open source.

I used to work in a partially Unix house in mechanical engineering at
Ingersoll-Rand. I did DOS and the brand new ever Windows (1.0?) at the
time, but I remember looking at MKS Toolkit on the Unix machines to see
if it could be adapted to Windows. Very sad if it is lost for good.

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


[issue29615] SimpleXMLRPCDispatcher._dispatch mangles tracebacks when invoking RPC calls through _dispatch

2017-02-21 Thread Petr MOTEJLEK

New submission from Petr MOTEJLEK:

Hello,

We discovered that SimpleXMLRPCDispatcher mangles tracebacks printed from 
within the invoked RPC methods when an object that has _dispatch(method, 
params) defined has been registered with it

Steps to reproduce
- use 
https://docs.python.org/3.4/library/xmlrpc.server.html#xmlrpc.server.SimpleXMLRPCServer.register_instance
 and register within SimpleXMLRPCDispatcher an object with the 
_dispatch(method, params) method defined
- invoke any RPC method that prints a traceback (perhaps raise an exception in 
it, catch it and use logging.exception to log it) --> the traceback will 
display a very strange looking KeyError (its value being the name of the 
invoked method) and then the actual exception that was fed into 
logging.exception

The reason for this is that SimpleXMLRPCDispatcher._dispatch first attempts to 
acquire the function to invoke by reading from the functions registered with 
the dispatcher. When this attempt fails, KeyError is raised. During its 
handling different approaches are taken to acquire the function and for all but 
one when the function is acquired, handling of the KeyError ends and the 
function is called properly, outside of the except block

However, in the case of objects that define the _dispatch(method, params) 
function, the _dispatch(method, params) function is called straight away, still 
within the except block handling the KeyError, and this leads to the mangled 
traceback

This behavior is neither documented, nor expected (we believe) and thus the 
code should be changed

Will submit a PR (incl. tests) for this later on

--
components: Library (Lib)
messages: 288319
nosy: p...@motejlek.net
priority: normal
severity: normal
status: open
title: SimpleXMLRPCDispatcher._dispatch mangles tracebacks when invoking RPC 
calls through _dispatch
versions: Python 3.4, Python 3.5, 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



[issue29614] Additional implementation alternative to DictReader

2017-02-21 Thread Kirk Cieszkiewicz Jr.

New submission from Kirk Cieszkiewicz Jr.:

As discussed in the following:
https://bugs.python.org/issue17537
https://mail.python.org/pipermail/python-ideas/2013-January/018844.html

DictReader has a feature that will destroy data without warning if fieldnames 
had duplicate values (manual or automatic entries)

Proposing renaming and re-implementation of DictReader class to instead return 
enumerate style output with a child class of DictReader to specifically return 
a dict object.

--
components: Library (Lib)
messages: 288318
nosy: Kirk Cieszkiewicz Jr.
priority: normal
severity: normal
status: open
title: Additional implementation alternative to DictReader
type: enhancement
versions: Python 2.7, 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



RE: Python application launcher (for Python code)

2017-02-21 Thread Deborah Swanson
Chris Warrick wrote, on February 21, 2017 11:26 AM
> 
> On 21 February 2017 at 20:21, Grant Edwards 
>  wrote:
> > On 2017-02-21, Rob Gaddi  wrote:
> >> On 02/20/2017 06:16 PM, Deborah Swanson wrote:
> >>
> >> > [snip lots about using Windows but rather be
> >> > using Linux but not wanting to have to spend lots of energy 
> >> > switching right now]
> >>
> >> You know, I'm always reluctant to recommend it, because it can 
> >> definitely get you tied in knots.  But you're about the ideal 
> >> candidate for looking into https://www.cygwin.com/
> >
> > There are other ways to get "shell and unix-utilities" for Windows 
> > that are less "drastic" than Cygwin: they don't try to provide a 
> > complete a Unix development environment or the illusion of Unix 
> > filesystem semantics.  [Remember: a Unix shell without a set of 
> > accompanying utilitys is pretty useless, since Unix shells 
> don't have 
> > all of the "built-in" commands that Windows shells do.]
> >
> > NB: I haven't used any of these lately...
> >
> >   http://unxutils.sourceforge.net/
> >   http://www.mingw.org/  (look for msys)
> >   
> https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f
058  (git's bash-terminal)
>   https://sourceforge.net/projects/ezwinports/
>
> There were a couple another very highly recommended commercial Unix
> shell+utilities products (MKS Toolkit, Interix) that I used to
> use. But AFAIK, they all got bought and killed by Microsoft.

Git Bash, or basically msys, is pretty reasonable. But if you are on
Windows 10, you might like the built-in Windows Subsystem for Linux (aka
Bash on Ubuntu on Windows) more - it's real Linux that runs alongside
Windows, but less crazy than Cygwin.

-- 
Chris Warrick 
PGP: 5EAAEA16


Thanks Chris, I kind of thought useful software like this would
resurface in some form, and you given me msys' new name (Git Bash), or
one of them anyway.

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


RE: Python application launcher (for Python code)

2017-02-21 Thread Deborah Swanson
Grant Edwards wrote, on February 21, 2017 11:21 AM
> 
> On 2017-02-21, Rob Gaddi  wrote:
> > On 02/20/2017 06:16 PM, Deborah Swanson wrote:
> >
> > > [snip lots about using Windows but rather be
> > > using Linux but not wanting to have to spend lots of
> > > energy switching right now]
> >
> > You know, I'm always reluctant to recommend it, because it can
> > definitely get you tied in knots.  But you're about the 
> ideal candidate 
> > for looking into https://www.cygwin.com/
> 
> There are other ways to get "shell and unix-utilities" for 
> Windows that are less "drastic" than Cygwin: they don't try 
> to provide a complete a Unix development environment or the 
> illusion of Unix filesystem semantics.  [Remember: a Unix 
> shell without a set of accompanying utilitys is pretty 
> useless, since Unix shells don't have all of the "built-in" 
> commands that Windows shells do.]
> 
> NB: I haven't used any of these lately...
> 
  http://unxutils.sourceforge.net/
  http://www.mingw.org/  (look for msys)
  https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058
(git's bash-terminal)
  https://sourceforge.net/projects/ezwinports/   

There were a couple another very highly recommended commercial Unix
shell+utilities products (MKS Toolkit, Interix) that I used to
use. But AFAIK, they all got bought and killed by Microsoft.


Thanks Grant for these suggestions. Microsoft may have killed them at
the time, but useful software can resurface a number of ways.  I'll keep
your list and go looking for them someday. I think something like
Drawers or MyLauncher that Jim mentioned would fit the bill for my
immediate use, but old Unix utilities sound kinda neat in themselves,
and well worth looking into in my free time. (haha, free time you say?
But seriously I'd like to check them out.)

Deborah

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


RE: Python application launcher (for Python code)

2017-02-21 Thread Deborah Swanson
Jim wrote, on February 21, 2017 9:51 AM
> 
> On 02/21/2017 09:43 AM, Deborah Swanson wrote:
> > I like Linux for this job, as it has a number of capabilities that 
> > Windows doesn't have, and I was looking for an improvement on what I

> > can do in Windows. If you do a lot of computing it's nice to have 
> > tools and code you commonly use, and only the ones you've chosen, 
> > conveniently available from one interface. This interface could have

> > other functionalities itself.
> >
> > I was asking if anyone knew of Python code that acts in this way,
and 
> > it appears so far that the answer is no.
> >
> > Deborah
> >
> 
> If you switch to Linux you might look at a program called Drawers. I
use 
> it on Ubuntu 14.04 and 16.04. It sits on the launcher panel and if you

> click it it opens up and you can click on programs to start them. Most

> things you can drag and drop on it, some things you must do a little 
> editing to get them to start. It is written in Python I think.
> 
> On Mint 18 I use a program called MyLauncher. It sits on the top panel

> and will drop down a menu of programs to start. It's a little more
hands 
> on as you must add your programs to a config file to get them in the 
> launcher. Don't think this one is written in Python.
> 
> Both are in the OS's repositories.
> 
> Regards,  Jim

Thanks, Jim.  This is exactly the type of program I was looking for.

A number of people have made some very helpful suggestions on ways to
get a Linux shell installed in Windows, but since I really don't want to
burn up a lot of time (any time at all actually) for a Windows solution,
I think I'll have a go with Cooperative Linux first. It's a way of
installing Linux on a separate partition that runs concurrently with
Windows and doesn't require booting back and forth between them - why go
cheap when you can have the real thing, which is what you originally
wanted anyway? Might not be that much trouble either, though I think the
installation is tricky.

I'll try both Drawers and taking a look at MyLauncher's code. Chances
are MyLauncher, or the parts of it I want, can be rewritten in Python.
But if Drawers is sufficient and no better recommendations surface, I'll
probably just go with that.

Originally I wanted Python code that would run in Windows (for minimal
fuss to get an application launcher now), and I might look at Drawers
for that. But chances are that an application launcher would make heavy
use of the os, and in Drawers that would be Linux and not Windows.

I think Cooperative Linux should be my next stop for this project.

Deborah

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


[issue29565] Still broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2017-02-21 Thread Vinay Sajip

Changes by Vinay Sajip :


--
pull_requests: +185

___
Python tracker 

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



[issue29565] Still broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2017-02-21 Thread Vinay Sajip

Changes by Vinay Sajip :


--
pull_requests: +184

___
Python tracker 

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



Re: Request Help With ttk.Notebook Tabs

2017-02-21 Thread Terry Reedy

On 2/21/2017 1:02 PM, Wildman via Python-list wrote:

Python 3.4.2
Linux platform


I am working on a program that has tabs created with ttk.Notebook.
The code for creating the tabs is working but there is one thing I
have not been able to figure out.  As is, the tabs are located up
against the lower edge of the caption bar.  I would like to have
them a little lower to make room above the tabs for other widgets
such as labels and/or command buttons.  Here is the code I use to
create the window and tabs...

class Window(tk.Frame):
def __init__(self, master=None):
tk.Frame.__init__(self, master)
master.title("My Program")
nb = ttk.Notebook(root, width=600, height=340)
tab1 = tk.Frame(nb)
tab2 = tk.Frame(nb)
nb.add(tab1, text="Tab1")
nb.add(tab2, text="Tab2")
nb.pack(expand=1, fill="both")


This is too minimal.  If I copy, paste, and run the above, it will fail. 
I will not guess what other code (which you should minimize) you 
actually had to make this run.  See https://stackoverflow.com/help/mcve, 
which is *great* advice that most SO unfortunately ignore.



I have tried the grid and place methods to move the tabs down but
neither works.  I have tried the methods both before and after the
pack method.  Here is an example of what I have tried...

nb.grid(row=2, column=2)
or
nb.place(x=10, y=10)

Would be appreciated if anyone could provide any guidance.


I have not specifically used Notebook, but

0. You MUST NOT mix geometry methods within a particular toplevel or 
frame.  From what you wrote (without complete code), you might have.


1. All widgets that go within a particular container widget must have 
that container as parent.  Although you put the notebook code in the 
window(frame) init, its parent is root, so it will appear outside the 
window, if indeed the window is made visible (which it is not in the 
code you posted.  So either get rid of the window(frame) code or put the 
notebook in the windows instance


 nb = ttk.Notebook(self, width=600, height=340)

The former is easier for minimal proof-of-concept testing, the latter 
may be better for final development and maintenance.


2. Packing is order dependent.

3. Gridding is not order dependent, but empty rows and column take no space.

In any case, the following works for me on 3.6 and Win10.

import tkinter as tk
from tkinter import ttk

root = tk.Tk()

e = ttk.Label(root, text='Widget outside of notebook')

nb = ttk.Notebook(root, width=600, height=340)
tab1 = ttk.Frame(nb)
tab2 = ttk.Frame(nb)
ttk.Label(tab1, text='Text on notebook tab 1').pack()
ttk.Label(tab2, text='Tab 2 text').pack()
nb.add(tab1, text="Tab1")
nb.add(tab2, text="Tab2")

e.grid(row=0)
nb.grid(row=1)

#root.mainloop()  # not needed when run from IDLE

--
Terry Jan Reedy

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


[issue26789] Please do not log during shutdown

2017-02-21 Thread Vinay Sajip

Vinay Sajip added the comment:

Calling logging.shutdown() when you know you're about to exit should eliminate 
some of the issues.

--

___
Python tracker 

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



[issue26789] Please do not log during shutdown

2017-02-21 Thread Vinay Sajip

Vinay Sajip added the comment:

> The logging module should be be enhanced to handle more nicely such error 
> during Python finalization.

How does a particular piece of logging package code know it's being called 
during Python finalization? This sort of problem (exceptions caused by 
disappearing builtins, for example) isn't confined to logging, surely?

--

___
Python tracker 

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



Re: Python application launcher (for Python code)

2017-02-21 Thread Chris Warrick
On 21 February 2017 at 20:21, Grant Edwards  wrote:
> On 2017-02-21, Rob Gaddi  wrote:
>> On 02/20/2017 06:16 PM, Deborah Swanson wrote:
>>
>> > [snip lots about using Windows but rather be
>> > using Linux but not wanting to have to spend lots of
>> > energy switching right now]
>>
>> You know, I'm always reluctant to recommend it, because it can
>> definitely get you tied in knots.  But you're about the ideal candidate
>> for looking into https://www.cygwin.com/
>
> There are other ways to get "shell and unix-utilities" for Windows
> that are less "drastic" than Cygwin: they don't try to provide a
> complete a Unix development environment or the illusion of Unix
> filesystem semantics.  [Remember: a Unix shell without a set of
> accompanying utilitys is pretty useless, since Unix shells don't have
> all of the "built-in" commands that Windows shells do.]
>
> NB: I haven't used any of these lately...
>
>   http://unxutils.sourceforge.net/
>   http://www.mingw.org/  (look for msys)
>   https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058  (git's 
> bash-terminal)
>   https://sourceforge.net/projects/ezwinports/
>
> There were a couple another very highly recommended commercial Unix
> shell+utilities products (MKS Toolkit, Interix) that I used to
> use. But AFAIK, they all got bought and killed by Microsoft.

Git Bash, or basically msys, is pretty reasonable. But if you are on
Windows 10, you might like the built-in Windows Subsystem for Linux
(aka Bash on Ubuntu on Windows) more — it’s real Linux that runs
alongside Windows, but less crazy than Cygwin.

-- 
Chris Warrick 
PGP: 5EAAEA16
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python application launcher (for Python code)

2017-02-21 Thread Grant Edwards
On 2017-02-21, Rob Gaddi  wrote:
> On 02/20/2017 06:16 PM, Deborah Swanson wrote:
>
> > [snip lots about using Windows but rather be
> > using Linux but not wanting to have to spend lots of
> > energy switching right now]
>
> You know, I'm always reluctant to recommend it, because it can 
> definitely get you tied in knots.  But you're about the ideal candidate 
> for looking into https://www.cygwin.com/

There are other ways to get "shell and unix-utilities" for Windows
that are less "drastic" than Cygwin: they don't try to provide a
complete a Unix development environment or the illusion of Unix
filesystem semantics.  [Remember: a Unix shell without a set of
accompanying utilitys is pretty useless, since Unix shells don't have
all of the "built-in" commands that Windows shells do.]

NB: I haven't used any of these lately...

  http://unxutils.sourceforge.net/
  http://www.mingw.org/  (look for msys)
  https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058  (git's 
bash-terminal)
  https://sourceforge.net/projects/ezwinports/   

There were a couple another very highly recommended commercial Unix
shell+utilities products (MKS Toolkit, Interix) that I used to
use. But AFAIK, they all got bought and killed by Microsoft.

-- 
Grant Edwards   grant.b.edwardsYow! Please come home with
  at   me ... I have Tylenol!!
  gmail.com

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


[issue29613] Support for SameSite Cookies

2017-02-21 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
stage:  -> patch review

___
Python tracker 

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



[issue28909] Adding LTTng-UST tracing support

2017-02-21 Thread Łukasz Langa

Łukasz Langa added the comment:

Thanks for working on this! A few thoughts.

1. Keep the existing names.

"PyTrace" is already a name in use for a different purpose. I understand the 
itch to make the name more "right" but I am in general not a fan of renaming 
"PyDTrace" to anything else now. It was a placeholder from day one (SystemTap 
uses it, too, after all). So, looking closer at the patch now I'd prefer us to 
keep all existing names and add LTTng as another alternative engine here. That 
will make the patch much shorter.

A nit: the name LTTng-UST is rather unfriendly, especially when used without 
the dash and in all lowercase characters. Given that we're using "dtrace" and 
"systemtap", it would be simpler to just use "lttng" (drop the "-ust").


2. DTrace vs SystemTap vs LTTng.

It's impossible to have DTrace and SystemTap at the same time, so it was 
natural to choose to auto-detect the engine. With LTTng it becomes less obvious 
what the configure options should be.

Should it be possible at all to have *both* LTTng and SystemTap compiled in at 
the same time? Does this make sense?

If yes, then keeping --with-dtrace and --with-lttng as separate options makes 
sense to me. If it doesn't, we should change the option to look like this: 
`--with(out)-dtrace=[=detect]`. This way people could pass the following:

--without-dtrace (the default)
--with-dtrace  (detects DTrace or SystemTap or LTTng, in that order)
--with-dtrace=detect  (like the one above)
--with-dtrace=dtrace  (assumes DTrace, fails if cannot proceed)
--with-dtrace=systemtap  (assumes SystemTap, fails if cannot proceed)
--with-dtrace=lttng  (assumes LTTng, fails if cannot proceed)  


3. Other questions.

> Clang on macOS gives `warning: code will never be executed` warnings on the 
> various arms of the `if (PyTraceEnabled(...))` statements, and GCC on Linux 
> warn about unused variables `lineno`, `funcname` and `filename` in 
> `pytrace_function_{entry,return}`, since the actual use of those variables as 
> arguments is preprocessed out of existance.

Do you get unused code warnings without your patch applied? I don't.


> I would be happy to re-post this to GitHub issues if so desired.

CPython is not using GitHub issues.

--

___
Python tracker 

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



Re: problems installing pylab

2017-02-21 Thread Terry Reedy

On 2/21/2017 10:47 AM, Robert William Lunnon wrote:


I am trying to install pylab alongside python 3.6.


On Windows 10 as you said at the bottom.


However when I type

python -m pip install pylab


Try

py -3.6 -m pip install pylab

The '.6' should not be needed, but will make the command fail if you 
another 3.x but not 3.6.



I get the message

No module named site


If any python.exe ran, /Lib/site.py should be present and you should not 
see that.  What happens if you enter just 'python'?



In the documentation [documentation for installing python modules in
python 3.6.0 documentation] it says: The above example assumes that the
option to adjust the system PATH environment variable was selected when
installing python.


In most cases, one is better to just use the py command on Windows.  If 
there is only one python.exe installed


>py

will start it.  If multiple pythons are installed, the latest is the 
default but you can use the flags to select -2 or -3 to select the 
latest of each or -x.y to select a specific version that is not the 
latest of the x series.  (I still type 'python' (now for 3.6) because a) 
it works since I made the install selection, and b) 20 years of habit ;-).)



How do I do this? I am running Windows 10


You can repair or replace the existing install, but I don't suggest it.

--
Terry Jan Reedy

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


Re: Request Help With ttk.Notebook Tabs

2017-02-21 Thread Wildman via Python-list
On Tue, 21 Feb 2017 18:22:31 +, MRAB wrote:

> On 2017-02-21 18:02, Wildman via Python-list wrote:
>> Python 3.4.2
>> Linux platform
>>
>>
>> I am working on a program that has tabs created with ttk.Notebook.
>> The code for creating the tabs is working but there is one thing I
>> have not been able to figure out.  As is, the tabs are located up
>> against the lower edge of the caption bar.  I would like to have
>> them a little lower to make room above the tabs for other widgets
>> such as labels and/or command buttons.  Here is the code I use to
>> create the window and tabs...
>>
>> class Window(tk.Frame):
>> def __init__(self, master=None):
>> tk.Frame.__init__(self, master)
>> master.title("My Program")
>> nb = ttk.Notebook(root, width=600, height=340)
>> tab1 = tk.Frame(nb)
>> tab2 = tk.Frame(nb)
>> nb.add(tab1, text="Tab1")
>> nb.add(tab2, text="Tab2")
>> nb.pack(expand=1, fill="both")
>>
>> I have tried the grid and place methods to move the tabs down but
>> neither works.  I have tried the methods both before and after the
>> pack method.  Here is an example of what I have tried...
>>
>> nb.grid(row=2, column=2)
>> or
>> nb.place(x=10, y=10)
>>
>> Would be appreciated if anyone could provide any guidance.
>>
> If you want other widgets above the Notebook widget, why don't you just 
> put them there in a frame?

Thanks for the reply.  That approach would work but I found
a simple method that serves the purpose using padx/pady.  I
was doing my research in the areas of grid and place.  Didn't
think about pack.

-- 
 GNU/Linux user #557453
The cow died so I don't need your bull!
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-21 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks everyone. PR has been merged and backported to 3.6 :)
Closing this issue.

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



[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-21 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 9b49133082ec23b67e84d2589e66d7810018e424 by GitHub in branch 
'3.6':
bpo-29453: Remove reference to undefined dictionary ordering in Tutorial 
(GH-140) (#208)
https://github.com/python/cpython/commit/9b49133082ec23b67e84d2589e66d7810018e424


--

___
Python tracker 

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



Re: Request Help With ttk.Notebook Tabs

2017-02-21 Thread Wildman via Python-list
On Tue, 21 Feb 2017 12:02:50 -0600, Wildman wrote:

> Python 3.4.2
> Linux platform
> 
> 
> I am working on a program that has tabs created with ttk.Notebook.
> The code for creating the tabs is working but there is one thing I
> have not been able to figure out.  As is, the tabs are located up
> against the lower edge of the caption bar.  I would like to have
> them a little lower to make room above the tabs for other widgets
> such as labels and/or command buttons.  Here is the code I use to
> create the window and tabs...
> 
> class Window(tk.Frame):
> def __init__(self, master=None):
> tk.Frame.__init__(self, master)
> master.title("My Program")
> nb = ttk.Notebook(root, width=600, height=340)
> tab1 = tk.Frame(nb)
> tab2 = tk.Frame(nb)
> nb.add(tab1, text="Tab1")
> nb.add(tab2, text="Tab2")
> nb.pack(expand=1, fill="both")
> 
> I have tried the grid and place methods to move the tabs down but
> neither works.  I have tried the methods both before and after the
> pack method.  Here is an example of what I have tried...
> 
> nb.grid(row=2, column=2)
> or
> nb.place(x=10, y=10)
> 
> Would be appreciated if anyone could provide any guidance.

I posted too quickly.  I found my answer...

nb.pack(expand=1, fill="both", padx=20, pady=20)

Sorry.

-- 
 GNU/Linux user #557453
The cow died so I don't need your bull!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Request Help With ttk.Notebook Tabs

2017-02-21 Thread MRAB

On 2017-02-21 18:02, Wildman via Python-list wrote:

Python 3.4.2
Linux platform


I am working on a program that has tabs created with ttk.Notebook.
The code for creating the tabs is working but there is one thing I
have not been able to figure out.  As is, the tabs are located up
against the lower edge of the caption bar.  I would like to have
them a little lower to make room above the tabs for other widgets
such as labels and/or command buttons.  Here is the code I use to
create the window and tabs...

class Window(tk.Frame):
def __init__(self, master=None):
tk.Frame.__init__(self, master)
master.title("My Program")
nb = ttk.Notebook(root, width=600, height=340)
tab1 = tk.Frame(nb)
tab2 = tk.Frame(nb)
nb.add(tab1, text="Tab1")
nb.add(tab2, text="Tab2")
nb.pack(expand=1, fill="both")

I have tried the grid and place methods to move the tabs down but
neither works.  I have tried the methods both before and after the
pack method.  Here is an example of what I have tried...

nb.grid(row=2, column=2)
or
nb.place(x=10, y=10)

Would be appreciated if anyone could provide any guidance.

If you want other widgets above the Notebook widget, why don't you just 
put them there in a frame?


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


Re: Python application launcher (for Python code)

2017-02-21 Thread Rob Gaddi

On 02/20/2017 06:16 PM, Deborah Swanson wrote:

> [snip lots about using Windows but rather be
> using Linux but not wanting to have to spend lots of
> energy switching right now]

You know, I'm always reluctant to recommend it, because it can 
definitely get you tied in knots.  But you're about the ideal candidate 
for looking into https://www.cygwin.com/


When my primary PC had to be Windows I used it fairly successfully for 
years.  It works quite well for many things, and can be bullied into 
working well enough for others.  It will probably do what you seem like 
you might want, which is a functioning shell under Windows, and yes it 
works all the way back to XP.  At the low low price of free, you'll 
definitely get your money's worth.


--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list


Request Help With ttk.Notebook Tabs

2017-02-21 Thread Wildman via Python-list
Python 3.4.2
Linux platform


I am working on a program that has tabs created with ttk.Notebook.
The code for creating the tabs is working but there is one thing I
have not been able to figure out.  As is, the tabs are located up
against the lower edge of the caption bar.  I would like to have
them a little lower to make room above the tabs for other widgets
such as labels and/or command buttons.  Here is the code I use to
create the window and tabs...

class Window(tk.Frame):
def __init__(self, master=None):
tk.Frame.__init__(self, master)
master.title("My Program")
nb = ttk.Notebook(root, width=600, height=340)
tab1 = tk.Frame(nb)
tab2 = tk.Frame(nb)
nb.add(tab1, text="Tab1")
nb.add(tab2, text="Tab2")
nb.pack(expand=1, fill="both")

I have tried the grid and place methods to move the tabs down but
neither works.  I have tried the methods both before and after the
pack method.  Here is an example of what I have tried...

nb.grid(row=2, column=2)
or
nb.place(x=10, y=10)

Would be appreciated if anyone could provide any guidance.

-- 
 GNU/Linux user #557453
Keyboard not detected! Press any key to continue...
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29613] Support for SameSite Cookies

2017-02-21 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
versions:  -Python 2.7, Python 3.3, Python 3.4, 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



Re: Python application launcher (for Python code)

2017-02-21 Thread Pavol Lisy
On 2/21/17, Deborah Swanson  wrote:
> Chris Angelico wrote, on February 21, 2017 7:30 AM
>>
>> On Wed, Feb 22, 2017 at 2:16 AM, Deborah Swanson
>>  wrote:
>> > Really?  We used software called Powershell a couple decades ago in
>> > the 90s, as an improvement on the DOS box. I didn't like it much and
> I
>> > was going through software like candy those days. Maybe that version
>
>> > disappeared. It may have re-emerged in an improved form a decade
>> > later.
>>
>> With a name like that, there've almost certainly been
>> multiple things using it. The PowerShell that comes with
>> modern Windowses came out in 2006, and IMO it's less of a
>> shell language and more of a scripting language. And if I
>> want to use a scripting language for program flow control,
>> I'll use Python or Pike, fankyouwerrymuch.
>>
>> ChrisA
>
> Yes, the name "Powershell" would have an appeal to a certain kind of
> would-be "power user", if anyone uses that term anymore. It makes sense
> that the idea would keep cropping up.
>
> And my sentiments exactly on scripting languages other than straight
> Python, which is why I was originally asking if anyone knew of an
> application launcher, written in Python for launching Python code.
>
> --
> https://mail.python.org/mailman/listinfo/python-list

Maybe try to look at https://github.com/spyder-ide/spyder .

It could satisfy your expectations. You can edit, run, debug,
statically analyze python codes and more. And it is open source
written in python...
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python application launcher (for Python code)

2017-02-21 Thread Jim

On 02/21/2017 09:43 AM, Deborah Swanson wrote:

BartC wrote, on February 21, 2017 5:52 AM


On 20/02/2017 15:44, Deborah Swanson wrote:

Ben Finney wrote, on February 19, 2017 11:27 PM


"Deborah Swanson"  writes:


I could probably write this myself, but I'm wondering if

this hasn't



already been done many times.


Can you describe what you are looking for, in enough

detail that we

can know whether it's already been done as you want it?



I deliberately left the question open-ended because I'm

curious what's

out there. I've studied and practiced Python for a little

over a year,

but I've spent that time mostly writing my own code and I

don't really

know much about what and where to look for in modules and packages.

Basically, I now have quite a few Python programs I use frequently,
and as time goes on my collection and uses of it will grow.

Right now

I just want a way to select which one I'd like to run and

run it. I'd

like it to be a standalone application and some sort of system of
categories would be nice.


If you use Windows, then the OS can take care of this. You
don't need a
separate application, just open up a directory showing a list of .py
files, and click on one.

Then if '.py' is correctly associated with the right Python
version, it
will run Python on it.

To group into categories, just put the .py files into separate, aptly
named directories.

The only problem I found, when launching in GUI mode, was that a
console-mode Python program would briefly open a console window that
would then promptly disappear if it finished immediately and
there was
no interaction.

--
bartc


Yes, I can see that only one person who has responded so far is remotely
familiar with what an application launcher is, and that person only
alluded to one, and hinted at some features I saw that could possibly be
used as an application launcher.

I like Linux for this job, as it has a number of capabilities that
Windows doesn't have, and I was looking for an improvement on what I can
do in Windows. If you do a lot of computing it's nice to have tools and
code you commonly use, and only the ones you've chosen, conveniently
available from one interface. This interface could have other
functionalities itself.

I was asking if anyone knew of Python code that acts in this way, and it
appears so far that the answer is no.

Deborah



If you switch to Linux you might look at a program called Drawers. I use 
it on Ubuntu 14.04 and 16.04. It sits on the launcher panel and if you 
click it it opens up and you can click on programs to start them. Most 
things you can drag and drop on it, some things you must do a little 
editing to get them to start. It is written in Python I think.


On Mint 18 I use a program called MyLauncher. It sits on the top panel 
and will drop down a menu of programs to start. It's a little more hands 
on as you must add your programs to a config file to get them in the 
launcher. Don't think this one is written in Python.


Both are in the OS's repositories.

Regards,  Jim



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


[issue29607] Broken stack_effect for CALL_FUNCTION_EX

2017-02-21 Thread INADA Naoki

INADA Naoki added the comment:

Thanks, Matthieu.

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



[issue29607] Broken stack_effect for CALL_FUNCTION_EX

2017-02-21 Thread INADA Naoki

INADA Naoki added the comment:


New changeset 3ab24bdd47fdd9d45719ad49f93d3878d4442d7e by GitHub in branch 
'3.6':
bpo-29607: Fix stack_effect computation for CALL_FUNCTION_EX (GH-219)
https://github.com/python/cpython/commit/3ab24bdd47fdd9d45719ad49f93d3878d4442d7e


--
nosy: +inada.naoki

___
Python tracker 

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



Re: Python application launcher (for Python code)

2017-02-21 Thread eryk sun
On Tue, Feb 21, 2017 at 1:25 AM, Steve D'Aprano
 wrote:
> (2) Add each category to the PYTHONPATH. One easy way to do so is by adding
> the directories to a .pth file.

PYTHONPATH isn't a synonym for sys.path. The PYTHONPATH environment
variable gets used by every installed interpreter, which can be a
problem if it's set permanently. Using .pth files, as suggested here,
is one way around this.

In general, virtual environments [1] are convenient for development.
Install what you need for a project from PyPI, a local wheel cache, or
directly from VCS. IDEs such as PyCharm have integrated support for
virtual environments. Entry-point scripts in a virtual environment
should have a shebang that executes the environment's interpreter, so
they can be run even when the environment isn't active.

[1]: https://docs.python.org/3/library/venv.html

The rest of this message is just for Windows.

To support shebangs, make sure that .py[w] files are associated with
the py launcher, which is installed with Python 3. The installer
defaults to associating .py[w] files with the Python.File and
Python.NoConFile program identifiers (ProgIds). Change it back if
you've modified it. Don't use the command prompt's assoc command for
this. Use the control panel "Default Programs -> Set Associations"
dialog (i.e. associate a file type or protocol with a program). The
descriptions for .py and .pyw in this dialog should be "Python File"
and "Python File (no console)". When you double click on the entries
for .py and .pyw, the associated program should be "Python" with a
rocket on the icon. If not, and you see it in the list, select it.

Otherwise ensure that the Python.File and Python.NoConFile ProgIds are
configured to use the py.exe and pyw.exe launchers. If the launcher
was installed for all users (i.e. per machine), you can use ftype in
an *elevated* command prompt to query and set Python.[NoCon]File. For
example:

C:\>ftype Python.File
Python.File="C:\Windows\py.exe" "%1" %*

C:\>ftype Python.NoConFile
Python.NoConFile="C:\Windows\pyw.exe" "%1" %*

If the launcher was installed for the current user only (i.e. per
user), then you cannot use the ftype command since it only accesses
the local-machine settings. Also, even if you've installed for all
users, maybe you have an old value in HKCU, which takes precedence
over HKLM when the system reads the merged HKCR view.

Use regedit to manually edit the per-user keys if they exist. If
"HKCU\Software\Classes\Python.File\shell\open\command" exists, its
default value should be a template command to run the fully-qualified
path to py.exe plus "%1" for the target script and %* for the
command-line arguments, as shown above. Similarly, if
"HKCU\Software\Classes\Python.NoConFile\shell\open\command" exists, it
should run the same command but with pyw.exe substituted for py.exe.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python application launcher (for Python code)

2017-02-21 Thread Grant Edwards
On 2017-02-21, Deborah Swanson  wrote:

> Yes, I can see that only one person who has responded so far is remotely
> familiar with what an application launcher is, and that person only
> alluded to one, and hinted at some features I saw that could possibly be
> used as an application launcher. 

I think I've read every posting in this thread, and I _still_ don't
know what you mean by "application launcher".

> I like Linux for this job, as it has a number of capabilities that
> Windows doesn't have, and I was looking for an improvement on what I can
> do in Windows. If you do a lot of computing it's nice to have tools and
> code you commonly use, and only the ones you've chosen, conveniently
> available from one interface.

Isn't that what shortcuts and start menu and all the other shiny-bits
on GUI desktop environments do?  [I don't use a "desktop" so maybe I'm
wrong.]  The "root menu" provided by many window managers is also a
common way to do this (that's something I do use).  A command-line
shell like bash is also a common way to do this.  And yes, there are
plenty of them available for Windows.

> This interface could have other functionalities itself. 
>
> I was asking if anyone knew of Python code that acts in this way,

What way?  I can't figure out how what you want is not what's provided
by any of the standard GUI desktop/shells or command-line shells.  Are
you looking for a 1980s-style menu driven UI that were common before
GUIs came into widespread use?

> and it appears so far that the answer is no. 

I think the problem is that you're unable to describe what you want in
a way that's understandable to the people that might be able to answer
your question.

-- 
Grant Edwards   grant.b.edwardsYow! VICARIOUSLY experience
  at   some reason to LIVE!!
  gmail.com

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


[issue26890] inspect.getsource gets source copy on disk even when module has not been reloaded

2017-02-21 Thread Emily Morehouse

Changes by Emily Morehouse :


--
nosy: +emilyemorehouse

___
Python tracker 

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



[issue28121] If module starts with comment or empty line then frame.f_code.co_firstlineno is inconsistent with inspect.findsource

2017-02-21 Thread Emily Morehouse

Changes by Emily Morehouse :


--
nosy: +emilyemorehouse

___
Python tracker 

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



[issue29157] random.c: Prefer getrandom() over getentropy() to support glibc 2.24 on Linux

2017-02-21 Thread Vladimír Čunát

Vladimír Čunát added the comment:

Thanks, I see now.  From my point of view it is related to security, but I/we 
will deal with it somehow.

--

___
Python tracker 

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



[issue29532] functools.partial is not compatible between 2.7 and 3.5

2017-02-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset e48fd93bbb36c6d80aa4eb6af09f58c69d8cf965 by GitHub in branch 
'3.6':
bpo-29532: Altering a kwarg dictionary passed to functools.partial() no longer 
affects a partial object after creation. (#209)
https://github.com/python/cpython/commit/e48fd93bbb36c6d80aa4eb6af09f58c69d8cf965


--

___
Python tracker 

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



[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-21 Thread STINNER Victor

STINNER Victor added the comment:

Is tmpfile() available on Android?

--

___
Python tracker 

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



[issue29603] More informative Queue class: new method that returns number of unfinished tasks

2017-02-21 Thread slytomcat

slytomcat added the comment:

num_threads - unfinished() = the estimation for number of idle threads.

--

___
Python tracker 

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



[issue29603] More informative Queue class: new method that returns number of unfinished tasks

2017-02-21 Thread slytomcat

slytomcat added the comment:

One more problem that adjusting of number of threads is performed exactly after 
placing the new task in the queue. In in some cases we can find that qsuze <> 0 
but it doesn't mean that there is no idle threads. It can be equal to 1 (just 
queued task) as no threads manage to get it yet (don't forgot about GIL).

So even qsuze <> 0 dosn't mean that we need to create a new thread.

But (unfinished() <= num_threads) works perfect in this case also.

--

___
Python tracker 

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



problems installing pylab

2017-02-21 Thread Robert William Lunnon
Dear Python

I am trying to install pylab alongside python 3.6. However when I type

python -m pip install pylab

I get the message

No module named site

In the documentation [documentation for installing python modules in
python 3.6.0 documentation] it says: The above example assumes that the
option to adjust the system PATH environment variable was selected when
installing python.

How do I do this?

I am running Windows 10

Looking forward to hearing from you

Bob




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


RE: Python application launcher (for Python code)

2017-02-21 Thread Deborah Swanson
Chris Angelico wrote, on February 21, 2017 7:30 AM
> 
> On Wed, Feb 22, 2017 at 2:16 AM, Deborah Swanson 
>  wrote:
> > Really?  We used software called Powershell a couple decades ago in 
> > the 90s, as an improvement on the DOS box. I didn't like it much and
I 
> > was going through software like candy those days. Maybe that version

> > disappeared. It may have re-emerged in an improved form a decade 
> > later.
> 
> With a name like that, there've almost certainly been 
> multiple things using it. The PowerShell that comes with 
> modern Windowses came out in 2006, and IMO it's less of a 
> shell language and more of a scripting language. And if I 
> want to use a scripting language for program flow control, 
> I'll use Python or Pike, fankyouwerrymuch.
> 
> ChrisA

Yes, the name "Powershell" would have an appeal to a certain kind of
would-be "power user", if anyone uses that term anymore. It makes sense
that the idea would keep cropping up.

And my sentiments exactly on scripting languages other than straight
Python, which is why I was originally asking if anyone knew of an
application launcher, written in Python for launching Python code.

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


RE: Python application launcher (for Python code)

2017-02-21 Thread Deborah Swanson
BartC wrote, on February 21, 2017 5:52 AM
> 
> On 20/02/2017 15:44, Deborah Swanson wrote:
> > Ben Finney wrote, on February 19, 2017 11:27 PM
> >>
> >> "Deborah Swanson"  writes:
> >>
> >>> I could probably write this myself, but I'm wondering if 
> this hasn't
> >
> >>> already been done many times.
> >>
> >> Can you describe what you are looking for, in enough 
> detail that we 
> >> can know whether it's already been done as you want it?
> 
> > I deliberately left the question open-ended because I'm 
> curious what's 
> > out there. I've studied and practiced Python for a little 
> over a year, 
> > but I've spent that time mostly writing my own code and I 
> don't really 
> > know much about what and where to look for in modules and packages.
> >
> > Basically, I now have quite a few Python programs I use frequently, 
> > and as time goes on my collection and uses of it will grow. 
> Right now 
> > I just want a way to select which one I'd like to run and 
> run it. I'd 
> > like it to be a standalone application and some sort of system of 
> > categories would be nice.
> 
> If you use Windows, then the OS can take care of this. You 
> don't need a 
> separate application, just open up a directory showing a list of .py 
> files, and click on one.
> 
> Then if '.py' is correctly associated with the right Python 
> version, it 
> will run Python on it.
> 
> To group into categories, just put the .py files into separate, aptly 
> named directories.
> 
> The only problem I found, when launching in GUI mode, was that a 
> console-mode Python program would briefly open a console window that 
> would then promptly disappear if it finished immediately and 
> there was 
> no interaction.
> 
> -- 
> bartc

Yes, I can see that only one person who has responded so far is remotely
familiar with what an application launcher is, and that person only
alluded to one, and hinted at some features I saw that could possibly be
used as an application launcher. 

I like Linux for this job, as it has a number of capabilities that
Windows doesn't have, and I was looking for an improvement on what I can
do in Windows. If you do a lot of computing it's nice to have tools and
code you commonly use, and only the ones you've chosen, conveniently
available from one interface. This interface could have other
functionalities itself. 

I was asking if anyone knew of Python code that acts in this way, and it
appears so far that the answer is no. 

Deborah

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


[issue29612] TarFile.extract() suffers from hard links inside tarball

2017-02-21 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +lars.gustaebel

___
Python tracker 

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



[issue29603] More informative Queue class: new method that returns number of unfinished tasks

2017-02-21 Thread slytomcat

slytomcat added the comment:

Not exactly there are 3 cases:

If qsize <> 0 it means there is no idle consumers threads, all of them must be 
busy: we need to create one more. No doubt.

If qsize = 0 it means one of two cases: 
- all consumers threads are busy: we need to create one more
- some or all consumers threads are idle: no need create new one.

But there is no way to distinguish two last cases.

That's why I consider that (unfinished() <= num_threads) gives clear key for 
decision.

--

___
Python tracker 

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



Re: Python application launcher (for Python code)

2017-02-21 Thread Chris Angelico
On Wed, Feb 22, 2017 at 2:16 AM, Deborah Swanson
 wrote:
> Really?  We used software called Powershell a couple decades ago in the
> 90s, as an improvement on the DOS box. I didn't like it much and I was
> going through software like candy those days. Maybe that version
> disappeared. It may have re-emerged in an improved form a decade later.

With a name like that, there've almost certainly been multiple things
using it. The PowerShell that comes with modern Windowses came out in
2006, and IMO it's less of a shell language and more of a scripting
language. And if I want to use a scripting language for program flow
control, I'll use Python or Pike, fankyouwerrymuch.

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


RE: Python application launcher (for Python code)

2017-02-21 Thread Deborah Swanson
Dennis Lee Bieber wrote, on February 21, 2017 4:19 AM
> 
> On Mon, 20 Feb 2017 18:16:14 -0800, "Deborah Swanson" 
>  declaimed the following:
> 
> 
> >Yes, I've used Powershell, a couple decades ago, but it would be a
> 
>   Uhm... PowerShell 1.0 only came out ONE decade ago...
> 
>   Be afraid -- PowerShell has supposedly gone open-source 
> with versions for OS-X and Ubuntu!
> -- 
>   Wulfraed Dennis Lee Bieber AF6VN
> wlfr...@ix.netcom.comHTTP://wlfraed.home.netcom.com/

Really?  We used software called Powershell a couple decades ago in the
90s, as an improvement on the DOS box. I didn't like it much and I was
going through software like candy those days. Maybe that version
disappeared. It may have re-emerged in an improved form a decade later. 

My health collapsed in 2003, and I was not using any unfamiliar software
until a couple years ago, so I guess I've never used something called
Powershell that appeared a decade ago.

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


Re: str.format fails with JSON?

2017-02-21 Thread Chris Angelico
On Wed, Feb 22, 2017 at 2:19 AM, Carlo Pires  wrote:
> What I wanted was an output without errors, like:
>
> From {"value": 1}, value=1
>
> I think Python should ignore value not matching integers or identifiers. This 
> will make str.format more robust and usable. It cannot be used if the text 
> has JSON as string, for instance.

No, Python should most definitely not just ignore them. If the
behaviour is changed, it should be to catch the error in a more
friendly way, stating that a format directive was not a valid
identifier. To get the behaviour you want, double the braces that you
want to be literal, as I did in my example in my first reply.

Format strings are a mini-language. Like with any other, you need to
speak the grammar of that language. To include quotes and apostrophes
in a string literal, you need to either escape them with backslashes,
or use something else to surround the string; and since a backslash
can escape a quote, a backslash must itself be escaped. That's the
nature of the mini-language of string literals. When you layer in the
format codes, other characters gain meaning. If, instead, you layer in
printf formatting, braces won't be significant, but percent signs will
be. Etcetera. You can't escape this. (Pun intended.)

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


Re: str.format fails with JSON?

2017-02-21 Thread Carlo Pires
Em terça-feira, 21 de fevereiro de 2017 11:39:13 UTC-3, Chris Angelico  
escreveu:
> On Wed, Feb 22, 2017 at 1:23 AM,  Carlo Pires wrote:
> > Hi,
> >
> > When I run this piece of code:
> >
> > 'From {"value": 1}, value={value}'.format(value=1)
> 
> Firstly, this code is in error; I suspect you wanted a couple of
> literal braces, so what you want is:

What I wanted was an output without errors, like:

From {"value": 1}, value=1

I think Python should ignore value not matching integers or identifiers. This 
will make str.format more robust and usable. It cannot be used if the text has 
JSON as string, for instance.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: str.format fails with JSON?

2017-02-21 Thread Jussi Piitulainen
carlopi...@gmail.com writes:

> Hi,
>
> When I run this piece of code:
>
> 'From {"value": 1}, value={value}'.format(value=1)
>
> Python complains about the missing "value" parameter (2.7.12 and
> 3.6.x):

Perhaps you know this, but just to be sure, and for the benefit of any
reader who doesn't: double the braces in the format string when you
don't mean them to be interpreted as a parameter.

> But according to the format string syntax
> (https://docs.python.org/2/library/string.html):

[- -]

> So according to the specification, {value} should be recognized as a
> valid format string identifier and {"value"} should be ignored.
>
> Python seems to not follow the specification in the documentation.
> Anything inside the keys is accepted as identifier.

I think raising an error is more helpful than ignoring it. I think.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29607] Broken stack_effect for CALL_FUNCTION_EX

2017-02-21 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +183

___
Python tracker 

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



[issue29598] Write unit tests for pdb module

2017-02-21 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +182

___
Python tracker 

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



[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-21 Thread Christian Heimes

Christian Heimes added the comment:

How about https://linux.die.net/man/3/tmpfile instead?

The tmpfile() function opens a unique temporary file in binary read/write (w+b) 
mode. The file will be automatically deleted when it is closed or the program 
terminates.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue29509] redundant interning in PyObject_GetAttrString

2017-02-21 Thread INADA Naoki

Changes by INADA Naoki :


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



[issue29509] redundant interning in PyObject_GetAttrString

2017-02-21 Thread INADA Naoki

INADA Naoki added the comment:


New changeset 3e8d6cb1892377394e4b11819c33fbac728ea9e0 by GitHub in branch 
'master':
bpo-29509: skip redundant intern (GH-197)
https://github.com/python/cpython/commit/3e8d6cb1892377394e4b11819c33fbac728ea9e0


--

___
Python tracker 

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



Re: str.format fails with JSON?

2017-02-21 Thread Peter Otten
carlopi...@gmail.com wrote:

> Hi,
> 
> When I run this piece of code:
> 
> 'From {"value": 1}, value={value}'.format(value=1)
> 
> Python complains about the missing "value" parameter (2.7.12 and 3.6.x):
> 
> Traceback (most recent call last):
>   File "test_format.py", line 1, in 
> 'From {"value": 1}, value={value}'.format(value=1)
> KeyError: '"value"
> 
> But according to the format string syntax
> (https://docs.python.org/2/library/string.html):
> 
> replacement_field ::=  "{" [field_name] ["!" conversion] [":" format_spec]
> "}"
> field_name::=  arg_name ("." attribute_name | "[" element_index
> "]")*
> arg_name  ::=  [identifier | integer]
> attribute_name::=  identifier
> element_index ::=  integer | index_string
> index_string  ::=   +
> conversion::=  "r" | "s"
> format_spec   ::=  
> 
> The replacement_field, which in this case, is composed by an identifier,
> shouldn't have quotation marks. Here is the lexical definition for an
> identifier (according to the documentation):
> 
> identifier ::=  (letter|"_") (letter | digit | "_")*
> letter ::=  lowercase | uppercase
> lowercase  ::=  "a"..."z"
> uppercase  ::=  "A"..."Z"
> digit  ::=  "0"..."9"
> 
> So according to the specification, {value} should be recognized as a valid
> format string identifier and {"value"} should be ignored.

I'd rather say '{"value"}' unspecified as "value" isn't a proper field_name 
and literal {} have to be escaped.
> 
> Python seems to not follow the specification in the documentation.
> Anything inside the keys is accepted as identifier.

It does not enforce that you follow the specification, but if you do and 
properly escape the braces by doubling them you get the correct result

>>> 'From {{"value": 1}}, value={value}'.format(value=1)
'From {"value": 1}, value=1'


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


  1   2   >