[issue25838] Lib/httplib.py: Resend http request on server close connection

2015-12-11 Thread Mikhail Gulyaev

Mikhail Gulyaev added the comment:

> Why can’t you do the file rewinding yourself, when you retry the request?
Actually I'm not retry to send a request. This behavior I met for httplib 
library while I'm send a single request, httplib send it to exist connection 
and then recreates connection on failure and send it again. Maybe this doing 
tcp socket
For GET POST and DELETE I meet the same behavior

> if someone wrote code that expects data to be sent from a non-zero file 
> position.
Well in this case I'd prefer to trunkate file before send.

--
Added file: http://bugs.python.org/file41285/httplib.pcapng

___
Python tracker 

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



[issue25838] Lib/httplib.py: Resend http request on server close connection

2015-12-11 Thread Martin Panter

Martin Panter added the comment:

Sorry but I have a few concerns about your patch:

Why does this have to be in the HTTPConnection.send() method? Why can’t you do 
the file rewinding yourself, when you retry the request?

This could break compatibility if someone wrote code that expects data to be 
sent from a non-zero file position.

I think this would be new feature (for the next version of Python), and 
couldn’t be accepted as a bug fix for 2.7.

See also Issue 9740 (persistent HTTP client connections), where I suggested a 
few things you mentioned, including polling for an unsolicited response or 
closed connection, and reconnecting before sending a request.

Also beware that a general HTTP client shouldn’t automatically retry idempotent 
requests if there is a chance that the original request was already received. 
PUT is idempotent so that is okay. POST is not, however.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25838] Lib/httplib.py: Resend http request on server close connection

2015-12-11 Thread Mikhail Gulyaev

Changes by Mikhail Gulyaev :


Added file: http://bugs.python.org/file41286/Выделение_058.png

___
Python tracker 

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



[issue25838] Lib/httplib.py: Resend http request on server close connection

2015-12-11 Thread Mikhail Gulyaev

Changes by Mikhail Gulyaev :


Added file: http://bugs.python.org/file41288/Выделение_061.png

___
Python tracker 

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



[issue25838] Lib/httplib.py: Resend http request on server close connection

2015-12-11 Thread Mikhail Gulyaev

Changes by Mikhail Gulyaev :


Added file: http://bugs.python.org/file41287/Выделение_059.png

___
Python tracker 

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



[issue25839] negative zero components are ignored in complex number literals

2015-12-11 Thread Mark Dickinson

Mark Dickinson added the comment:

This is something that comes up repeatedly on the bug tracker. There's no bug 
here in the complex type or the repr. What there *is* is a limitation resulting 
from the fact that Python doesn't have *imaginary* literals, only *complex* 
literals. So in:

-1-0j

the 0j is already a complex number with both real and imaginary parts equal to 
0.0. Then -1 gets promoted to a complex number with real part -1 and imaginary 
part 0.0.  And now you're doing:

complex(-1.0, 0.0) - complex(0.0, 0.0)

which naturally gives an imaginary part of +0.0 rather than 0.0.

You'll see the same issue in C: there was an attempt to fix it in C99 by 
introducing Imaginary types, but those Imaginary types haven't been widely 
adopted. The most recent reincarnation of the C standard finally introduces a 
macro that lets you instantiate a complex number in terms of its real and 
imaginary components (instead of doing real_part + imag_part * I); this is 
something that Python already has in the form of the complex constructor.

Closing as not a bug.

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue25839] negative zero components are ignored in complex number literals

2015-12-11 Thread Mark Dickinson

Mark Dickinson added the comment:

> As I understand the output of repr() is supposed to be something that can 
> evaluated to recreate the same object.

Right, but that's an ideal that's not always achieved in practice. If I had my 
druthers, I'd 'fix' the repr of the complex object to return something that's 
written in terms of the constructor (for example, "complex(2.3, -0.0)"). I 
don't think that's a reasonable change from the POV of backwards compatibility 
though.

--

___
Python tracker 

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



[issue25839] negative zero components are ignored in complex number literals

2015-12-11 Thread Mark Dickinson

Mark Dickinson added the comment:

Previous discussions: #17336, #22548

--

___
Python tracker 

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



[issue24844] Python 3.5rc1 compilation error with Apple clang 4.2 included with Xcode 4

2015-12-11 Thread Mojca Miklavec

Mojca Miklavec added the comment:

Is anyone willing to help me a bit to come up with a pull request?

I took some ideas from here:
https://fossies.org/diffs/xscreensaver/5.30_vs_5.32/utils/thread_util.c-diff.html

Citation from that patch:
   Clang 3.0 has a partial implementation of GNU atomics; 3.1 rounds it out.

   
http://llvm.org/viewvc/llvm-project/cfe/tags/RELEASE_30/final/include/clang/Basic/Builtins.def?view=markup
   
http://llvm.org/viewvc/llvm-project/cfe/tags/RELEASE_31/final/include/clang/Basic/Builtins.def?view=markup

   Apple changes the Clang version to track Xcode versions; use
   __apple_build_version__ to distinguish between the two.

   Xcode 4.3 uses Apple LLVM 3.1, which corresponds to Clang 3.1.
   https://en.wikipedia.org/wiki/Xcode

One should probably adapt this into "at least clang 3.3 (or perhaps even 3.4?) 
is needed". Now, the basic test in configure.ac is the following:

volatile int val = 1;
int main() {
__atomic_load_n(, __ATOMIC_SEQ_CST);
return 0;
}

With clang on 10.7 (Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 
3.2svn)) this compiles, runs and returns 0. Evidently a more complex test is 
needed to trigger the error, but I'm not sure that that test should be since I 
don't have enough experience with "atomic". If you have a clue what 
functionality I should test, I will gladly do it and try to come up with a 
better test.

An alternative could be to blacklist a compiler and this is what I am proposing 
here as a very naive approach:

volatile int val = 1;
int main() {
 
__atomic_load_n(, __ATOMIC_SEQ_CST);

#define VERSION_CHECK(cc_major, cc_minor, req_major, req_minor) \
((cc_major) > (req_major) || \
(cc_major) == (req_major) && (cc_minor) >= (req_minor))

#if defined(__clang__)
#if defined(__apple_build_version__)
// either one test or the other should work
// #if __apple_build_version__ < 500
#if !VERSION_CHECK(__clang_major__, __clang_minor__, 5, 0)
this_should_fail();
#endif
// not sure if this is 3.3 or 3.4
#elif !VERSION_CHECK(__clang_major__, __clang_minor__, 3, 3)
this_should_fail();
#endif
#endif

  return 0;
}

--
nosy: +Mojca Miklavec

___
Python tracker 

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



[issue25838] Lib/httplib.py: Resend http request on server close connection

2015-12-11 Thread R. David Murray

R. David Murray added the comment:

This patch is definitely invalid.  There is no requirement that data be 
seekable.

Are you saying that there insufficient support in http(lib) for an application 
to handle this server timeout?  Can you provide a program that demonstrates the 
problem (even better would be a unit test that simulates the server timeout).  
I'm thinking it is likely that it is the responsibility of the layer above 
http(lib) to handle this, but the problem isn't clear enough to me to be sure 
(Martin probably has a better understanding of 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



[issue25841] In FancyURLopener error in example with http address.

2015-12-11 Thread R. David Murray

Changes by R. David Murray :


--
stage:  -> needs patch
versions: +Python 2.7 -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



[issue25842] Installer does not set permissions correctly?

2015-12-11 Thread Laura Creighton

New submission from Laura Creighton:

This in from python-list.  2 complaints.  
conflict with a notepad++ plugin and incorrect permissions.

Date:Fri, 11 Dec 2015 16:30:32 +
To:  "python-l...@python.org" 
From:Jay Hamm 
Subject: python 351x64


Hi

I was trying to use your windows version of python 3.5.1 x64.

It has a conflict with a notepad++ plugin NppFTP giving api-ms-win-crt-runtime-
I1-1-0.dll error on start up.

This seems pretty well documented on the web. The work around is to delete the 
plugin and reinstall since it borks the install.

Since about every other admin I've ever known uses notepad++, you might want to
 fix this.

Also your installer fails to set the permissions correctly:

H:\>py -m pip install requests
Collecting requests
  Downloading requests-2.8.1-py2.py3-none-any.whl (497kB)
100% || 499kB 875kB/s
Installing collected packages: requests
Exception:
Traceback (most recent call last):
  File "C:\Program Files\Python35\lib\site-packages\pip\basecommand.py", line 2
11, in mainstatus = self.run(options, args)
  File "C:\Program Files\Python35\lib\site-packages\pip\commands\install.py", l
ine 311, in runroot=options.root_path,
  File "C:\Program Files\Python35\lib\site-packages\pip\req\req_set.py", line 6
46, in install**kwargs
  File "C:\Program Files\Python35\lib\site-packages\pip\req\req_install.py", li
ne 803, in installself.move_wheel_files(self.source_dir, root=root)
  File "C:\Program Files\Python35\lib\site-packages\pip\req\req_install.py", li
ne 998, in move_wheel_filesisolated=self.isolated,
  File "C:\Program Files\Python35\lib\site-packages\pip\wheel.py", line 339, in
 move_wheel_filesclobber(source, lib_dir, True)
  File "C:\Program Files\Python35\lib\site-packages\pip\wheel.py", line 310, in
 clobberensure_dir(destdir)
  File "C:\Program Files\Python35\lib\site-packages\pip\utils\__init__.py", lin
e 71, in ensure_diros.makedirs(path)
  File "C:\Program Files\Python35\lib\os.py", line 241, in makedirsmkdir(na
me, mode) PermissionError: [WinError 5] Access is denied: 'C:\\Program Files\\P
ython35\\Lib\\site-packages\\requests'

Once I gave myself control it started working.

This is pretty shoddy for released software.
Thanks,
Jacob Hamm (Jay) VCP-DCV, RHCE
Senior Cloud Services Engineer - VMware vCloud Air

380 Interlocken Crescent Blvd - Ste 500, Broomfield CO 80021
Office 303 942 4638 - ha...@vmware.com
Want to learn more about VMware vCloud Air?
Go to http://vcloud.vmware.com/tutorials
[vCloudAir]

--
components: Installation, Windows
messages: 256223
nosy: lac, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Installer does not set permissions correctly?
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



[issue25840] Allow `False` to be passed to `filter`

2015-12-11 Thread leewz

New submission from leewz:

Meaning:

filter(False, lst)
== (x for x in lst if not x)
== itertools.filterfalse(None, lst)

I understand that it is a very minor enhancement, and with not much benefit. I 
just happened to think about it, and wondered why it didn't already exist. I 
figured it wouldn't hurt to put the idea out here.

(If anyone is interested, I was looking into ways that filter/map/itertools 
could "unwrap" each other at the C level to improve composition of generators, 
inspired by the functools.partial optimization.)

--
messages: 256218
nosy: leewz
priority: normal
severity: normal
status: open
title: Allow `False` to be passed to `filter`
type: enhancement
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



[issue25840] Allow `False` to be passed to `filter`

2015-12-11 Thread R. David Murray

R. David Murray added the comment:

I don't think it is worth adding as a special case.  Itertools has it because 
of what itertools is (a mini-language for manipulating iterables), but the 
legacy filter function has no reason to grow additional special cases beyond 
None.  (It's not even clear why it has that one special case :)

--
nosy: +r.david.murray
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



[issue25841] In FancyURLopener error in example with http address.

2015-12-11 Thread Denis Savenko

New submission from Denis Savenko:

In documentation from this page 
https://docs.python.org/3.5/library/urllib.request.html#examples in examples 
uses default address to python site with http. ( http://python.org/ ). But now 
python.org use https. When i try use example in ipython i get I/0 error, but 
error is very simple - http change by https. I found this error on many pages, 
where use http://python.org/ address, but on FancyURLopener example compiller 
error very difficult for understanding.

--
assignee: docs@python
components: Documentation
messages: 256221
nosy: Denis Savenko, docs@python
priority: normal
severity: normal
status: open
title: In FancyURLopener error in example with http address.
versions: 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



[issue24505] shutil.which wrong result on Windows

2015-12-11 Thread Toby Tobkin

Toby Tobkin added the comment:

I'm working on a patch and an accompanying unit test for this now. Should have 
it out today.

--
nosy: +tobytobkin

___
Python tracker 

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



[issue6478] time.tzset does not reset _strptime's locale time cache

2015-12-11 Thread Berker Peksag

Berker Peksag added the comment:

Thanks Serhiy. Can we close this now?

--

___
Python tracker 

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



[issue25843] lambdas on the same line may incorrectly share code objects

2015-12-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The equality of code objects is determined by the code_richcompare() logic in 
Objects/codeobject.c.

Two code objects are equal if all of their attributes compare equal.  That 
includes co_name, co_argcount, co_kwonlyargcount, co_nlocals, co_flags, 
co_firstlineno, co_code, co_consts, co_names, co_varnames, co_freevars, and 
co_cellvars.

At the heart of David Murray's minimal example, the reason the two distinct 
code objects compare equal is that their co_consts compare as equal.

If you wanted to fix this, code objects would need to recursively check for 
both normal equality and type equality.

>>> f1 = lambda: 1
>>> f2 = lambda: 1.0
>>> f1.__code__.co_consts == f2.__code__.co_consts
True
>>> map(type, f1.__code__.co_consts) == map(type, f2.__code__.co_consts)
False

--
nosy: +rhettinger

___
Python tracker 

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



[issue5501] Update multiprocessing docs re: freeze_support

2015-12-11 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +davin

___
Python tracker 

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



[issue25757] Subclasses of property lose docstring

2015-12-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cc1aa0e88626 by Berker Peksag in branch '3.5':
Issue #25755: Move PropertyWritableDoc into the test case
https://hg.python.org/cpython/rev/cc1aa0e88626

New changeset 8f52c9d72d9f by Berker Peksag in branch 'default':
Issue #25755: Move PropertyWritableDoc into the test case
https://hg.python.org/cpython/rev/8f52c9d72d9f

--
nosy: +python-dev

___
Python tracker 

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



[issue25755] Test test_property failed if run twice

2015-12-11 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Nan. I've updated your patch to apply Serhiy's advice.

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

___
Python tracker 

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



[issue25822] Add docstrings to fields of urllib.parse results

2015-12-11 Thread Berker Peksag

Berker Peksag added the comment:

Thanks, Swati. I left a few comments on Rietveld: 
http://bugs.python.org/review/25822/

A test wouldn't hurt, but you can wait for further review comments to avoid 
updating tests each time you get a comment.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue25730] invisible sidebar content with code snippets

2015-12-11 Thread Berker Peksag

Berker Peksag added the comment:

This can be reproduced at https://docs.python.org/3/faq/windows.html

You can find the CSS file at Doc/tools/pydoctheme/static/pydoctheme.css. You 
can override .highlight there, but the actual problem is that Sphinx creates 
the outer highlight-python3 div with "position: relative;". I think your CSS 
fix is good enough to commit. Thanks!

--
nosy: +berker.peksag

___
Python tracker 

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



[issue25757] Subclasses of property lose docstring

2015-12-11 Thread Berker Peksag

Berker Peksag added the comment:

fix_repetitions.diff was unrelated to this issue so subprop_doc_r2.diff still 
needs to be reviewed.

--

___
Python tracker 

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



[issue25757] Subclasses of property lose docstring

2015-12-11 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for fix_repetitions.diff, Torsten. The test_property failure was 
discussed in issue 25755.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue25823] Speed-up oparg decoding on little-endian machines

2015-12-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I verified that Clang and GCC both give the expected disassembly with Serhiy's 
patch.   We ought to restrict the #if to just the compilers that are known to 
optimize away the memcpy.

Clang (for 'BUILD_LIST_UNPACK')
---
  .loc10 2525 9   ## Python/ceval.c:2525:9
  movzwl  (%r13), %r9d
  addq$2, %r13
  Ltmp2042:
  ##DEBUG_VALUE: PyEval_EvalFrameEx:next_instr <- R13

GCC (for 'BUILD_LIST_UNPACK')
- 
  LM1275:
  movzwl  (%rdx), %r8d
  LVL1147:
  leaq2(%rdx), %rbp

[Mark]
> Benchmarks showing dramatic real-world speed improvements ...

Much of the doubling of speed for core Python that has occurred over the last 
ten decade has occurred one little step at a time, none of the them being 
individually "dramatic".  In general, if we have a chance to reduce the work 
load in the ceval inner-loop, we should take it.

A simple benchmark on clang shows a roughly 10+% speedup in code exercising 
simple and common opcodes that that have a oparg (there is no point of 
benchmarking the effect on opcodes like IMPORT_NAME where the total eval-loop 
overhead is already an insignificant proportion of the total work).

Baseline version with CLANG Apple LLVM version 7.0.2 (clang-700.1.81)
  $ ./python.exe exercise_oparg.py 
  0.22484053499647416
  $ ./python.exe exercise_oparg.py 
  0.22687773499637842
  $ ./python.exe exercise_oparg.py 
  0.22026274001109414

Patched version with CLANG Apple LLVM version 7.0.2 (clang-700.1.81)
  $ ./python.exe exercise_oparg.py 
  0.19516360601119231
  $ ./python.exe exercise_oparg.py 
  0.20087355599389412
  $ ./python.exe exercise_oparg.py 
  0.1980393300036667

To better isolate the effect, I suppose you could enable the READ_TIMESTAMP 
macros to precisely measure the effect of converting five sequentially 
dependent instructions with two independent instructions, but likely all it 
would show you is that the two are cheaper than the five.

--
Added file: http://bugs.python.org/file41289/exercise_oparg.py

___
Python tracker 

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



[issue25755] Test test_property failed if run twice

2015-12-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cc1aa0e88626 by Berker Peksag in branch '3.5':
Issue #25755: Move PropertyWritableDoc into the test case
https://hg.python.org/cpython/rev/cc1aa0e88626

New changeset 8f52c9d72d9f by Berker Peksag in branch 'default':
Issue #25755: Move PropertyWritableDoc into the test case
https://hg.python.org/cpython/rev/8f52c9d72d9f

--
nosy: +python-dev

___
Python tracker 

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



[issue25757] Subclasses of property lose docstring

2015-12-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Can this be closed now or is there work left to be done?

--
nosy: +rhettinger

___
Python tracker 

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



[issue25768] compileall functions do not document or test return values

2015-12-11 Thread Brett Cannon

Brett Cannon added the comment:

Do the tests take much longer with all of the added stuff in 
setUp()/tearDown()? It's just that all of it has to run for all tests. You 
could make a mixin or put all of it in a method that you selectively call and 
which registers the proper cleanup method.

As for skip_curdir, if you look at 
https://hg.python.org/cpython/file/default/Lib/compileall.py#l188 you will 
notice it requires the current directory to be on sys.path and I don't see you 
make any such change to sys.path (and if you do you can use 
test_importlib.util.import_state to temporarily mutate sys.path 
(https://hg.python.org/cpython/file/default/Lib/test/test_importlib/util.py#l165).

--

___
Python tracker 

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



[issue25838] Lib/httplib.py: Resend http request on server close connection

2015-12-11 Thread Martin Panter

Martin Panter added the comment:

As far as I understand, httplib should not be automatically reconnecting and 
re-sending requests. I still suspect your script may be causing the retry, but 
you are welcome to prove me wrong.

Can you clarify “send PUT request to closed socket”: is the local OS socket 
closed (file descriptor is released)? Or is it that the remote end of the 
connection has been shut down? If it is the remote end, in Python 2 usually you 
would see a BadStatusLine or some kind of socket.error exception, and nothing 
would be retried.

I think we really need to know what your script is doing to be able to help. 
For instance, in the 059 screen shot, what API calls were made to cause data to 
be initially sent (presumably from local port 40736), and then the reconnection 
(local port 40757) with more data?

--
stage:  -> test needed

___
Python tracker 

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



[issue25845] _ctypes\cfield.c identical subexpressions in Z_set

2015-12-11 Thread Martin Panter

Martin Panter added the comment:

History is good for understanding how things became the way they are. :) Thanks 
Alexander and Random!

--
nosy: +martin.panter
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> enhancement
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



[issue25843] lambdas on the same line may incorrectly share code objects

2015-12-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Here's another variant (courtesy of Nick Coghlan):

python3.5 -c "seq1 = [1.0 for x in range(5)]; seq2 = [True for x in range(5)]; 
print(seq1); print(seq2)"

--

___
Python tracker 

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



[issue25843] lambdas on the same line may incorrectly share code objects

2015-12-11 Thread Kevin Shweh

Kevin Shweh added the comment:

A type-based check runs into problems with 0.0 vs -0.0. For example, on Python 
2.7.11:

>>> x, y = lambda: 0.0, lambda: -0.0
>>> y()
0.0

I wasn't able to reproduce the -0.0 problem with Python 3.4 on Ideone; 
y.__code__.co_consts seems to have an unused 0.0 in it on 3.4. I don't have 
access to Python 3.5, so I don't know what the situation is like on that 
version.

--
nosy: +Kevin Shweh

___
Python tracker 

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



[issue25841] In FancyURLopener error in example with http address.

2015-12-11 Thread Martin Panter

Martin Panter added the comment:

Assuming you meant http://www.python.org/ (added the www), I cannot produce any 
error with any example that requests directly to the site. The “http:” server 
already redirects to “https:”, so there is no problem. Obviously the examples 
that depend on made-up servers like proxy.example.com are going to fail.

In particular, the second FancyURLopener example works for me. Modified 
slightly to avoid copious output:

$ python3.5 -bWall
Python 3.5.0 (default, Sep 20 2015, 11:28:25) 
[GCC 5.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib.request
>>> opener = urllib.request.FancyURLopener({})
__main__:1: DeprecationWarning: FancyURLopener style of invoking requests is 
deprecated. Use newer urlopen functions/methods
>>> with opener.open("http://www.python.org/;) as f:
... response = f.read().decode('utf-8')
... 
>>> response[:100]
'\n\n

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



[issue25844] Pylauncher, launcher.c: Assigning NULL to a pointer instead of testing against NULL

2015-12-11 Thread Alexander Riccio

New submission from Alexander Riccio:

I found this while writing up a separate bug (CPython doesn't use static 
analysis!).

In PC/launcher.c, get_env has a bug:

/* Large environment variable. Accept some leakage */
wchar_t *buf2 = (wchar_t*)malloc(sizeof(wchar_t) * (result+1));
if (buf2 = NULL) {
error(RC_NO_MEMORY, L"Could not allocate environment buffer");
}
GetEnvironmentVariableW(key, buf2, result);
return buf2;

See: https://hg.python.org/cpython/file/tip/PC/launcher.c#l117


Instead of `buf2 == NULL`, Vinay Sajip wrote `buf2 = NULL`. The commit where 
the error was introduced: https://hg.python.org/cpython/rev/4123e002a1af

Thus, whatever value was in buf2 is lost, the branch is NOT taken (because buf2 
evaluates to false), and GetEnvironmentVariableW will (probably) cause an 
access violation. 


Compiling with /analyze found this quite easily:

c:\pythondev\repo\pc\launcher.c(117): warning C6282: Incorrect operator:  
assignment of constant in Boolean context. Consider using '==' instead.

--
components: Windows
messages: 256254
nosy: Alexander Riccio, paul.moore, steve.dower, tim.golden, vinay.sajip, 
zach.ware
priority: normal
severity: normal
status: open
title: Pylauncher, launcher.c: Assigning NULL to a pointer instead of testing 
against NULL

___
Python tracker 

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



[issue25844] Pylauncher, launcher.c: Assigning NULL to a pointer instead of testing against NULL

2015-12-11 Thread Alexander Riccio

Changes by Alexander Riccio :


--
type:  -> crash

___
Python tracker 

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



[issue25846] Use of Py_ARRAY_LENGTH on pointer in posixmodule.c, win32_wchdir

2015-12-11 Thread Alexander Riccio

New submission from Alexander Riccio:

I found this while writing up a separate bug (CPython doesn't use static 
analysis!).

In modules/posixmodule.c, win32_wchdir uses Py_ARRAY_LENGTH on a wchar_t*:

wchar_t _new_path[MAX_PATH], *new_path = _new_path;
int result;
wchar_t env[4] = L"=x:";

if(!SetCurrentDirectoryW(path))
return FALSE;
result = GetCurrentDirectoryW(Py_ARRAY_LENGTH(new_path), new_path);


...instead of using Py_ARRAY_LENGTH(_new_path), the programmer wrote 
Py_ARRAY_LENGTH(new_path), doesn't work on pointers:

/* Get the number of elements in a visible array

   This does not work on pointers, or arrays declared as [], or function
   parameters. With correct compiler support, such usage will cause a build
   error (see Py_BUILD_ASSERT_EXPR).

   Written by Rusty Russell, public domain, http://ccodearchive.net/
*/
#define Py_ARRAY_LENGTH(array) \
(sizeof(array) / sizeof((array)[0]))


The same issue occurs two lines later:

if (result > Py_ARRAY_LENGTH(new_path)) {



Compiling with /analyze found this quite easily:

c:\pythondev\repo\modules\posixmodule.c(1354): warning C6384: Dividing sizeof a 
pointer by another value.

--
components: Windows
messages: 256260
nosy: Alexander Riccio, larry, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Use of Py_ARRAY_LENGTH on pointer in posixmodule.c, win32_wchdir

___
Python tracker 

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



[issue25845] _ctypes\cfield.c identical subexpressions in Z_set

2015-12-11 Thread random832

random832 added the comment:

Looks like a result of searching and replacing PyInt with PyLong - the diff can 
be found here, if anyone cares. 
https://hg.python.org/cpython-fullhistory/rev/f324631462a2.

Oddly, there was _another, older_ revision that fixed this correctly: 
https://hg.python.org/cpython-fullhistory/rev/003d35215ef2 - looks like there 
was a bad merge somewhere along the line.

--
nosy: +random832

___
Python tracker 

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



[issue25822] Add docstrings to fields of urllib.parse results

2015-12-11 Thread Martin Panter

Martin Panter added the comment:

[padding]
I left some comments.

I wonder if the doc strings are too specific when they mention “request”, 
“file”, “download”, “page”, etc. Maybe these could just be examples of what the 
fields are used for (e.g. “The hierarchical path, such as the path to a file to 
download”). Or maybe they could be changed to general terms, but this may be 
hard.

Also, some of them seem redundant. Does it really add anything to say the 
“query” field is “the query parameter”?

--

___
Python tracker 

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



[issue25838] Lib/httplib.py: Resend http request on server close connection

2015-12-11 Thread R. David Murray

R. David Murray added the comment:

The issue is definitely in httplib2, then.  You should open an issue on their 
bug tracker.

--
resolution:  -> third party
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



[issue25838] Lib/httplib.py: Resend http request on server close connection

2015-12-11 Thread Mikhail Gulyaev

Mikhail Gulyaev added the comment:

Thanks for attention

--

___
Python tracker 

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



[issue19771] runpy should check ImportError.name before wrapping it

2015-12-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 850cc65ceda4 by Martin Panter in branch '3.5':
Issue #19771: Omit irrelevant message if package could not be initialized
https://hg.python.org/cpython/rev/850cc65ceda4

New changeset 323c10701e5d by Martin Panter in branch 'default':
Issue #19771: Merge runpy error adjustment from 3.5
https://hg.python.org/cpython/rev/323c10701e5d

--
nosy: +python-dev

___
Python tracker 

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



[issue25809] "Invalid" tests on locales

2015-12-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4f24a6dc934b by Martin Panter in branch '3.5':
Issue #25809: Skip testing platform-dependent French thousands separator
https://hg.python.org/cpython/rev/4f24a6dc934b

New changeset 7c5c03143923 by Martin Panter in branch 'default':
Issue #25809: Merge French locale test from 3.5
https://hg.python.org/cpython/rev/7c5c03143923

--
nosy: +python-dev

___
Python tracker 

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



[issue25845] _ctypes\cfield.c identical subexpressions in Z_set

2015-12-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 26859a7e385c by Martin Panter in branch '3.5':
Issue #25845: Drop redundant checks leftover from int to long conversion
https://hg.python.org/cpython/rev/26859a7e385c

New changeset 9be59ad8af80 by Martin Panter in branch 'default':
Issue #25845: Merge PyLong_Check() cleanup from 3.5
https://hg.python.org/cpython/rev/9be59ad8af80

--
nosy: +python-dev

___
Python tracker 

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



[issue19771] runpy should check ImportError.name before wrapping it

2015-12-11 Thread Martin Panter

Changes by Martin Panter :


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



[issue25838] Lib/httplib.py: Resend http request on server close connection

2015-12-11 Thread Mikhail Gulyaev

Mikhail Gulyaev added the comment:

You right I found who resend requests!

My request is goes through httplb2(which use httplib and resends request on 
failure), but the issue is that if request body contains file and then that 
file is read out and on retry there is nothing to read since we already read it 
in httplib. 
So what solution could you suggest for me? Is it some patch for httplib2 or 
totally my own troubles

This issue is on border of interacting httplib and httplib2
 - httplib sends request and reads out a file
 - httplib2 resends a request but file is already readed out

Will it be honest if we rereads file in httplib2? and could we able assume that 
readable object(hasattr(data,'read') == True) has also tell and seek methods

--

___
Python tracker 

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



[issue19771] runpy should check ImportError.name before wrapping it

2015-12-11 Thread Berker Peksag

Changes by Berker Peksag :


--
stage: patch review -> commit review

___
Python tracker 

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



[issue25845] _ctypes\cfield.c identical subexpressions in Z_set

2015-12-11 Thread Alexander Riccio

New submission from Alexander Riccio:

I found this while writing up a separate bug (CPython doesn't use static 
analysis!).


In _ctypes/cfield.c, Z_set has a bug of some sort:

if (PyLong_Check(value) || PyLong_Check(value)) {

See: https://hg.python.org/cpython/file/tip/Modules/_ctypes/cfield.c#l1378

...which has been there for at least 5 years: 
https://hg.python.org/cpython/rev/cab14be0ada1


I'm not sure what the original programmer meant - it's been around forever & I 
don't know what was there before it - but PyLong_Check(value) is evaluated 
twice. Which doesn't really make sense.

Compiling with /analyze found this quite easily:

c:\pythondev\repo\modules\_ctypes\cfield.c(1378): warning C6287: Redundant 
code:  the left and right sub-expressions are identical.



There's a similar issue in P_set, at line 1486.

--
components: ctypes
messages: 256256
nosy: Alexander Riccio, amaury.forgeotdarc, belopolsky, meador.inge
priority: normal
severity: normal
status: open
title: _ctypes\cfield.c identical subexpressions in Z_set

___
Python tracker 

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



[issue25843] lambdas on the same line may incorrectly share code objects

2015-12-11 Thread Raymond Hettinger

Raymond Hettinger added the comment:

One possible solution for all these variants is to let code objects track both 
the co.firstlineno and co.firstrowno.

--

___
Python tracker 

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



[issue25838] Lib/httplib.py: Resend http request on server close connection

2015-12-11 Thread Martin Panter

Martin Panter added the comment:

Okay that makes a lot more sense! I agree that this should either be fixed in 
httplib2 or in your own script. The problem parallels Issue 5038, where 
urlopen() is used (rather than httplib2), and the request is retried after 
getting an authorization failure (rather than after a disconnection).

One option, if you can use Python 3.2+, might be to use a custom iterable 
object as the body. Then you get a hook to rewind the file every time it is 
iterated.

--

___
Python tracker 

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



[issue25822] Add docstrings to fields of urllib.parse results

2015-12-11 Thread Swati Jaiswal

Changes by Swati Jaiswal :


Added file: http://bugs.python.org/file41290/iss_25822_2.patch

___
Python tracker 

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



[issue25829] Mixing multiprocessing pool and subprocess may create zombie process, and cause program to hang.

2015-12-11 Thread Gregory P. Smith

Gregory P. Smith added the comment:

I wouldn't _assume_ that there was a good design reason for that in 
multiprocessing... it already mixed threads and fork() without realizing that 
you cannot safely do that.

--
nosy: +gregory.p.smith -gps

___
Python tracker 

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



[issue25847] CPython not using Visual Studio code analysis!

2015-12-11 Thread Alexander Riccio

New submission from Alexander Riccio:

Visual Studio comes with static analysis, enabled by /analyze (command line) or 
"Code analysis" in the project configuration dialog. Currently, none of the 
CPython projects in PCbuild have Code Analysis turned on, in any configuration.

I was going to write my first patch, for issue25386, but noticed this, ran a 
(partial) build with /analyze, and ended up filing three bugs instead 
(Issue25844, Issue25845, Issue25846) from bugs /analyze found.

There's quite a bad signal-to-noise ratio at the moment, as there's lots of 
variable shadowing, and there's lots of code that /analyze doesn't understand 
is benign (parsing a tuple into a variable confuses /analyze), but there is 
also lots of code that isn't *obviously* incorrect.

Of the code that's not obviously incorrect, /analyze usually complains about 
possibly out-of-bounds reads in very complex conditions, and I really can't 
tell. Some assertions would probably help.


Thoughts?

--
components: Build
messages: 256265
nosy: Alexander Riccio, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: CPython not using Visual Studio code analysis!

___
Python tracker 

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



[issue25809] "Invalid" tests on locales

2015-12-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 903a2664d32d by Martin Panter in branch '2.7':
Issue #25809: Skip testing platform-dependent French thousands separator
https://hg.python.org/cpython/rev/903a2664d32d

--

___
Python tracker 

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



[issue25840] Allow `False` to be passed to `filter`

2015-12-11 Thread Emanuel Barry

Emanuel Barry added the comment:

Do you mean like 'filter(None, lst)' does?

--
nosy: +ebarry

___
Python tracker 

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



[issue25711] Rewrite zipimport from scratch

2015-12-11 Thread STINNER Victor

STINNER Victor added the comment:

Can you both publish your WIP work?

--
nosy: +haypo

___
Python tracker 

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



[issue25809] "Invalid" tests on locales

2015-12-11 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

Same here. Thanks Martin.

--

___
Python tracker 

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



[issue25839] negative zero components are ignored in complex number literals

2015-12-11 Thread Mark Lundeberg

New submission from Mark Lundeberg:

Although -0.0 and +0.0 compare as equal using the == operator, they are 
distinct floating point numbers and in some cases behave differently. (See more 
information on the wikipedia article "Signed zero".) The distinction between 
+0.0 and -0.0 is most important in complex arithmetic, for example it is 
conventional and useful that sqrt(-1+0i) ==> +i and sqrt(-1-0i) ==> -i. Python 
currently allows the floating point number -0.0 to be entered as a literal:

>>> -0.0
-0.0

Complex floating point numbers in python also can hold negative zero 
components, as shown in their repr()

>>> -(1+0j)
(-1-0j)

However they cannot be input directly as literals; it is currently necessary to 
use the above construction. Unfortunately the output of the repr() cannot be 
used as a string literal to obtain the same number:

>>> (-1-0j)
(-1+0j)

except, in contrast:

>>> complex('-1-0j')
(-1-0j)


The literal -1-0j should yield a complex number with negative zero imaginary 
part. Note also that complex literals with negative zero real parts have the 
same bug, e.g. -0+1j is not the same as -(0-1j)

--
components: Interpreter Core
messages: 256209
nosy: Mark Lundeberg
priority: normal
severity: normal
status: open
title: negative zero components are ignored in complex number literals
type: behavior
versions: Python 2.7, Python 3.4

___
Python tracker 

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



[issue25839] negative zero components are ignored in complex number literals

2015-12-11 Thread STINNER Victor

STINNER Victor added the comment:

You should use complex(a, b) to have a reliable behaviour.

Python parse doesn't see "-1-0j" as a complex literal, but as (-1)-(0j): 
int-complex. Example with the AST output:

>>> ast.dump(ast.parse('-1-0j'))
'Module(body=[Expr(value=BinOp(left=UnaryOp(op=USub(), operand=Num(n=1)), 
op=Sub(), right=Num(n=0j)))])'


It looks like complex has the same behaviour than float:

>>> x=-0.0; x=0+x; x.real
0.0
>>> x=-0.0; x=0-x; x.real
0.0
>>> x=complex(0.0, -0.0); x=0+x; (x.real, x.imag)
(0.0, 0.0)
>>> x=complex(0.0, -0.0); x=0-x; (x.real, x.imag)
(0.0, 0.0)

zero sign is lost on int+complex, int-complex, int+complex, int-complex.

--
nosy: +haypo, mark.dickinson

___
Python tracker 

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



[issue25839] negative zero components are ignored in complex number literals

2015-12-11 Thread Mark Lundeberg

Mark Lundeberg added the comment:

Good point, it is doing (int-complex), observe also the following pecularities:

>>> -0 - 0j
0j
>>> -0. - 0j
(-0+0j)
>>> -0j
-0j
>>> 0-0j
0j
>>> -(0j)
(-0-0j)
>>> 0.+(-0j)
0j

Does this mean the bug is in repr() ? As I understand the output of repr() is 
supposed to be something that can evaluated to recreate the same object. 
However I am unsure whether it would be nicer if repr() were to yield 
'complex(-0.,-0.)' or '-(-0.+0j)'.

--

___
Python tracker 

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



[issue25840] Allow `False` to be passed to `filter`

2015-12-11 Thread leewz

leewz added the comment:

ebarry, note that `filter(None, lst)` is equivalent to `filter(bool, lst)`, 
which is the opposite of `filterfalse(None, lst)`. (Though `filter(True, lst) 
== filter(bool, lst)` would be a parallel.)

--

___
Python tracker 

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



[issue25843] unexpected output using pythons ternary operator in combination with lambda

2015-12-11 Thread Tijs Van Oevelen

Tijs Van Oevelen added the comment:

Apologies for not posting a summary of the bug. I really had no idea how to 
describe the problem, as it is over my head. I could only refer to my question 
on Stack Overflow that triggered the discovery of the bug.

--

___
Python tracker 

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



[issue25842] Installer does not set permissions correctly?

2015-12-11 Thread Zachary Ware

Zachary Ware added the comment:

Right, I should have been more specific here.  Sorry about that.

--

___
Python tracker 

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



[issue25843] unexpected output using pythons ternary operator in combination with lambda

2015-12-11 Thread Tijs Van Oevelen

Tijs Van Oevelen added the comment:

It's definitely also in 3.4 by the way.

--
versions: +Python 3.4

___
Python tracker 

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



[issue25842] Installer does not set permissions correctly?

2015-12-11 Thread Zachary Ware

Zachary Ware added the comment:

Responded on python-list.

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



[issue25842] Installer does not set permissions correctly?

2015-12-11 Thread Steve Dower

Steve Dower added the comment:

And for future reference, anyone who has Python in Program Files has 
*explicitly* chosen to put it there. We always default to a location where the 
current user can install packages as normal.

--

___
Python tracker 

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



[issue25843] unexpected-output-using-pythons-ternary-operator-in-combination-with-lambda

2015-12-11 Thread Tijs Van Oevelen

Changes by Tijs Van Oevelen :


--
nosy:  -Tijs Van Oevelen

___
Python tracker 

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



[issue25843] unexpected-output-using-pythons-ternary-operator-in-combination-with-lambda

2015-12-11 Thread Tijs Van Oevelen

New submission from Tijs Van Oevelen:

The bug is described on Stack Overflow in length:

http://stackoverflow.com/questions/34100732/unexpected-output-using-pythons-ternary-operator-in-combination-with-lambda

--
messages: 256229
nosy: Tijs Van Oevelen
priority: normal
severity: normal
status: open
title: 
unexpected-output-using-pythons-ternary-operator-in-combination-with-lambda
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue25843] unexpected-output-using-pythons-ternary-operator-in-combination-with-lambda

2015-12-11 Thread R. David Murray

R. David Murray added the comment:

For reference, the minimal reproducer is:

>>> f1, f2 = lambda: 1, lambda: 1.0
>>> f2()
1

The cause (according to the answer in the link) is that the two lambda's 
incorrectly compare as equal and end up sharing the same code object...one of 
the inequality checks is line number, so this only happens when the lambdas are 
on the same line.

Aside: it would be helpful if people would post bug summaries instead of just 
linking to an outside article.  The link is of course very valuable 
information, but it saves us time if the poster summarizes the bug so the right 
people know to look at it.

--
nosy: +Tijs Van Oevelen, r.david.murray
versions: +Python 2.7, Python 3.5, Python 3.6 -Python 3.4

___
Python tracker 

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



[issue25843] unexpected output using pythons ternary operator in combination with lambda

2015-12-11 Thread Ethan Furman

Changes by Ethan Furman :


--
title: 
unexpected-output-using-pythons-ternary-operator-in-combination-with-lambda -> 
unexpected output using pythons ternary operator in combination with lambda

___
Python tracker 

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



[issue25843] lambdas on the same line may incorrectly share code objects

2015-12-11 Thread R. David Murray

R. David Murray added the comment:

Thanks for posting the bug.  I added the aside because this is the third or 
fourth of these reference-only things I've seen in the past couple weeks and I 
finally figured out what bothered me about them.  We should put something about 
this in the devguide on bug reporting, but of course most people reporting bugs 
will for good reason not read that.  So, I just have to live with it :)

And yes, the reproducer reproduces the problem in all python versions currently 
under maintenance.

I've now changed the title to reflect the underlying bug.

--
title: unexpected output using pythons ternary operator in combination with 
lambda -> lambdas on the same line may incorrectly share code objects

___
Python tracker 

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



[issue25144] 3.5 Win install fails with "TARGETDIR"

2015-12-11 Thread Ivan Radic

Ivan Radic added the comment:

I got this with 3.5.1 installer on Windows 7. I solved it by running installer 
with elevated privileges. Installer for 2.7.11 was not affected.

--
nosy: +ivan.radic

___
Python tracker 

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



[issue25842] Installer does not set permissions correctly?

2015-12-11 Thread R. David Murray

R. David Murray added the comment:

For the record Zach's conclusion is that the conflict is a NppFTP issue, since 
api-ms-win-crt-runtime is part of the CRT and so any problem would not be 
unique to Python (or solvable by python).  The permissions issue is more 
obvious: that's how it is designed to work, and this is a documented change 
between python3.4 and python3.5, bringing it more in-line with how other 
Windows software works permissions-wise.

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



[issue25144] 3.5 Win install fails with "TARGETDIR"

2015-12-11 Thread Steve Dower

Steve Dower added the comment:

Good to hear there's a workaround.

I seem to recall an issue in the past with some security policies that disallow 
passing parameters to installers. This may be the cause here. When I get a 
chance to sit at a computer I'll see if I can track that down.

--

___
Python tracker 

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



[issue22012] struct.unpack('?', '\x02') returns (False,) on Mac OSX

2015-12-11 Thread Gregory P. Smith

Changes by Gregory P. Smith :


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



[issue22012] struct.unpack('?', '\x02') returns (False,) on Mac OSX

2015-12-11 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
components: +Library (Lib)

___
Python tracker 

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



[issue22012] struct.unpack('?', '\x02') returns (False,) on Mac OSX

2015-12-11 Thread Gregory P. Smith

Changes by Gregory P. Smith :


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



[issue25845] _ctypes\cfield.c identical subexpressions in Z_set

2015-12-11 Thread random832

random832 added the comment:

Sorry, my mistake, I was looking at z_set instead of Z_set. The earlier fix had 
left Z_set out for some reason. Anyway, just some historical interest anyway.

--

___
Python tracker 

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