[issue29537] Alternative fix for BUILD_MAP_UNPACK_WITH_CALL opcode in 3.5

2017-02-23 Thread Nick Coghlan

Nick Coghlan added the comment:

For easier cross-referencing, note that http://bugs.python.org/issue29514 is 
the issue proposing a test case that ensures future maintainers are aware of 
the practical problems created by bumping the bytecode magic number in a 
maintenance release.

--

___
Python tracker 

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



[issue29537] Alternative fix for BUILD_MAP_UNPACK_WITH_CALL opcode in 3.5

2017-02-23 Thread Nick Coghlan

Changes by Nick Coghlan :


--
type:  -> behavior

___
Python tracker 

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



[issue29537] Alternative fix for BUILD_MAP_UNPACK_WITH_CALL opcode in 3.5

2017-02-23 Thread Nick Coghlan

Changes by Nick Coghlan :


--
assignee:  -> ncoghlan

___
Python tracker 

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



[issue26184] Add versionchanged note for error when create_module() is not defined by loaders

2017-02-23 Thread Nick Coghlan

Nick Coghlan added the comment:

That should actually be a versionchanged note now - converting this to an easy 
documentation issue to cover that change.

--
assignee:  -> docs@python
components: +Documentation -Interpreter Core
keywords: +easy
nosy: +docs@python
stage: test needed -> needs patch
title: raise an error when create_module() is not defined by exec_module() is 
for loaders -> Add versionchanged note for error when create_module() is not 
defined by loaders
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



[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2017-02-23 Thread Nick Coghlan

Nick Coghlan added the comment:

John, your problem sounds different - if you're opening the files in binary 
mode, then you'll be getting a default buffer that's probably 4k or 8k in size, 
so if you're writing less content than that, the subprocess won't see anything 
until you explicitly flush() the buffer to disk (and even if you're writing 
more than that, the subprocess may see a truncated version without an explicit 
flush()). 

By contrast, the issue here relates to the fact that on Windows it's currently 
necessary to do the following in order to get multiple handles to a 
NamedTemporaryFile:

1. Open the file in the current process
2. Write content to the file
3*. Close the file in the current process
4. Open the file by name in another process (or the current process)
5. Read content from the file
6. Close the second file handle
7*. Delete the file

*On POSIX systems, you can just skip step 3 and leave closing the original file 
handle until step 7, and that's the design that the current NamedTemporaryFile 
is built around. Most of the discussion above is about figuring out how to make 
that same approach "just work" on Windows (perhaps with some additional flags 
used in step 4), rather than  providing a third option beyond the current 
delete-on-close and delete-manually.

--

___
Python tracker 

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



[issue27788] platform module's version number doesn't match its docstring

2017-02-23 Thread Berker Peksag

Berker Peksag added the comment:

Perhaps it's now time to drop that __version__ attribute in 3.7? We've removed 
the __version__ attribute from the email module in issue 22508.

--
nosy: +berker.peksag
stage:  -> patch review

___
Python tracker 

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



[issue29634] Reduce deque repeat execution when maxlen exist and size is not 1

2017-02-23 Thread Raymond Hettinger

Changes by Raymond Hettinger :


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



[issue26184] raise an error when create_module() is not defined by exec_module() is for loaders

2017-02-23 Thread Matthias Bussonnier

Matthias Bussonnier added the comment:

should be closed by #28026, it now raises an ImportError. I think this can be 
closed. Unless one want to change the text in Starting in Python 3.6 it will be 
an error

> Starting in Python 3.6 it will be an error

To use the past tense.

--
nosy: +mbussonn

___
Python tracker 

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



[issue28556] typing.py upgrades

2017-02-23 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +242

___
Python tracker 

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



[issue28556] typing.py upgrades

2017-02-23 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +241

___
Python tracker 

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



[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2017-02-23 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue29634] Reduce deque repeat execution when maxlen exist and size is not 1

2017-02-23 Thread Louie Lu

Louie Lu added the comment:

Raymond: comment has changed, pushed on to GitHub.

--

___
Python tracker 

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



[issue29632] argparse values for action in add_argument() should be flags instead of (or in addition to) strings

2017-02-23 Thread paul j3

paul j3 added the comment:

Those strings are defined in a 'parser.registry' dictionary, with expressions 
like

self.register('action', 'store', _StoreAction)

(Users can also register their own custom classes. The registry can also be 
used for the 'type' attribute.)

So you can already do:

parser.add_argument('--foo', action=argparse._StoreAction)

So I don't think we need another mapping like

argparse.STORE_ACTION = argparse._StoreAction

I think these Action subclasses are not part of the API because users should 
never instantiate one directly.  It should always be done via the 
'add_argument' method.

But on occasion it is handy to grab one of the Action objects when it is 
returned by add_argument, and display or even modify one of its attributes.  
Some users are reluctant to do so because that's not documented.

Some of the `nargs` values have constants names in addition to the string 
values.  

argparse.REMAINDER = '...'
argparse.OPTIONAL = '?'
so on for '+', '*', and even '+...'.  Users almost always use the strings, 
while the code always uses the constant.

But because `argparse._StoreAction` is a class, with its own defined methods, 
there's never a need to test for its 'value' or identity.  So the code does not 
need a `argparse.STORE_ACTION flag.

So for end users, and for internal code use, the current use of subclasses and 
the registry is works, and doesn't need to be changed just to look more like 
other modules.

--

___
Python tracker 

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



[issue29639] test suite intentionally avoids referring to localhost, destroying abstraction away from IPv6 vs IPv4

2017-02-23 Thread Gregory P. Smith

New submission from Gregory P. Smith:

I am working on fixing our test suite to run on IPv6 only hosts (which are 
becoming a reality).  Many failures today occur because of hard coded 127.0.0.1 
values.

This is wrong.  We should refer to "localhost"

The "solution" to https://bugs.python.org/issue18792 moved us backwards towards 
hard coding IP version type specific addresses claiming that windows cannot 
handle resolving localhost reliably.

On any windows system where that is the case we should declare the system 
broken and simply not run any networking related tests.

--
components: Tests
messages: 288498
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: test suite intentionally avoids referring to localhost, destroying 
abstraction away from IPv6 vs IPv4
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



[issue18792] test_ftplib timeouts

2017-02-23 Thread Gregory P. Smith

Gregory P. Smith added the comment:

https://bugs.python.org/issue29639 opened to track undoing this when 
appropriate.

--

___
Python tracker 

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



[issue18792] test_ftplib timeouts

2017-02-23 Thread Gregory P. Smith

Gregory P. Smith added the comment:

FYI - hardcoding these addresses is now causing me problems as I try to get our 
test suite passing on IPv6 only hosts.  "localhost" is correct.  

IMNSHO if for some reason a system cannot resolve "localhost" into a correct 
address, it should be banned from running any form of networking related test. 
:/

I should not have to write messy conditional code to try and determine which 
type of socket I will likely need to bind to to determine which format of IP 
address string I need to supply as the localhost bind address.  That is 
backwards!

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue29632] argparse values for action in add_argument() should be flags instead of (or in addition to) strings

2017-02-23 Thread paul j3

Changes by paul j3 :


--
nosy: +paul.j3

___
Python tracker 

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



[issue29622] ast module doesn't support optional fields of Parser/Python.asdl

2017-02-23 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


--
pull_requests: +240

___
Python tracker 

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



[issue29463] Add `docstring` field to AST nodes

2017-02-23 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


--
pull_requests: +238

___
Python tracker 

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



[issue29637] ast.get_docstring(): AttributeError: 'NoneType' object has no attribute 'expandtabs'

2017-02-23 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


--
pull_requests: +239

___
Python tracker 

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



[issue29637] ast.get_docstring(): AttributeError: 'NoneType' object has no attribute 'expandtabs'

2017-02-23 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


--
nosy: +mbussonn

___
Python tracker 

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



[issue29634] Reduce deque repeat execution when maxlen exist and size is not 1

2017-02-23 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The code looks fine.  Please change the comment to something like:

/* Reduce the number of repetitions when maxlen would be exceeded */

--

___
Python tracker 

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



[issue29638] Spurious failures in test_collections in releak hunting mode after typing is imported

2017-02-23 Thread Ivan Levkivskyi

New submission from Ivan Levkivskyi:

This command:

./python -c 'import runpy, typing; runpy.run_module("test")' -R 5:5 
test_collections

Sometimes gives spurious failures like this:

test_collections leaked [0, 0, 3, -3, 3] memory blocks, sum=3

I think this is because ABC caches of typing.ChainMap, typing.Counter, and 
typing.DefaultDict are not cleared by refleak.py/dash_R_cleanup (presumably 
because inspect.isabstract returns False on those)

Adding a manual clean-up of these cashes to cleanup_cashes() fixes the "leak".

--
assignee: levkivskyi
components: Tests
messages: 288495
nosy: gvanrossum, levkivskyi
priority: normal
severity: normal
status: open
title: Spurious failures in test_collections in releak hunting mode after 
typing is imported
type: resource usage

___
Python tracker 

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



[issue28556] typing.py upgrades

2017-02-23 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi :


--
pull_requests: +237

___
Python tracker 

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



[issue29549] Improve docstring for str.index

2017-02-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Write docstrings in following style:

"index($self, sub, start=0, end=sys.maxsize, /)\n"
"--\n"
"\n"
"\n"
"\n"
""

Extract the summary line. Don't use the metavariable "S" since it no longer 
defined in the signature.

--

___
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-23 Thread Vinay Sajip

Vinay Sajip added the comment:

> Perhaps it should instead use two specific flags, TYPEFLAG_HASBITFIELD and 
> TYPEFLAG_HASUNION

This seems better at first sight. It's not making any suitability decisions 
(apart from doing the unrolling), and the meaning of these flags will be less 
volatile than TYPEFLAG_NONARGTYPE because that assessment depends on current 
limitations, and those limitations might change over time.

I'm going into a period of two weeks where I may not have much time to work on 
this due to other time commitments, so if you want to press on with it, go 
right ahead :-)

--

___
Python tracker 

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



[issue29191] liblzma is missing from pcbuild.sln

2017-02-23 Thread Steve Dower

Changes by Steve Dower :


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



[issue29624] Python 3.5.3 x86 web installer cannot install launcher

2017-02-23 Thread Steve Dower

Changes by Steve Dower :


--
pull_requests: +235

___
Python tracker 

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



[issue29624] Python 3.5.3 x86 web installer cannot install launcher

2017-02-23 Thread Steve Dower

Changes by Steve Dower :


--
pull_requests: +236

___
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-23 Thread Peter McCormick

Peter McCormick added the comment:

Hi Ɓukasz, thank you for the feedback!

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

What about `PyProbe`? Given the multitude of tools and techniques in this 
space, wouldn't it be worthwhile to clarify things before adding this? I think 
conflating `dtrace` and `lttng` would only lead to more confusion for users as 
they really are distinct technologies.

Apart from the `--with{out)-dtrace` configure options, are these terms exposed 
to users anywhere else? I agree that those options shouldn't be changed now.

--

___
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-23 Thread Eryk Sun

Eryk Sun added the comment:

Perhaps it should instead use two specific flags, TYPEFLAG_HASBITFIELD and 
TYPEFLAG_HASUNION, which are propagated unconditionally from the base class and 
fields. As a base case, a union itself is flagged TYPEFLAG_HASUNION. Arrays are 
unrolled on X86_64 only if neither flag is present and the size is 16 bytes or 
less.

If ConvParam or converters_from_argtypes see either flag on X86_64 and the size 
is 16 bytes or less, then they raise an exception. As before, this rejects some 
call signatures that would actually succeed. We're not accounting for the case 
in which the limited number of registers forces an argument to be passed on the 
stack even though it's small enough to be passed in registers.

--

___
Python tracker 

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



[issue29514] Add a test case that prevents magic number changes in minor releases

2017-02-23 Thread Carson Lam

Changes by Carson Lam :


--
nosy: +Carson Lam

___
Python tracker 

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



[issue27593] Deprecate sys._mercurial and create sys._git

2017-02-23 Thread Steve Dower

Steve Dower added the comment:

It looks to me like we want:

branch=`git name-rev --name-only HEAD`
revision=`git rev-parse HEAD`
tag=`git name-rev --tags --name-only HEAD`

Unless we're planning on leaving out the tag?

My PR 262 makes the Windows build changes in master, but doesn't change 
getbuildinfo.c.

--

___
Python tracker 

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



[issue27593] Deprecate sys._mercurial and create sys._git

2017-02-23 Thread Steve Dower

Changes by Steve Dower :


--
pull_requests: +234

___
Python tracker 

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



[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2017-02-23 Thread Jakub Wilk

Changes by Jakub Wilk :


--
nosy: +jwilk

___
Python tracker 

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



[issue29637] ast.get_docstring(): AttributeError: 'NoneType' object has no attribute 'expandtabs'

2017-02-23 Thread Jakub Wilk

New submission from Jakub Wilk:

With git master (4c78c527d215c37472145152cb0e95f196cdddc9) I get this:

>>> import ast
>>> ast.get_docstring(ast.parse(''))
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/jwilk/opt/lib/python3.7/ast.py", line 203, in get_docstring
text = inspect.cleandoc(text)
  File "/home/jwilk/opt/lib/python3.7/inspect.py", line 590, in cleandoc
lines = doc.expandtabs().split('\n')
AttributeError: 'NoneType' object has no attribute 'expandtabs'

--
messages: 288488
nosy: inada.naoki, jwilk
priority: normal
severity: normal
status: open
title: ast.get_docstring(): AttributeError: 'NoneType' object has no attribute 
'expandtabs'
type: behavior
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



[issue28909] Adding LTTng-UST tracing support

2017-02-23 Thread Francis Deslauriers

Francis Deslauriers added the comment:

I am finally having the time to work in this.

> 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").
We can certainly drop the "-ust" and have the name in lowercase.

> 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?
It's possible to have both SystemTap and LTTng in the same binary. LTTng-UST 
has a configure option `--with-sdt` to include a SystemTap SDT probe alongside 
each LTTng-UST tracepoint. I don't have a  specific usecase in mind but I can 
picture a setup where a binary is instrumented with both frameworks and the 
users either decide to use the low overhead tracing of LTTng or the versatile 
runtime aggregation of SystemTap depending on the problem they are trying to 
diagnose. So I think keeping both configure options makes sense.

> Do you get unused code warnings without your patch applied? I don't.
I am getting those errors too on Linux with GCC. I will make sure to fix them 
in the next round.

I am currently working on the tests and documentation and I hope to submit 
patches for review early next week.

Thank you,
Francis

--

___
Python tracker 

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



[issue16355] inspect.getcomments() does not work in the interactive shell

2017-02-23 Thread Marco Buttu

Marco Buttu added the comment:

Hello Vajrasky, the doc patch LGTM. Looking at the David's comment in Rietveld, 
it seems that he does not want the test patch to be applyed. Can you please 
make a pull request? Thank you very much

--

___
Python tracker 

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



[issue29414] Change 'the for statement is such an iterator' in Tutorial

2017-02-23 Thread Marco Buttu

Marco Buttu added the comment:

Hello Jim, do you have the time to make a pull request? Let me know, otherwise 
I will do it

--

___
Python tracker 

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



[issue29191] liblzma is missing from pcbuild.sln

2017-02-23 Thread Mo Jia

Mo Jia added the comment:

I think let user add the liblzma project by hand is not good enough. While the 
build.bat don't have this problem. So they should work similar.

--
nosy: +Mo.Jia
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



[issue29455] Mention coverage.py in trace module documentation

2017-02-23 Thread Marco Buttu

Changes by Marco Buttu :


--
pull_requests: +233

___
Python tracker 

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



[issue29635] os.chdir() acts like `cd -P` by default, it should offer an option to not follow symlinks

2017-02-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> closed

___
Python tracker 

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



[issue29635] os.chdir() acts like `cd -P` by default, it should offer an option to not follow symlinks

2017-02-23 Thread Fabien Dubosson

Fabien Dubosson added the comment:

> I'm going to close this issue. 

I was doing to do so, here was my message:



> See shells sources. According to the manpage `pwd -L` just uses PWD from 
> environment.

I looked directly at `pwd` sources, and indeed it is using $PWD [1].

[1] 
http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/pwd.c?id=509152bdd47a278dc00ddaf3200ac65044b836b1#n305

So it looks like `cd -L` is just some bash internal dealing with $PWD. Probably 
not something useful enough to be in the standard library, closing it then.

Sorry for the incovenience

--

___
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-23 Thread Vinay Sajip

Vinay Sajip added the comment:

> It occurs to me that in the 1st pass, it also needs to propagate the 
> non-argument flag from any field that has it set.

So does that mean disallowing a structure which contains a union? What about if 
the final structure is large enough to require passing in memory rather than 
registers, so that libffi doesn't need to do any clever marshalling, even if 
some part of the structure wouldn't by itself be able to be passed as an 
argument in a call? Won't that end up being too restrictive?

--

___
Python tracker 

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



[issue29635] os.chdir() acts like `cd -P` by default, it should offer an option to not follow symlinks

2017-02-23 Thread R. David Murray

R. David Murray added the comment:

Ah, that should all be implementable from your python shell, then, no need for 
support in the os module.

For reference, when I said 'cd man page', this is what I was referring to:

http://www.unix.com/man-page/posix/1posix/cd/

I'm going to close this issue.  If you find you do need access to some system 
interface the os module doesn't currently provide, you can open a specific 
issue for that.

--
resolution:  -> rejected
stage:  -> resolved

___
Python tracker 

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



[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2017-02-23 Thread Daniel Himmelstein

Changes by Daniel Himmelstein :


--
pull_requests: +232

___
Python tracker 

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



[issue29635] os.chdir() acts like `cd -P` by default, it should offer an option to not follow symlinks

2017-02-23 Thread Fabien Dubosson

Fabien Dubosson added the comment:

> Most os functions are thin wrappers around system calls. There is no system 
> call that works as 'cd' without '-P'.

I would like to believe in this, but then if `cd` is some bash internal, how 
does `/usr/bin/pwd -L` find it back?

> Since yours is the itch, I'm afraid you are going to have to be the one to 
> figure out how this could be implemented :)

Once I'll have figured out how all this is working, maybe. Not sure it would me 
in my competencies though.

--

___
Python tracker 

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



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

2017-02-23 Thread Petr MOTEJLEK

Changes by Petr MOTEJLEK :


--
pull_requests: +231

___
Python tracker 

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



[issue29636] Specifying indent in the json.tool command

2017-02-23 Thread Daniel Himmelstein

New submission from Daniel Himmelstein:

The utility of `python -m json.tool` would increase if users could specify the 
indent level.

Example use case: newlines in a JSON document are important for readability and 
the ability to open in a text editor. However, if the file is large, you can 
save space by decreasing the indent level.

I added an --indent argument to json.tool in 
https://github.com/python/cpython/pull/201. However, design discussion is 
required since indent can take an int, string, or None. In addition, a indent 
string is a tab, which is difficult to pass via a command line argument.

Currently, I added the following function to convert the indent option to the 
indent parameter of json.dump:

```
def parse_indent(indent):
"""Parse the argparse indent argument."""
if indent == 'None':
return None
if indent == r'\t':
return '\t'
try:
return int(indent)
except ValueError:
return indent
```

@inada.naoki mentioned the special casing is undesirable. I agree, but can't 
think of an alternative. Advice appreciated.

--
components: IO
messages: 288479
nosy: dhimmel, inada.naoki
priority: normal
pull_requests: 230
severity: normal
status: open
title: Specifying indent in the json.tool command
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



[issue29635] os.chdir() acts like `cd -P` by default, it should offer an option to not follow symlinks

2017-02-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Just wondering, do you know what is the function called by `cd`/`cd -L` then? 
> It doesn't seems to be a bash internal tweak because `/usr/bin/pwd -L` is 
> able to get the symlink path, and this binary is not part of bash.

See shells sources. According to the manpage `pwd -L` just uses PWD from 
environment.

--

___
Python tracker 

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



[issue29624] Python 3.5.3 x86 web installer cannot install launcher

2017-02-23 Thread Steve Dower

Steve Dower added the comment:

I have built an updated web installer which should allow us to replace just the 
one file on the server to fix the issue. The only downside is that it is not 
compatible with existing installs of 3.5.3 (that is, you can't run the 
executable to Modify/Repair/Remove an existing install, but unless you've 
corrupted your machine you can do those through Programs and Features).

If anyone would like to test it, I've attached the file here. I've done one 
test on my own machine (separate from the build machine) including installing 
the launcher and all optional components and it was fine, but some more 
validation before I replace the existing executable would be nice.

(Added RM Larry as FYI. This doesn't affect anything else.)

AFAICT so far, it appears to have been a build glitch where the launcher MSI 
was rebuilt in between 32-bit and 64-bit builds (the weird part here is that 
the rebuild was correct and the initial build was wrong, which is backwards 
from what I'd expect...). The upload included the rebuilt MSI but the 
bootstrapper was expecting the initial build.

I'm still trying to track down why that happened, but in the meantime I've 
added a test (PR 258) to my upload script that will detect problems like this 
before we announce the release.

--
nosy: +larry
Added file: http://bugs.python.org/file46665/python-3.5.3-webinstall.exe

___
Python tracker 

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



[issue29635] os.chdir() acts like `cd -P` by default, it should offer an option to not follow symlinks

2017-02-23 Thread R. David Murray

R. David Murray added the comment:

Since yours is the itch, I'm afraid you are going to have to be the one to 
figure out how this could be implemented :)

--

___
Python tracker 

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



[issue29635] os.chdir() acts like `cd -P` by default, it should offer an option to not follow symlinks

2017-02-23 Thread Fabien Dubosson

Fabien Dubosson added the comment:

Thanks for the additional information!

> The 'cd' man page says that 'cd -P' should "perform actions equivalent to the 
> chdir() function".

Just wondering, do you know what is the function called by `cd`/`cd -L` then? 
It doesn't seems to be a bash internal tweak because `/usr/bin/pwd -L` is able 
to get the symlink path, and this binary is not part of bash.

> You'll have to make a case for it being useful enough to add.

The use case is for shells written in Python, like for instance `xonsh` [1,2]. 
Being powered by Python, the only way to change directory is by using 
`os.chdir()`. It is then not possible to mimic the bash `cd` function without 
using workarounds, like for instance storing the symlink path in a variable, 
and even this doesn't allow to use `/usr/bin/pwd -L` in scripts because it 
would always returns the physical location.

Having such described functions (yet to be named) would permit python shells to 
offer users differentiated `cd` and `cd -P` commands, as well as having `pwd 
-L` in scripts behaving the same than in traditional shells.

[1] http://xon.sh/
[2] https://github.com/xonsh/xonsh

--

___
Python tracker 

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



[issue29635] os.chdir() acts like `cd -P` by default, it should offer an option to not follow symlinks

2017-02-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

'cd' is not an external command and has no manpage. It is a shell builtin 
command.

Most os functions are thin wrappers around system calls. There is no system 
call that works as 'cd' without '-P'.

If you implement a shell in Python, you perhaps need an implementation of the 
'cd' command. But I have doubts that this is needed in the stdlib.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2017-02-23 Thread John Florian

John Florian added the comment:

I just stumbled onto this though I'm not writing for Windows.  Instead, I'm on 
Fedora 25 with Python 3.5.2 and I went nearly crazy tracing down what seemed to 
be inconsistent behavior.  My use case has Python using 
NamedTemporaryFile(delete=True) in a CM to produce content fed into a 
subprocess.  The code had been reliably working and then it just didn't.  The 
only thing changing was the content being written, an rendered Jinja2 template. 
 I believe the fate is determined by the content length.  In debugging another 
problem, I'd been trivializing the template and once it got down to about 3k 
(rendered) the subprocess began seeing a file whose length was 0 bytes.  Make 
the template bigger and all works again.  Calling close() resolves the issue, 
but of course requires delete=False which removed much of the value of this 
object.  Preliminary testing looks like flush() may also resolve the issue.

Have I just been naive and getting lucky all along because this is expected or 
is there something else fishy here worth investigation?

--
nosy: +John Florian

___
Python tracker 

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



[issue29625] colorsys.rgb_to_hsv always returns saturation as 0 (python2.7 only)

2017-02-23 Thread Mark Dickinson

Mark Dickinson added the comment:

No problem. I did spend some time wondering whether `rgb_to_hsv` still gives 
the correct results if any of the inputs happens to be an integer (though still 
in the range [0, 1]). It looks as though it does, though.

--

___
Python tracker 

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



[issue10379] locale.format() input regression

2017-02-23 Thread Garvit Khatri

Changes by Garvit Khatri :


--
pull_requests: +229

___
Python tracker 

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



[issue29624] Python 3.5.3 x86 web installer cannot install launcher

2017-02-23 Thread Steve Dower

Changes by Steve Dower :


--
pull_requests: +228

___
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-23 Thread Eryk Sun

Eryk Sun added the comment:

> I'm not sure using this flag impacts on consistency with CFFI 

I meant consistency with respect to supported argument types. If someone 
contributed a workaround to CFFI, then I would rather port it, but it looks 
like they're also waiting for this to be addressed upstream. 

It occurs to me that in the 1st pass, it also needs to propagate the 
non-argument flag from any field that has it set. This should be done for all 
platforms, not just X86_64.

--

___
Python tracker 

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



[issue29635] os.chdir() acts like `cd -P` by default, it should offer an option to not follow symlinks

2017-02-23 Thread R. David Murray

Changes by R. David Murray :


--
type: behavior -> enhancement

___
Python tracker 

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



[issue29549] Improve docstring for str.index

2017-02-23 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks for the PR, Lisa. 

Serhiy, Raymond, could you both review this? Thanks.
I can do the merge and backport once it gets both of your approval :)

Also,should this be applied to 3.5 too?

--

___
Python tracker 

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



[issue29635] os.chdir() acts like `cd -P` by default, it should offer an option to not follow symlinks

2017-02-23 Thread R. David Murray

R. David Murray added the comment:

The function is chdir, not cd.  The 'cd' man page says that 'cd -P' should 
"perform actions equivalent to the chdir() function".

So, you are asking for a different function, which should *not* be named 
'os.chdir'.  You'll have to make a case for it being useful enough to add.

The same applies to getcwd, which is also a wrapper for the posix function, not 
an emulation of the shell's pwd.

--
components: +Library (Lib) -Interpreter Core
nosy: +r.david.murray
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



[issue29635] os.chdir() acts like `cd -P` by default, it should offer an option to not follow symlinks

2017-02-23 Thread Fabien Dubosson

Fabien Dubosson added the comment:

The previous example (sorry, first time using this platform, I'm a little bit 
messy here), shows that `os.chdir` resolves symlinks by default, as opposed to 
what `cd` does in bash. This means it is not possible to change the directory 
to a symlink folder.

A solution would be a keyword argument in `os.chdir` and `os.getcwd` that would 
mimic the `-P` and `-L` arguments of `cd` and `pwd`, like:

os.chdir(logical=False)  # or follow_symlinks=True maybe
os.getcwd(logical=False)

I don't know what should be the default values for these args, but at least 
having an option to change the behavior would be nice.

--

___
Python tracker 

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



[issue29635] os.chdir() acts like `cd -P` by default, it should offer an option to not follow symlinks

2017-02-23 Thread Fabien Dubosson

New submission from Fabien Dubosson:

When using bash, the `cd` function does not follow symlinks by default, but `cd 
-P` does. The `os.chdir` function behaves like `cd -P` preventing to be able to 
change directory to a symlink folder.

Initial setup (make a `/tmp/to/dst` symlink pointing to `/tmp/from/src`):

cd /tmp
mkdir from from/src to
ln -s ../from/src to/dst

Here is an example, when using python's `os.chdir` function:

[fabien@asus ~]$ python
>>> import os
>>> os.chdir('/tmp/to/dst')
>>> os.system('/usr/bin/pwd')
/tmp/from/src
0
>>> os.system('/usr/bin/pwd -P')
/tmp/from/src
0
>>> os.system('/usr/bin/pwd -L')
/tmp/from/src
0
>>> os.getcwd()
'/tmp/from/src'
>>> 

And here is an example when the folder is first changed with bash:


[fabien@asus ~]$ cd /tmp/to/dst/
[fabien@asus dst]$ python
>>> import os
>>> os.system('/usr/bin/pwd')
/tmp/from/src
0
>>> os.system('/usr/bin/pwd -P')
/tmp/from/src
0
>>> os.system('/usr/bin/pwd -L')
/tmp/to/dst
0
>>> os.getcwd()
'/tmp/from/src'
>>>

--

___
Python tracker 

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



[issue29635] os.chdir() acts like `cd -P` by default, it should offer an option to not follow symlinks

2017-02-23 Thread Fabien Dubosson

Changes by Fabien Dubosson :


--
components: Interpreter Core
nosy: StreakyCobra
priority: normal
severity: normal
status: open
title: os.chdir() acts like `cd -P` by default, it should offer an option to 
not follow symlinks
type: behavior
versions: Python 2.7, Python 3.3, 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



[issue24024] str.__doc__ needs an update

2017-02-23 Thread Garvit

Changes by Garvit :


--
pull_requests: +227

___
Python tracker 

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



[issue29622] ast module doesn't support optional fields of Parser/Python.asdl

2017-02-23 Thread INADA Naoki

Changes by INADA Naoki :


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



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

2017-02-23 Thread Matthias Bussonnier

Matthias Bussonnier added the comment:

Thanks Nick for finding this !

--

___
Python tracker 

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



[issue29549] Improve docstring for str.index

2017-02-23 Thread Lisa Roach

Lisa Roach added the comment:

I'll just go ahead and make my PR, let me know what else needs to be done.

Serhiy, if you could point me in the direction of how to write the docstring so 
that it is in the Argument Clinic style I would be happy to take a look.

--

___
Python tracker 

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



[issue29634] Reduce deque repeat execution when maxlen exist and size is not 1

2017-02-23 Thread Louie Lu

Louie Lu added the comment:

Serhiy: yes, your advice is better than checking inside the loop.

I have updated this to the commit, thanks!

--

___
Python tracker 

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



[issue29549] Improve docstring for str.index

2017-02-23 Thread Lisa Roach

Changes by Lisa Roach :


--
pull_requests: +225

___
Python tracker 

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



[issue29634] Reduce deque repeat execution when maxlen exist and size is not 1

2017-02-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Wouldn't be better to update the number of repeats before the loop rather than 
checking at every iteration?

if (deque->maxlen >= 0 && n * size > deque->maxlen)
n = (deque->maxlen + size - 1) / size;

--
assignee:  -> rhettinger
nosy: +rhettinger, serhiy.storchaka

___
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-23 Thread Vinay Sajip

Vinay Sajip added the comment:

> We need more feedback on this suggested flag, especially to stay consistent 
> with CFFI if possible.

Undoubtedly, more feedback would be very helpful. I'm not sure using this flag 
impacts on consistency with CFFI particularly, since it's an internal 
implementation detail. Its main purpose would be for ctypes to raise exceptions 
rather than leading to crashes or undefined behaviour, as we have at the moment.

> Do you know whether CFFI supports passing unions and structs with bitfields 
> in its ABI mode for 64-bit Unix?

I don't believe so, but I'm relatively new to this area. I'm not sure if things 
have changed recently, but an analogous CFFI issue was closed as WONTFIX in 
2015, citing lack of support in libffi:

https://bitbucket.org/cffi/cffi/issues/150/structs-with-bit-fields-as-arguments

Also, the latest CFFI documentation, near the bottom of this section:

https://cffi.readthedocs.io/en/latest/using.html#function-calls

says:

"The limitations are that you cannot pass directly as argument or return type:

* a union (but a pointer to a union is fine);
* a struct which uses bitfields (but a pointer to such a struct is fine);"

The documentation applies these limitations regardless of any specific ABI 
(presumably to provide consistency).

So, I would guess that, as with ctypes, lack of libffi support is the main 
obstacle. I suppose one would have to seriously consider contributing there to 
make much headway here. In this still-open issue from 2013:

https://github.com/libffi/libffi/issues/33

Anthony Green of libffi said he'd welcome a patch, in response to a question by 
Eli Bendersky. Of course, it may be hard for individual contributors to support 
this for the range of architectures that libffi covers.

--

___
Python tracker 

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



[issue29634] Reduce deque repeat execution when maxlen exist and size is not 1

2017-02-23 Thread Louie Lu

Changes by Louie Lu :


--
pull_requests: +223

___
Python tracker 

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



[issue29634] Reduce deque repeat execution when maxlen exist and size is not 1

2017-02-23 Thread Louie Lu

New submission from Louie Lu:

There is a XXX in v3.5.0 shows that need to dealing with deque maxlen setting 
case in deque_repeat.

Although there have common case for deque size 1 with maxlen, other size of 
deque with maxlen still using for-loop to extend the deque, without any 
detection.

Adding this fast break will reduce the execution speed when repeat deque with 
maxlen.

---
$ cat tests.py
from collections import deque
for _ in range(10:
d = deque(maxlen=100_000)
d.insert(0, 0)
d.insert(0, 10)
d * 10_000_000
$ time ./python_with_patch tests.py
$ time ./python tests.py

--
components: Extension Modules
messages: 288460
nosy: louielu
priority: normal
severity: normal
status: open
title: Reduce deque repeat execution when maxlen exist and size is not 1
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



[issue29598] Write unit tests for pdb module

2017-02-23 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> Note that there is a bug in find_function() (it opens a file with default 
> encoding).

Please open an issue.

--

___
Python tracker 

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



[issue29259] Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects

2017-02-23 Thread STINNER Victor

STINNER Victor added the comment:

I don't completely reject the issue. I may come back later if I find a way to 
make it even more efficient. But I prefer to close the issue as REJECTED to 
make it clear that right now with the current implementation and benchmark 
results, it's not worth it.

--
resolution:  -> rejected
stage:  -> 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



[issue29465] Modify _PyObject_FastCall() to reduce stack consumption

2017-02-23 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Add _PyObject_FastCall() to reduce stack consumption -> Modify 
_PyObject_FastCall() to reduce stack consumption

___
Python tracker 

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



[issue29632] argparse values for action in add_argument() should be flags instead of (or in addition to) strings

2017-02-23 Thread R. David Murray

R. David Murray added the comment:

The obvious thing to do would be to make the Action subclasses have public 
names.  I personally would continue to use the strings, though, as they are 
easier to type.  (The same would be true if an enum were introduced (that I'd 
continue to use the stings because they are easier to type :), since they would 
need to be namespaced (argparse.action.store_true, for example).)

I can see some potential value in exposing the action subclasses, but I'm not 
sure if it is worth it.

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



[issue29633] MSI installer does not pass values as SecureProperty from UI

2017-02-23 Thread aldehoff

New submission from aldehoff:

This is a revival of issue 1298962 (http://bugs.python.org/issue1298962) from 
2009. I can reproduce the problem with an MSI created by cx_Freeze and 
bdist_msi on a Windows 7 64bit system in a company domain. Python is at version 
3.6.0, cx_Freeze is at 5.0.1. I am a user with elevated user rights but not an 
admin. When installing the MSI, the files are always copied to C:\, whether I 
have changed the installation directory in GUI or stuck to the default path 
'C:\Program Files (x86)\foo'. The program is executable and runs fine. The 
Uninstaller removes all files without a trace.

Following the suggestions from issue 1298962 I have modified the MSI tables in 
Orca by adding a new Property entry with key 'SecureCustomProperties' and value 
'TARGETDIR' fixes the MSI. It now installs into the desired directory. I can 
reproduce this on multiple builds.

--
components: Installation, Windows
messages: 288455
nosy: aldehoff, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: MSI installer does not pass values as SecureProperty from UI
type: behavior
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



[issue28911] Clarify the behaviour of assert_called_once_with

2017-02-23 Thread Arne de Laat

Changes by Arne de Laat :


--
pull_requests: +222

___
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-23 Thread Nick Coghlan

Nick Coghlan added the comment:

Thanks mbusson, 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



[issue27840] functools.partial: don't copy keywoard arguments in partial_call()?

2017-02-23 Thread STINNER Victor

STINNER Victor added the comment:

I reopen the issue to propose to add a comment explaining why the dictionary 
must always be copied:
https://github.com/python/cpython/pull/253

--
pull_requests: +221
resolution: rejected -> 
status: closed -> open

___
Python tracker 

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



[issue29581] __init_subclass__ causes TypeError when used with standard library metaclasses (such as ABCMeta)

2017-02-23 Thread Nick Coghlan

Nick Coghlan added the comment:

Note that the publisher side workaround for this is relatively straightforward: 
__init_subclass__ implementations that want to be compatible with arbitrary 
metaclasses will need to take any additional parameters as class attributes 
(which they may delete), rather than as class header keyword arguments.

For 3.7 though, it probably makes sense to update abc.ABCMeta to pass along 
arbitrary keyword arguments based on the same rationale as used in PEP 487 to 
justify making this change for type itself: by default, type.__init_subclass__ 
will still complain about it, but if someone overrides __init_subclass__ to 
accept additional keyword arguments, doing so will just work.

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



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

2017-02-23 Thread Eryk Sun

Eryk Sun added the comment:

I had suggested inheriting the TYPEFLAG_NONARGTYPE flag in StructUnionType_new. 
It requires a minor change to get basedict unconditionally, and then assign 

if (basedict)
dict->flags |= basedict->flags & TYPEFLAG_NONARGTYPE;

We need more feedback on this suggested flag, especially to stay consistent 
with CFFI if possible. Do you know whether CFFI supports passing unions and 
structs with bitfields in its ABI mode for 64-bit Unix?

--

___
Python tracker 

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



[issue29581] __init_subclass__ causes TypeError when used with standard library metaclasses (such as ABCMeta)

2017-02-23 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +Martin.Teichmann

___
Python tracker 

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



[issue29581] __init_subclass__ causes TypeError when used with standard library metaclasses (such as ABCMeta)

2017-02-23 Thread Nick Coghlan

Nick Coghlan added the comment:

Oops, and now I see the typo in the example code, it seems you're right. I was 
misremembering an earlier more decorator-like variant of the design where we 
didn't rely on passing the __init_subclass__ arguments through the metaclass 
constructor.

--

___
Python tracker 

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



[issue29581] __init_subclass__ causes TypeError when used with standard library metaclasses (such as ABCMeta)

2017-02-23 Thread Nick Coghlan

Nick Coghlan added the comment:

No, the filtering is only applied to the __new__ and __init__ calls on the 
metaclass, not to the __init_subclass__ call.

Showing the last part of an interactive session where I ran the above commands:

===
>>> class AbstractWithInit(ignore_extra_args(Abstract), InitX, x=1):
... pass
... 
x
>>> AbstractWithInit()
<__main__.AbstractWithInit object at 0x7f9086694a58>
>>> 
===

--

___
Python tracker 

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



[issue23890] assertRaises increases reference counter

2017-02-23 Thread Nick Coghlan

Nick Coghlan added the comment:

Victor's PR takes a more pragmatic approach to address this problem: rather 
than adding the ability to clear the frames for an arbitrary exception tree, it 
just uses a try/finally in a couple of key unittest function definitions to 
clear the offending circular references by setting them to None.

--

___
Python tracker 

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



[issue23890] assertRaises increases reference counter

2017-02-23 Thread Nick Coghlan

Changes by Nick Coghlan :


--
stage: needs patch -> commit review

___
Python tracker 

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



[issue28911] Clarify the behaviour of assert_called_once_with

2017-02-23 Thread Arne de Laat

Changes by Arne de Laat :


--
pull_requests: +220

___
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-23 Thread Vinay Sajip

Vinay Sajip added the comment:

Just a thought - the TYPEFLAG_NONARGTYPE needs to be copied from the base class 
if set there, right?

--

___
Python tracker 

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



[issue29606] urllib FTP protocol stream injection

2017-02-23 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +christian.heimes, haypo

___
Python tracker 

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



[issue18423] Document limitations on -m

2017-02-23 Thread Nick Coghlan

Nick Coghlan added the comment:

The limitation noted in #18422 was specific to 3.3, as the missing API was 
added to NamespaceLoader in 3.4.

So the current documentation is accurate for recent versions of Python.

--
nosy: +ncoghlan
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed
versions: +Python 3.3 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue29624] Python 3.5.3 x86 web installer cannot install launcher

2017-02-23 Thread Steve Dower

Steve Dower added the comment:

Creating a repaired installer is possible, though risky (it's easy when I still 
have the original build handy, but at this stage a rebuild will produce 
different hashes and make things worse). But I intend to look into that as soon 
as I can.

If the launcher is not already installed, or if an older version is installed, 
it will be selected by default. So it's a little harder to avoid, and more 
likely to cause problems for people who don't have 3.6.

There's a command line option to just install the launcher (LauncherOnly=1), 
but nothing in the UI. However, if you install and then uninstall Python, the 
launcher is left behind (must be uninstalled separately), so that's one way to 
get it. I'd suggest add/remove Python 3.6, as that will get the latest version 
of the launcher.

--

___
Python tracker 

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



[issue28911] Clarify the behaviour of assert_called_once_with

2017-02-23 Thread Arne de Laat

Changes by Arne de Laat :


--
pull_requests: +219

___
Python tracker 

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



[issue28598] RHS not consulted in `str % subclass_of_str` case.

2017-02-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +218

___
Python tracker 

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



[issue29632] argparse values for action in add_argument() should be flags instead of (or in addition to) strings

2017-02-23 Thread Pedro

New submission from Pedro:

The possible values for action are currently:
'store'
'store_true'
'store_false'
'store_const'
'append'
'append_const'
'count'
'help'
'version'
a subclass of argparse.Action

The string values are evidently for backward compatibility with optparse. 
However, adding the ability to specify these options as flags would make 
argparse code more maintainable (e.g. IDEs are better at refactoring symbols 
than strings), bring it in line with other places where a module has built-in 
flags, like the regex module (re.MULTILINE, re.IGNORECASE, etc.), and expand 
the use of flags that already exist in argparse (e.g. argparse.SUPPRESS, 
argparse.REMAINDER).

The string values need not be immediately deprecated, but can be made available 
as the preferred option for new development. See, for example, getName() and 
setName() in the threading module, which are documented as follows: "Old 
getter/setter API for name; use it directly as a property instead." A similar 
suggestion can be provided for argparse flags: "Old action values for backward 
compatibility; use the flags instead."

--
messages: 288445
nosy: pgacv2
priority: normal
severity: normal
status: open
title: argparse values for action in add_argument() should be flags instead of 
(or in addition to) strings
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



[issue28598] RHS not consulted in `str % subclass_of_str` case.

2017-02-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests:  -57

___
Python tracker 

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



[issue28810] Document bytecode changes in 3.6

2017-02-23 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi :


--
pull_requests: +217

___
Python tracker 

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



  1   2   >