Re: Python Worst Practices

2015-02-27 Thread Ethan Furman
On 02/27/2015 10:36 PM, Steven D'Aprano wrote:
 Dan Sommers wrote:
 
 On Sat, 28 Feb 2015 12:09:31 +1100, Steven D'Aprano wrote:

 There's no harm in calling a local variable id, if you don't use the
 built-in id() inside that function. That's one of the reasons why
 functions exist, so that the names you use inside a function are distinct
 from those outside.

 And thank goodness for that!  I've been writing Python code since 1997
 and version 1.5.something,¹ and I still do a double take when emacs
 colors all my ids that faint blue that means builtin.
 
 Although it is not helpful for people using screen-readers, and may be of
 limited use to the colour-blind, I am in favour of colourising built-ins so
 they stand out.

Sure, for the ones I use as built-ins.  But I went through the color file for 
vim and took out the built-ins I use
regularly as variables -- and 'id' was the first one to go.

--
~Ethan~



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


Re: Python Worst Practices

2015-02-27 Thread Dan Sommers
On Sat, 28 Feb 2015 12:09:31 +1100, Steven D'Aprano wrote:

 There's no harm in calling a local variable id, if you don't use the
 built-in id() inside that function. That's one of the reasons why functions
 exist, so that the names you use inside a function are distinct from those
 outside.

And thank goodness for that!  I've been writing Python code since 1997
and version 1.5.something,¹ and I still do a double take when emacs
colors all my ids that faint blue that means builtin.

I don't think I've ever used the builtin function id in a program.
Ever.  Not even once.  Honestly, what is a valid use case?  That said, I
do have boatloads of parameters and objects locally named id because
it's idiomatic (at least to me) and mnemonic (at least to me) and just
as meaningful.

¹ No, not continuously.  I have eaten and slept since then.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue23254] Document how to close the TCPServer listening socket

2015-02-27 Thread R. David Murray

R. David Murray added the comment:

In general documentation changes go in all maintained versions (ie: right now 
that would be 2.7, 3.4, and default/3.5).  The only exception, really, would be 
if the change didn't apply to one or more of the versions because of code 
differences.  (Note: I haven't reviewed the patch itself yet ;)

--
nosy: +r.david.murray
versions: +Python 2.7

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



[issue23512] The list of built-in functions is not alphabetical on https://docs.python.org/2/library/functions.html

2015-02-27 Thread Georg Brandl

Georg Brandl added the comment:

I agree with Edward. The table makes no distinction between the two group of 
builtins, so it is confusing why it would list them not in alphabetical order.

I wouldn't go so far as to call it disrespectful though :)

--
nosy: +georg.brandl

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



[issue23382] Maybe can not shutdown ThreadPoolExecutor when call the method of shutdown

2015-02-27 Thread miles

miles added the comment:

The attachment includes the patch file

--
keywords: +patch
nosy: +milesli
Added file: http://bugs.python.org/file38274/thread.py.patch

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



Re: Python Worst Practices

2015-02-27 Thread Tim Chase
On 2015-02-28 12:09, Steven D'Aprano wrote:
  * Make your language have a lot of keywords. Enough to make
  memorizing them ALL unlikely, requiring constant visits to your
  documentation   
 
 Is 33 a lot?
 
 py import keyword
 py keyword.kwlist  
 ['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 
 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally',
 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda',
 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while',
 'with', 'yield']

A quick google-and-tally for languages and their corresponding
number of keywords:

C: 33
C#: 77
C++: 86
Java: 50
Lua: 21
PHP: 67
Pascal: 54
Perl: 40
Pike: 37 (Just for you, ChrisA)
Python: 31 (2.x) or 33 (3.x)
Ruby: 40

So I can't say that Python's all that bad in comparison to most other
mainstream languages, with only the austere Lua beating out Python.

-tkc


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


[issue23138] cookiejar parses cookie value as int with empty name-value pair and Expires

2015-02-27 Thread Berker Peksag

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


--
nosy: +berker.peksag

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



Re: Python Worst Practices

2015-02-27 Thread Chris Angelico
On Sat, Feb 28, 2015 at 12:32 PM,  sohcahto...@gmail.com wrote:
 For example, I've seen someone create a Socket class, then created an 
 operator overload that allowed you to add a string to your socket to make 
 the socket send the string, with the result being a status code indicating 
 success or an error.


Why not left shift the socket by that string, the result being the
original socket? At least that has precedent...

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


Re: Python Worst Practices

2015-02-27 Thread sohcahtoa82
On Friday, February 27, 2015 at 5:09:49 PM UTC-8, Steven D'Aprano wrote:
 Travis Griggs wrote:
 
  If I were giving a talk at SPLASH (or some other suitable polyglot
  conference), I might do one called Language Design Worst Practices.
  
  One of my first slides might be titled:
  
  Abuse Common Tokens in Confusing Ways
  
  * Make your language have a lot of keywords. Enough to make memorizing
  them ALL unlikely, requiring constant visits to your documentation 
 
 Is 33 a lot?
 
 py import keyword
 py keyword.kwlist
 ['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 
 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 
 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 
 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']
 
 
  * Make sure said keywords are many of the obvious words programmers would
  use in their applications (map, object, bytes, dir, etc) 
 
 Luckily, Python doesn't make that mistake of making built-ins keywords. That
 would require making actual changes to the parser each time a new built-in
 function was added, as well as breaking people's existing code.
 
 Fortunately, Python has a much better system: a small set of keywords, very
 few of which would make useful variable names (else = 23), and a much
 larger set of regular names in a built-in namespace.
 
 
 py import builtins  # use __builtin__ in Python 2
 py sorted(vars(builtins).keys())
 ['ArithmeticError', 'AssertionError', ... 'type', 'vars', 'zip']
 
 
 There's 147 of the built-ins in Python 3.3, although a few of those aren't
 truly built-in, merely added at interpreter startup.
 
 The ability to shadow built-ins is not a bug, it is a feature. It's an
 amazingly powerful feature, and not particularly newbie-friendly, but
 *many* things are not easy for newbies to master or avoid abusing.
 
 - Code can override, or overload, built-ins, either at the level of 
   an entire module, or inside a particular function.
 
 - Modules can offer functions which clash with a built-in name.
   E.g. reprlib.repr, math.pow.
 
 - More importantly, modules can offer stable APIs with no fear that 
   the introduction of a new built-in function will require them to 
   change their function's name.
 
 - Which is a special case of a more general benefit, the introduction 
   of a new built-in name does *not* break existing code that already 
   uses that name.
 
 
 Newbies misuse this feature because they still have a wishful-thinking
 approach to programming. One example of wishful-thinking is the common
 newbie mistake of wondering why their loop variable never changes:
 
 # Toss a coin until you get Tails.
 x = random.random()
 while x  0.5:
 print Heads
 print Tails
 
 Isn't it obvious that I want x to get a new random number every time through
 the loop? I wish the computer understood me so I didn't need to write all
 the steps out.
 
 
 Likewise:
 
 int = 23
 n = int(42)
 
 Isn't it obvious that the second use of int has to be the built-in function?
 I wish that the computer would understand from context which one I mean.
 
 Other newbie stylistic mistakes which can increase the chance of shadowing
 errors include:
 
 * Too many overly generic variable names like int and str.
 
 * Insufficient use of functions and too much top-level code. When they
   shadow a built-in, they shadow it everywhere.
 
 * Excessively large functions that do too much. By the time they reach 
   the end of their 300 line function, they have forgotten that they
   have already used list for a variable name.
 
 
 However, even experienced developers can make this mistake too. Generally
 speaking, it's trivially easy to recover from. Although if you're doing it
 *regularly* that might be a hint of deeper problems, e.g. poor variable
 naming skills, too much top-level code.
 
 There's no harm in calling a local variable id, if you don't use the
 built-in id() inside that function. That's one of the reasons why functions
 exist, so that the names you use inside a function are distinct from those
 outside.
 
 
 
  * Design your syntax so that you can't disambiguate them contextually
  between bind and reference 
 
 Do you have an example of where Python cannot distinguish between a binding
 operation and a reference?
 
 
  * Be sure to use it in a late bound language where no warnings will be
  provided about the mistake you're making at authorship time, deferring the
  educational experience to sundry run times
 
 Python raises a SyntaxError at compile time, not run time, if you try to
 bind to a keyword:
 
 py global = 23
   File stdin, line 1
 global = 23
^
 SyntaxError: invalid syntax
 
 
 
 
 -- 
 Steven

Very well-said!

Just because a feature (In this case, shadowing built-in functions) can be 
abused or cause problems doesn't mean it's a bad feature.

It reminds me of the people that rip on C++'s operator overloading because some 
people write bad code and 

[issue22853] Multiprocessing.Queue._feed deadlocks on import

2015-02-27 Thread Davin Potts

Davin Potts added the comment:

Attaching a patch for 2.7 that applies Florian's fix and provides a test for it 
as well.

Although the issue is not triggered on 3.4 or default (3.5), there is the 
potential for regression there -- attaching a single patch that works for both 
3.4 and 3.5 to provide a regression test (only a test, nothing to fix).

These patches have been tested on OS X 10.10 and Ubuntu 12.04.5 64-bit for each 
of 2.7, 3.4, and default (3.5).

--
keywords: +patch
stage:  - patch review
Added file: 
http://bugs.python.org/file38272/issue_22853_fix_and_test_import_lock_in_queue_py27.patch

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



[issue22853] Multiprocessing.Queue._feed deadlocks on import

2015-02-27 Thread Davin Potts

Changes by Davin Potts pyt...@discontinuity.net:


Added file: 
http://bugs.python.org/file38273/issue_22853_only_test_import_lock_in_queue_py34_and_py35.patch

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



Re: Python Worst Practices

2015-02-27 Thread Steven D'Aprano
Dan Sommers wrote:

 On Sat, 28 Feb 2015 12:09:31 +1100, Steven D'Aprano wrote:
 
 There's no harm in calling a local variable id, if you don't use the
 built-in id() inside that function. That's one of the reasons why
 functions exist, so that the names you use inside a function are distinct
 from those outside.
 
 And thank goodness for that!  I've been writing Python code since 1997
 and version 1.5.something,¹ and I still do a double take when emacs
 colors all my ids that faint blue that means builtin.

Although it is not helpful for people using screen-readers, and may be of
limited use to the colour-blind, I am in favour of colourising built-ins so
they stand out.

On the other hand, I recall seeing an editor which rejected the idea of
colour-coding built-ins, keywords etc., instead it coloured your own
variables. So given:

spam = 23
eggs += cheese*len(sausage)


spam, eggs, cheese and sausage would be different colours. The idea being,
when scanning a large code base, all the places that use a specific
variable would stand out (just look for the dark green word).



 I don't think I've ever used the builtin function id in a program.
 Ever.  Not even once.  Honestly, what is a valid use case? 

Here's one. I think it's the only time I have seen id() used apart from
interactive experimentation:

https://code.activestate.com/recipes/577504



 That said, I 
 do have boatloads of parameters and objects locally named id because
 it's idiomatic (at least to me) and mnemonic (at least to me) and just
 as meaningful.
 
 ¹ No, not continuously.  I have eaten and slept since then.

Slacker!



-- 
Steven

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


Re: Python Worst Practices

2015-02-27 Thread Dan Sommers
On Sat, 28 Feb 2015 17:36:44 +1100, Steven D'Aprano wrote:

 Dan Sommers wrote:

 And thank goodness for that!  I've been writing Python code since
 1997 and version 1.5.something,¹ and I still do a double take when
 emacs colors all my ids that faint blue that means builtin.

 Although it is not helpful for people using screen-readers, and may be
 of limited use to the colour-blind, I am in favour of colourising
 built-ins so they stand out.

Now if only emacs were clever enough *not* to colorize id when it's
one of my names and not the builtin...  ;-)

 On the other hand, I recall seeing an editor which rejected the idea
 of colour-coding built-ins, keywords etc., instead it coloured your
 own variables. So given:
 
 spam = 23
 eggs += cheese*len(sausage)
 
 spam, eggs, cheese and sausage would be different colours. The idea
 being, when scanning a large code base, all the places that use a
 specific variable would stand out (just look for the dark green
 word).

As a mostly visual person, I can see (pun intented) the logic and the
value in that.  I wonder how many variables could be easily
distinguished, though, before running out of easily distinguishable
colors.  Then again, a clever underlying algorithm might choose colors
based on *dissimilarity* of the identifiers, so that i and j would
be very diffent colors, but spam and throat_warbler_mangrove could
be the same color because they look so different anyway.

 I don't think I've ever used the builtin function id in a program.
 Ever.  Not even once.  Honestly, what is a valid use case? 
 
 Here's one. I think it's the only time I have seen id() used apart from
 interactive experimentation:
 
 https://code.activestate.com/recipes/577504

Hah.  Very nice.  That sort of thing is probably useful for detecting
self-referential objects, too (e.g., to prevent infinite output for a
circular list).

 ¹ No, not continuously.  I have eaten and slept since then.
 
 Slacker!

Sorry.  I'll make up the hours later, I promise!
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue23525] isbuiltin, isroutine, etc.

2015-02-27 Thread Berker Peksag

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


--
nosy: +yselivanov

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



[issue23544] IDLE hangs when selecting Stack View with debug active

2015-02-27 Thread Andrew Harrington

Andrew Harrington added the comment:

I was using this without looking at documentation, as a newbies would.
Graying and disabling until after an exception makes sense, but even the
menu item name is misleading:  any time the program is running there is a
stack that you might want to view.   Better labels in the menu than Stack
Viewer  would be stack trace or stack after exception (maybe too long)
or stack after crash.

On Fri, Feb 27, 2015 at 4:49 PM, Terry J. Reedy rep...@bugs.python.org
wrote:


 Terry J. Reedy added the comment:

 Verified on Windows whenever the debugger is active, meaning that a
 program is running.  (Debug On just means that it will become active when
 code is run.) No stepping is needed; debugger can be pointing to the inital
 docstring line.  For me also, Idle stops and has to be externally closed,
 as opposed to totally disappearing by itself.

 The doc for Stack Viewer says Show the stack traceback of the last
 exception.   Example:

  1/0
 Traceback (most recent call last):
   File pyshell#0, line 1, in module
 1/0
 ZeroDivisionError: division by zero
 

 Selecting Stack Viewer pops up a viewer box.  This still works after
 [DEBUG ON]
 
 turns the debugger on but inactive.  Entering anything at the prompt
 disables viewing the 'last' exception, contrary to my understanding of the
 short doc.  So I might add '(if no other code has been run)' to the doc.

 Selecting Stack Viewer while a program is running (sleeping in this next
 example)

  import time; time.sleep(10); 1/0

 brings up a box after the exception is printed.  So 'last exception' can
 actually be 'next exception'.  But in this case, the user process is left
 'running' and no ' ' prompt appears, and one must Shell - Restart to do
 anything further.  This is not good behavior.

 When one selects Debug - Debugger while user code is running, Idle brings
 up a message box Don't debug now: You can only toggle the debugger when
 idle.  I think Debug - Stack Viewer should be similarly disabled, though
 perhaps graying out the menu entry might be better. It could also be grayed
 out when there the 'last exception' cannot be viewed because other code has
 been run.  Stack Viewer should definitely be ignored when the debugger is
 active, and I see no need to let people select it *before* an exception
 occurs and the prompt is displayed.  The next menu entry, Auto-open Stack
 Viewer, takes care of opening upon future exceptions.

 --
 stage:  - needs patch
 title: IDLE hangs with debug on and stack viewer - IDLE hangs when
 selecting Stack View with debug active

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue23544
 ___


-- 
Dr. Andrew N. Harrington
  Computer Science Department
  Graduate Program Director g...@cs.luc.edu
  Loyola University Chicago
  529 Lewis Tower, 111 E. Pearson St. (Downtown)
  104 Loyola Hall, 1032 W. Sheridan Road (Rogers Park)
http://www.cs.luc.edu/~anh
Phone: 312-915-7982
Fax:312-915-7998
ahar...@luc.edu (as professor, not gpd role)

--

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



[issue23530] os and multiprocessing.cpu_count do not respect cpuset/affinity

2015-02-27 Thread eryksun

eryksun added the comment:

 Well, we already expose CPU affinity:
 
  import os
  os.sched_getaffinity(0)
 {0}

os.sched_getaffinity only exists on some POSIX systems, such as Linux. For 
Windows, here's a ctypes version of sched_getaffinity and sched_setaffinity:

import sys
from ctypes import *
from ctypes.wintypes import *

__all__ = ['sched_getaffinity', 'sched_setaffinity']

kernel32 = WinDLL('kernel32')

DWORD_PTR = WPARAM
PDWORD_PTR = POINTER(DWORD_PTR)

GetCurrentProcess = kernel32.GetCurrentProcess
GetCurrentProcess.restype = HANDLE

OpenProcess = kernel32.OpenProcess
OpenProcess.restype = HANDLE
OpenProcess.argtypes = (DWORD, # dwDesiredAccess,_In_
BOOL,  # bInheritHandle,_In_
DWORD) # dwProcessId, _In_

GetProcessAffinityMask = kernel32.GetProcessAffinityMask
GetProcessAffinityMask.argtypes = (
HANDLE, # hProcess, _In_
PDWORD_PTR, # lpProcessAffinityMask, _Out_
PDWORD_PTR) # lpSystemAffinityMask, _Out_

SetProcessAffinityMask = kernel32.SetProcessAffinityMask
SetProcessAffinityMask.argtypes = (
  HANDLE,# hProcess, _In_
  DWORD_PTR) # dwProcessAffinityMask, _In_

PROCESS_SET_INFORMATION = 0x0200
PROCESS_QUERY_INFORMATION = 0x0400
PROCESS_QUERY_LIMITED_INFORMATION = 0x1000
if sys.getwindowsversion().major  6:
PROCESS_QUERY_LIMITED_INFORMATION = PROCESS_QUERY_INFORMATION

def sched_getaffinity(pid):
if pid == 0:
hProcess = GetCurrentProcess()
else:
hProcess = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION,
   False, pid)
if not hProcess:
raise WinError()
lpProcessAffinityMask = DWORD_PTR()
lpSystemAffinityMask = DWORD_PTR()
if not GetProcessAffinityMask(hProcess, 
  byref(lpProcessAffinityMask),
  byref(lpSystemAffinityMask)):
raise WinError()
mask = lpProcessAffinityMask.value
return {c for c in range(sizeof(DWORD_PTR) * 8) if (1  c)  mask}

def sched_setaffinity(pid, mask):
if pid == 0:
hProcess = GetCurrentProcess()
else:
hProcess = OpenProcess(PROCESS_SET_INFORMATION,
   False, pid)
if not hProcess:
raise WinError()
bitmask = 0
for cpu in mask:
if not isinstance(cpu, int):
raise TypeError('expected an iterator of ints, but '
'iterator yielded %r' % type(cpu))
if cpu  0:
raise ValueError('negative CPU number')
if cpu = sizeof(DWORD_PTR) * 8:
raise ValueError('CPU number too large')
bitmask |= 1  cpu
if not SetProcessAffinityMask(hProcess, bitmask):
raise WinError()

--
nosy: +eryksun

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



[issue23535] os.path.join() wrong concatenation of C: on Windows

2015-02-27 Thread Ben Hoyt

Ben Hoyt added the comment:

Sorry, but this is operating as designed and documented. See the docs here: 
https://docs.python.org/3.4/library/os.path.html#os.path.join

On Windows ... since there is a current directory for each drive, 
os.path.join(c:, foo) represents a path relative to the current directory 
on drive C: (c:foo), not c:\foo.

So I think this issue should be closed as not a bug.

--
nosy: +benhoyt

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



[issue23332] datetime.isoformat() - explicitly mark UTC string as such

2015-02-27 Thread mirabilos

mirabilos added the comment:

Hm, RFCs are just RFCs and not standards, they can recommend whatever they 
want, and they can (and do) contradict each other.

I’ve seen things (mostly related to eMail and PIM synchronisation) that require 
‘Z’ for UTC proper.

Additionally, +00:00 can be UTC, but it can also be British Winter Time, or DST 
of UTC-1. ‘Z’ is clear.

--

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



Re: Newbie question about text encoding

2015-02-27 Thread Dave Angel

On 02/27/2015 06:54 AM, Steven D'Aprano wrote:

Dave Angel wrote:


On 02/27/2015 12:58 AM, Steven D'Aprano wrote:

Dave Angel wrote:


(Although I believe Seymour Cray was quoted as saying that virtual
memory is a crock, because you can't fake what you ain't got.)


If I recall correctly, disk access is about 1 times slower than RAM,
so virtual memory is *at least* that much slower than real memory.



It's so much more complicated than that, that I hardly know where to
start.


[snip technical details]

As interesting as they were, none of those details will make swap faster,
hence my comment that virtual memory is *at least* 1 times slower than
RAM.



The term virtual memory is used for many aspects of the modern memory 
architecture.  But I presume you're using it in the sense of running in 
a swapfile as opposed to running in physical RAM.


Yes, a page fault takes on the order of 10,000 times as long as an 
access to a location in L1 cache.  I suspect it's a lot smaller though 
if the swapfile is on an SSD drive.  The first byte is that slow.


But once the fault is resolved, the nearby bytes are in physical memory, 
and some of them are in L3, L2, and L1.  So you're not running in the 
swapfile any more.  And even when you run off the end of the page, 
fetching the sequentially adjacent page from a hard disk is much faster. 
 And if the disk has well designed buffering, faster yet.  The OS tries 
pretty hard to keep the swapfile unfragmented.


The trick is to minimize the number of page faults, especially to random 
locations.  If you're getting lots of them, it's called thrashing.


There are tools to help with that.  To minimize page faults on code, 
linking with a good working-set-tuner can help, though I don't hear of 
people bothering these days.  To minimize page faults on data, choosing 
one's algorithm carefully can help.  For example, in scanning through a 
typical matrix, row order might be adjacent locations, while column 
order might be scattered.


Not really much different than reading a text file.  If you can arrange 
to process it a line at a time, rather than reading the whole file into 
memory, you generally minimize your round-trips to disk.  And if you 
need to randomly access it, it's quite likely more efficient to memory 
map it, in which case it temporarily becomes part of the swapfile system.


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


[issue23332] datetime.isoformat() - explicitly mark UTC string as such

2015-02-27 Thread Mark Lawrence

Mark Lawrence added the comment:

I'm a British citizen and I've never once heard the term British Winter Time, 
so where does it come from?

--
nosy: +BreamoreBoy

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



[issue23471] 404 Not Found when downloading Python 3.4.3rc1 Documentation

2015-02-27 Thread Larry Hastings

Larry Hastings added the comment:

This is part of the release process.  3.4.3 was fine last I checked, so perhaps 
some wonderful automated process broke it for me.  3.5, I think I simply didn't 
upload the docs properly.

Anyway, this is my responsibility as RM for 3.4 and 3.5, so in the future if I 
slip up again please assign the bug to me.

--
assignee: docs@python - larry

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



[issue23332] datetime.isoformat() - explicitly mark UTC string as such

2015-02-27 Thread R. David Murray

R. David Murray added the comment:

mirabilos was referring to Alexander's reference to RFCs that advise against 
using 'Z'.  RFC are standards once they become formally accepted as such, and 
often they become de-facto standards before formal acceptance.  

Given that the method is supposedly conforming to a specific standard, it ought 
to do so...but in addition to the ISO standard there are other de-jure and 
de-facto standards and deviations to contend with.  Concrete examples are 
required for decision, I think, if the base standard is ambiguous.  It may be 
that a new method or a flag controlling the behavior needs to be introduced in 
order to satisfy specific wide-spread use cases, but those use cases need to be 
enough motivation to support such an enhancement.  By my reading, so far there 
have been no such concrete wide spread use cases brought forward to motivate 
any change other than deprecating utcnow.  ('now' must return naive datetimes 
to preserve backward compatibility.  If you don't want to use naive datetimes, 
make sure you don't...the datetime module was originally directly supported 
only naive datetimes (timezone is recent), so some care is needed.)

--

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-27 Thread Stefan Krah

Stefan Krah added the comment:

 c) constantly working at making the latest and greatest Android-friendly

But that is precisely what Android support, should it be added, means:
It does take constant work (and build slaves) to support a platform.


Unrelatedly, regarding the localeconv changes: 

I cannot find any bugreport for localeconv at

  https://code.google.com/p/android/issues/list .


Before we add workarounds to Python, it would be nice to have
at least a record that the Android developers actually *did*
refuse to add a simple struct lconv (trivial for en_US!).

How about opening an Android issue?

--
nosy: +skrah

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



[issue21944] Allow copying of CodecInfo objects

2015-02-27 Thread Mark Lawrence

Mark Lawrence added the comment:

The change to codecs.py seems simple enough but would we usually use plain 
asserts in test code?

--
nosy: +BreamoreBoy

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



[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-02-27 Thread Larry Hastings

Larry Hastings added the comment:

I turned in my Windows developer badge in 2007.  Can I recuse myself, 
pretty-please?

How about Tim Golden or Zach Ware?  Who I notice are conveniently already added 
to the nosy list!

--

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



[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-02-27 Thread STINNER Victor

STINNER Victor added the comment:

 I considered that, but then we'll be disabling the handler for calls into 
 external modules (assuming whatever pyd layer exists is doing its job 
 correctly), which is exactly where the error is most relevant.

Hum ok. So I try to rephrase the issue.

When Python is compiled in debug mode, the Windows C runtime (CRT) kills the 
process when a fault is detected. A fault can be an invalid memory access, a C 
assertion (assert(...);) which failed, etc. The problem is that the Python 
test suite explicitly call functions with invalid parameters to check that 
Python handles correctly errors. The problem is that unit tests expect that 
Python raises an exception, while the CRT kills the process by default.

You propose to modify the behaviour of the CRT of the current thread in the os 
module to raise a regular exception, instead of killing the process.

I agree with your suggestion :-)

We already use _PyVerify_fd() to raises an OSError(EBADF) exception, instead of 
killing the process when functions like os.close() are called with an invalid 
file descriptor.

We cannot disable globally CRT checks because users want them (#3545 and #4804) 
to validate their own C libraries. So CRT checks should only be disabled 
temporary when a Python function of the stdlib is called. We expect that 
calling a third party function kills the process if it is called with an 
invalid parameter. It's the purpose of the debug build.

(I didn't review the patch yet.)

Note: kill the process probably means that Windows opens a popup to ask to 
debug the application when a debugger is installed, instead of killing silently 
the application.

--

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



[issue23526] Silence resource warnings in test_httplib

2015-02-27 Thread STINNER Victor

STINNER Victor added the comment:

I applied your patch. Thanks Alex Shkop! (FYI I also added your name to 
Misc/ACKS.)

--

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



Re: Newbie question about text encoding

2015-02-27 Thread alister
On Sat, 28 Feb 2015 03:12:16 +1100, Chris Angelico wrote:

 On Sat, Feb 28, 2015 at 3:00 AM, alister
 alister.nospam.w...@ntlworld.com wrote:
 I think there is a case for bringing back the overlay file, or at least
 loading larger programs in sections only loading the routines as they
 are required could speed up the start time of many large applications.
 examples libre office, I rarely need the mail merge function, the word
 count and may other features that could be added into the running
 application on demand rather than all at once.
 
 Downside of that is twofold: firstly the complexity that I already
 mentioned, and secondly you pay the startup cost on first usage. So you
 might get into the program a bit faster, but as soon as you go to any
 feature you didn't already hit this session, the program pauses for a
 bit and loads it. Sometimes startup cost is the best time to do this
 sort of thing.
 
If the modules are small enough this may not be noticeable but yes I do 
accept there may be delays on first usage.

As to the complexity it has been my observation that as the memory 
footprint available to programmers has increase they have become less  
less skilled at writing code.

of course my time as a professional programmer was over 20 years ago on 8 
bit micro controllers with 8k of ROM (eventually, original I only had 2k 
to play with)  128 Bytes (yes bytes!) of RAM so I am very out of date.

I now play with python because it is so much less demanding of me which 
probably makes me just a guilty :-)

 Of course, there is an easy way to implement exactly what you're asking
 for: use separate programs for everything, instead of expecting a
 megantic office suite[1] to do everything for you. Just get yourself a
 nice simple text editor, then invoke other programs - maybe from a
 terminal, or maybe from within the editor - to do the rest of the work.
 A simple disk cache will mean that previously-used programs start up
 quickly.
Libre office was sighted as just one example
Video editing suites are another that could be used as an example 
(perhaps more so, does the rendering engine need to be loaded until you 
start generating the output? a small delay here would be insignificant)
 
 ChrisA
 
 [1] It's slightly less bloated than the gigantic office suite sold by a
 top-end software company.





-- 
You don't sew with a fork, so I see no reason to eat with knitting 
needles.
-- Miss Piggy, on eating Chinese Food
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue23537] BaseSubprocessTransport includes two unused methods

2015-02-27 Thread STINNER Victor

STINNER Victor added the comment:

Yeah, they are completly useless. Thanks for the report Martin.

--
resolution:  - fixed
status: open - closed

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



[issue22853] Multiprocessing.Queue._feed deadlocks on import

2015-02-27 Thread Mark Lawrence

Mark Lawrence added the comment:

@Davin I believe that you're interested in multiprocessing issues.

--
nosy: +BreamoreBoy, davin

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



[issue22834] Unexpected FileNotFoundError when current directory is removed

2015-02-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 38c503c2c066 by Brett Cannon in branch 'default':
Issue #22834: Drop a redundant comment and use errno instead of an
https://hg.python.org/cpython/rev/38c503c2c066

--

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-27 Thread Ryan Gonzalez

Ryan Gonzalez added the comment:

I'll try to do as much as I can to get this through. Once I reinstall the NDK 
(I accidently wiped my hard drive with a bad dd command recently), I'll test 
this on my old Android phone that still runs 2.3 and would be very happy if 
someone else can test it something newer (my laptop doesn't seem to like the 
Android emulator). I'll also try to do this against the development branch or 
tip or head or whatever it's called.

I'd be very happy if someone could contribute a build slave, because I can't.

--

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



Re: Newbie question about text encoding

2015-02-27 Thread Chris Angelico
On Sat, Feb 28, 2015 at 3:45 AM, alister
alister.nospam.w...@ntlworld.com wrote:
 On Sat, 28 Feb 2015 03:12:16 +1100, Chris Angelico wrote:

 On Sat, Feb 28, 2015 at 3:00 AM, alister
 alister.nospam.w...@ntlworld.com wrote:
 I think there is a case for bringing back the overlay file, or at least
 loading larger programs in sections only loading the routines as they
 are required could speed up the start time of many large applications.
 examples libre office, I rarely need the mail merge function, the word
 count and may other features that could be added into the running
 application on demand rather than all at once.

 Downside of that is twofold: firstly the complexity that I already
 mentioned, and secondly you pay the startup cost on first usage. So you
 might get into the program a bit faster, but as soon as you go to any
 feature you didn't already hit this session, the program pauses for a
 bit and loads it. Sometimes startup cost is the best time to do this
 sort of thing.

 If the modules are small enough this may not be noticeable but yes I do
 accept there may be delays on first usage.

 As to the complexity it has been my observation that as the memory
 footprint available to programmers has increase they have become less 
 less skilled at writing code.

Perhaps, but on the other hand, the skill of squeezing code into less
memory is being replaced by other skills. We can write code that takes
the simple/dumb approach, let it use an entire megabyte of memory, and
not care about the cost... and we can write that in an hour, instead
of spending a week fiddling with it. Reducing the development cycle
time means we can add all sorts of cool features to a program, all
while the original end user is still excited about it. (Of course, a
comparison between today's World Wide Web and that of the 1990s
suggests that these cool features aren't necessarily beneficial, but
still, we have the option of foregoing austerity.)

 Video editing suites are another that could be used as an example
 (perhaps more so, does the rendering engine need to be loaded until you
 start generating the output? a small delay here would be insignificant)

Hmm, I'm not sure that's actually a big deal, because your *data* will
dwarf the code. I can fire up sox and avconv, both fairly large
programs, and their code will all sit comfortably in memory; but then
they get to work on my data, and suddenly my hard disk is chewing
through 91GB of content. Breaking up avconv into a dozen pieces
wouldn't make a dent in 91GB.

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


[issue23138] cookiejar parses cookie value as int with empty name-value pair and Expires

2015-02-27 Thread Demian Brecht

Demian Brecht added the comment:

Attached is a fix that ignores the entire invalid cookie as defined in RFC 
6265, Section 5.2. I'm also attaching patches for maintenance branches as it's 
a valid bug (NAME=VALUE pairs are required across all RFCs), although it would 
break backwards compatibility if the user was expecting invalid behaviour.

--
keywords: +easy, patch
stage:  - patch review
Added file: http://bugs.python.org/file38260/issue23138_tip.patch

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



[issue23138] cookiejar parses cookie value as int with empty name-value pair and Expires

2015-02-27 Thread Demian Brecht

Changes by Demian Brecht demianbre...@gmail.com:


Added file: http://bugs.python.org/file38262/issue23138_27.patch

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



[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-02-27 Thread Steve Dower

Steve Dower added the comment:

That's a pretty good summation, though it misses two points.

1. _PyVerify_fd no longer compiles.

2. The process will terminate in both release builds and debug builds. (In 
debug builds you also get a dialog letting you attach a debugger, unless those 
are suppressed as in #23314 and the test suite.)

--

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



[issue23526] Silence resource warnings in test_httplib

2015-02-27 Thread Alex Shkop

Alex Shkop added the comment:

Thanks, great to hear.
I'm glad to help)

--

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



[issue23138] cookiejar parses cookie value as int with empty name-value pair and Expires

2015-02-27 Thread Demian Brecht

Changes by Demian Brecht demianbre...@gmail.com:


Added file: http://bugs.python.org/file38261/issue23138_34.patch

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



[issue23537] BaseSubprocessTransport includes two unused methods

2015-02-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0b390b5a6729 by Victor Stinner in branch '3.4':
Issue #23537: Remove 2 unused private methods of asyncio.BaseSubprocessTransport
https://hg.python.org/cpython/rev/0b390b5a6729

--
nosy: +python-dev

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



[issue22834] Unexpected FileNotFoundError when current directory is removed

2015-02-27 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for catches the mistakes, guys!

--
status: open - closed

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



[issue1322] Deprecate platform.dist() and platform.linux_distribution() functions

2015-02-27 Thread Andy Maier

Andy Maier added the comment:

Do we really think that a package on pypi solves the problem better? The 
discussion only shows that it is more likely we end up with multiple different 
packages on pypi, instead of one that is commonly agreed.

I agree it is tough to get to an agreed upon approach, but having this in the 
Python base at least ensures that it is the one approach everybody uses.

The /etc/os-release format seems to be used more often now, so I'm wondering 
why we cannot come up with a reasonable approach that is backwards compatible, 
supports /etc/os-release, and (if still needed), also /etc/lsb-release and the 
lsb_release script.

Again: If we ever want to end up with just one package on pypi, that very 
discussion needs to happen.

It seems to me that if the approach should be compatible, then we cannot use 
the new generic files (lsb* and os-release) first. The currently implemented 
approach needs to be used first. Then the new generic files.

--

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



[issue22890] StringIO.StringIO pickled in 2.7 is not unpickleable on 3.x

2015-02-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The issue is about StringIO.StringIO, not io.StringIO.

--

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-27 Thread Ethan Furman

Ethan Furman added the comment:

I will work on the build slave (note: it will definitely be /work/ so if anyone 
has the resource and know-how to just do it, I will not be offended ;) .

--

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



Re: Newbie question about text encoding

2015-02-27 Thread Grant Edwards
On 2015-02-27, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:
 Dave Angel wrote:

 On 02/27/2015 12:58 AM, Steven D'Aprano wrote:
 Dave Angel wrote:

 (Although I believe Seymour Cray was quoted as saying that virtual
 memory is a crock, because you can't fake what you ain't got.)

 If I recall correctly, disk access is about 1 times slower than RAM,
 so virtual memory is *at least* that much slower than real memory.

 
 It's so much more complicated than that, that I hardly know where to
 start.

 [snip technical details]

 As interesting as they were, none of those details will make swap faster,
 hence my comment that virtual memory is *at least* 1 times slower than
 RAM.

Nonsense.  On all of my machines, virtual memory _is_ RAM almost all
of the time.  I don't do the type of things that force the usage of
swap.

-- 
Grant Edwards   grant.b.edwardsYow! ... I want FORTY-TWO
  at   TRYNEL FLOATATION SYSTEMS
  gmail.cominstalled within SIX AND A
   HALF HOURS!!!
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-02-27 Thread Steve Dower

Steve Dower added the comment:

I considered that, but then we'll be disabling the handler for calls into 
external modules (assuming whatever pyd layer exists is doing its job 
correctly), which is exactly where the error is most relevant.

--

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-27 Thread Ethan Furman

Ethan Furman added the comment:

Cyd, if you want to be a CPython/Android resource that's great.

If you don't have time for it, I completely understand.  What I'm hoping for is 
to take your initial efforts and build from there, as there are others who can 
take what you've started and run with it.

Make no mistake, your taking the time to share what you've done is greatly 
appreciated.

--

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



[issue23530] os and multiprocessing.cpu_count do not respect cpuset/affinity

2015-02-27 Thread Davin Potts

Davin Potts added the comment:

Adding an option does sound like a better possibility.  Still, when I start 
looking through the examples that psutil provides, it reminds me how this is 
but one small piece of a much larger picture which psutil has done a nice, 
focused job of working to address.

If the patch you create were to depend upon gnu coreutils, I do not think it 
can be accepted for licensing reasons.  Interestingly psutil does not appear to 
depend upon that library.

Regarding the docs, what text would you propose instead of what's currently 
there for describing cpu_count?

--

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



[issue23531] SSL operations cause entire process to hang

2015-02-27 Thread johnkw

johnkw added the comment:

Not sure what you mean. That is a standalone example. It creates the local 
HTTP server, which is merely a dummy listen socket. The whole point is just 
to have something that does a slow I/O operation, and simply not responding is 
sufficient for that to reproduce the bug.

Also, I would add that on further investigation this occurs on cygwin, but not 
on Linux.

--

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



[issue23471] 404 Not Found when downloading Python 3.4.3rc1 Documentation

2015-02-27 Thread Larry Hastings

Larry Hastings added the comment:

I think I've got them all working now.  Please reopen if you discover new 
breakage.  (Or old breakage I guess if I didn't actually fix it...!)

--
resolution:  - fixed
stage:  - resolved
status: open - closed

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



[issue23531] SSL operations cause entire process to hang

2015-02-27 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 It creates the local HTTP server, which is merely a dummy listen socket

Sorry, I hadn't noticed. Still, the example shouldn't rely on the third party 
requests library.

 Also, I would add that on further investigation this occurs on cygwin, but 
 not on Linux.

Cygwin is not a supported platform at all. Can you reproduce with an official 
Windows build?

--

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-27 Thread Cyd Haselton

Cyd Haselton added the comment:

Stefan,
I wouldn't know if they're reported to the same bug tracker...it's possible 
they aren't.  Additionally it's possible that the lack of locale support in 
libc isn't considered a bug.

Ethan,
Given Victor's recommendation of using the dev branch and the fact that my mods 
were made to a stable download (3.4.2), what would be the recommended way to go 
about getting my efforts into github so that they can be built upon?  Should I 
start working with the fork I've already made of cpython (with 3.4.2 as the 
default branch) or is there a different method I should use?

--

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



[issue23538] New Windows installer in 3.5.0a1 breaks compatibility with Wine

2015-02-27 Thread Link Mauve

New submission from Link Mauve:

The previous msi installer was working fine with `wine msiexec /i python*.msi`, 
but the new exe-based one fails with an unreadable error in latest wine.

--
components: Windows
messages: 236802
nosy: Link Mauve, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: New Windows installer in 3.5.0a1 breaks compatibility with Wine
type: behavior
versions: Python 3.5

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



[issue23539] Content-length not set for HTTP methods expecting body when body is None

2015-02-27 Thread Demian Brecht

New submission from Demian Brecht:

#14721 solved setting the Content-Length header for 0-length bodies. However, 
it doesn't account for cases where body is None (reported by James Rutherford 
here: http://bugs.python.org/issue14721#msg236600).

One method of solving this might be something like this:

_METHODS_EXPECTING_BODIES = {'OPTIONS', 'POST', 'PUT', 'PATCH'}
if method.upper() in _METHODS_EXPECTING_BODIES and \
'content-length' not in header_names:
self._set_content_length(body)

(_set_content_length would have to be updated in order to allow for None)

This ensures that Content-Length will not be set for methods not expecting a 
body.

RFC 7230, Section 3.3.2:

   A user agent SHOULD NOT send a Content-Length header field when the
   request message does not contain a payload body and the method 
   semantics do not anticipate such a body.

--
components: Library (Lib)
messages: 236803
nosy: demian.brecht
priority: normal
severity: normal
stage: needs patch
status: open
title: Content-length not set for HTTP methods expecting body when body is None
type: behavior
versions: Python 3.5

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



[issue23530] os and multiprocessing.cpu_count do not respect cpuset/affinity

2015-02-27 Thread Julian Taylor

Julian Taylor added the comment:

certainly for anything that needs good control over affinity psutils is the 
best choice, but I'm not arguing to implement full process control in python. I 
only want python to provide the number of cores one can work on to make best 
use of the available resources.

If you code search python files for cpu_count you find on github 18000 uses, 
randomly sampling a few every single one was to determine the number of cpus to 
start worker jobs to get best performance. Every one of these will 
oversubscribe a host that restricts the cpus a process can use. This is an 
issue especially for the increasingly popular use of containers instead of full 
virtual machines.

as a documentation update I would like to have a note saying that this number 
is the number of (online) cpus in the system may not be the number of of cpus 
the process can actually use. Maybe with a link to 
len(psutils.Process.get_affinity()) as a reference on how to obtain that number.

there would be no dependence on coreutils, I just mentioned it as you can look 
up the OS api you need to use to get the number there (e.g. sched_getaffinity). 
It is trivial API use and should not be a licensing issue, one could also look 
at the code from psutil which most likely looks very similar.

--

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



[issue22890] StringIO.StringIO pickled in 2.7 is not unpickleable on 3.x

2015-02-27 Thread Mark Lawrence

Mark Lawrence added the comment:

Seems fine on Windows 8.1

c:\Users\Mark\Documents\MyPythonc:\cpython\PCbuild\amd64\python.exe
Python 3.5.0a1+ (default:344d57c521b9+, Feb 27 2015, 13:39:56) [MSC v.1800 64 
bit (AMD64)] on win32
Type help, copyright, credits or license for more information.
 import pickle, io
 pickle.dumps(io.StringIO('abc'), 2)
b'\x80\x02c_io\nStringIO\nq\x00)\x81q\x01(X\x03\x00\x00\x00abcq\x02X\x01\x00\x00\x00\nq\x03K\x00Ntq\x04b.'
 pickle.loads(b'\x80\x02c_io\nStringIO\nq\x00)\x81q\x01(X\x03\x00\x00\x00abcq\x02X\x01\x00\x00\x00\nq\x03K\x00Ntq\x04b.')
_io.StringIO object at 0x004C6E604288


--
nosy: +BreamoreBoy

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



[issue23526] Silence resource warnings in test_httplib

2015-02-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 056d71d7bb28 by Victor Stinner in branch '3.4':
Issue #23526: Fix ResourceWarning in test_httplib. Patch written by Alex Shkop.
https://hg.python.org/cpython/rev/056d71d7bb28

--
nosy: +python-dev

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



[issue1322] Deprecate platform.dist() and platform.linux_distribution() functions

2015-02-27 Thread Andy Maier

Changes by Andy Maier andreas.r.ma...@gmx.de:


--
nosy: +andymaier

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



[issue14721] httplib doesn't specify content-length header for POST requests without data

2015-02-27 Thread Demian Brecht

Demian Brecht added the comment:

Thanks for the heads up Ned.

James: I've created #23539 in the event that you'd like to contribute a patch.

--

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



[issue23535] os.path.join() wrong concatenation of C: on Windows

2015-02-27 Thread Eugene Bright

New submission from Eugene Bright:

Hello!

I found strange os.path.join() behavior on Windows.

It works fine in common case.
 os.path.join(C, filename)
'C\\filename'

But if first argument is C: there are no backslashes added at all!

 os.path.join(C:, filename)
'C:filename'

But I expect two inserted backslashes...

 sys.version
'3.4.1 |Anaconda 2.1.0 (64-bit)| (default, Sep 24 2014, 18:32:42) [MSC v.1600 
64 bit (AMD64)]'

Is there a bug?
Thanks!

--
messages: 236739
nosy: Eugene Bright
priority: normal
severity: normal
status: open
title: os.path.join() wrong concatenation of C: on Windows

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



Re: Newbie question about text encoding

2015-02-27 Thread Chris Angelico
On Sat, Feb 28, 2015 at 1:02 AM, Dave Angel da...@davea.name wrote:
 The term virtual memory is used for many aspects of the modern memory
 architecture.  But I presume you're using it in the sense of running in a
 swapfile as opposed to running in physical RAM.

Given that this started with a quote about you can't fake what you
ain't got, I would say that, yes, this refers to using hard disk to
provide more RAM.

If you're trying to use the pagefile/swapfile as if it's more memory
(I have 256MB of memory, but 10GB of swap space, so that's 10GB of
memory!), then yes, these performance considerations are huge. But
suppose you need to run a program that's larger than your available
RAM. On MS-DOS, sometimes you'd need to work with program overlays (a
concept borrowed from older systems, but ones that I never worked on,
so I'm going back no further than DOS here). You get a *massive*
complexity hit the instant you start using them, whether your program
would have been able to fit into memory on some systems or not. Just
making it possible to have only part of your code in memory places
demands on your code that you, the programmer, have to think about.
With virtual memory, though, you just write your code as if it's all
in memory, and some of it may, at some times, be on disk. Less code to
debug = less time spent debugging. The performance question is largely
immaterial (you'll be using the disk either way), but the savings on
complexity are tremendous. And then when you do find yourself running
on a system with enough RAM? No code changes needed, and full
performance. That's where virtual memory shines.

It's funny how the world changes, though. Back in the 90s, virtual
memory was the key. No home computer ever had enough RAM. Today? A
home-grade PC could easily have 16GB... and chances are you don't need
all of that. So we go for the opposite optimization: disk caching.
Apart from when I rebuild my Audio-Only Frozen project [1] and the
caches get completely blasted through, heaps and heaps of my work can
be done inside the disk cache. Hey, Sikorsky, got any files anywhere
on the hard disk matching *Pastel*.iso case insensitively? *chug chug
chug* Nope. Okay. Sikorsky, got any files matching *Pas5*.iso case
insensitively? *zip* Yeah, here it is. I didn't tell the first search
to hold all that file system data in memory; the hard drive controller
managed it all for me, and I got the performance benefit. Same as the
above: the main benefit is that this sort of thing requires zero
application code complexity. It's all done in a perfectly generic way
at a lower level.

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


[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is not well known old way how to make executable Python files on Windows. 
Add line @python -x %0 %* at the start of your Python script and rename the 
script to *.bat. The -x option makes Python to skip first line that is not 
Python, and @ forbids echoing executed command in bat-file.

Could zipapp support this feature?

--

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



[issue23535] os.path.join() wrong concatenation of C: on Windows

2015-02-27 Thread Eric V. Smith

Eric V. Smith added the comment:

I agree this isn't a bug, due to per-drive current directories on Windows.

--
nosy: +eric.smith
resolution:  - not a bug
stage:  - resolved
status: open - closed

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-27 Thread Cyd Haselton

Cyd Haselton added the comment:

Ethan,
The binary produced runs in the KBOX environment. It can be copied between 
devices provided the target device has the KBOX environment installed. 

Victor et al,
I read https://docs.python.org/devguide/devcycle.html#indevbranch a couple of 
times and, unless I;m missing something the dev branch only contains the 3.5 
release.  This may be an obvious question but if I fork the 3.4 branch would 
Android-related patches be eligible for that branch?

I'm hesitant to clone the dev branch as I;ve worked hard to get the latest 
stable version (3.4.2?) working on my device; I'm more interested in a) making 
my efforts available to others and b) learning the Python language than c) 
constantly working at making the latest and greatest Android-friendly

--

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



[issue23332] datetime.isoformat() - explicitly mark UTC string as such

2015-02-27 Thread Mirko Vogt

Mirko Vogt added the comment:

The proper response to that comment probably is: It's called ISO8601 and not 
RFC8601. And unfortunately ISO stands for International Standard.

--

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



[issue23536] Add explicit information on config file format not supporting filters

2015-02-27 Thread Piotr Dobrogost

New submission from Piotr Dobrogost:

It would be helpful to make it clear in section Configuration file format 
that it's not possible to configure filters through configuration file as 
opposed to dictionary passed to dictConfig() method.
I found this clearly stated in Pyramid docs at 
http://docs.pylonsproject.org/docs/pyramid/en/latest/narr/logging.html – For 
more advanced filtering, the logging module provides a logging.Filter object; 
however it cannot be used directly from the configuration file.

--
assignee: docs@python
components: Documentation
messages: 236741
nosy: docs@python, piotr.dobrogost, vinay.sajip
priority: normal
severity: normal
status: open
title: Add explicit information on config file format not supporting filters
type: enhancement
versions: Python 2.7, Python 3.6

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



[issue19075] Add sorting algorithm visualization to turtledemo

2015-02-27 Thread Larry Hastings

Larry Hastings added the comment:

This can wait for 3.5.

--

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



[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-02-27 Thread Steve Dower

Steve Dower added the comment:

Turns out the old code no longer compiles without this change, as the internal 
variable we were previously using is no longer exported from the CRT.

Can I get a review please?

--
nosy: +larry, serhiy.storchaka
priority: high - critical
type: crash - compile error

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



[issue23535] os.path.join() wrong concatenation of C: on Windows

2015-02-27 Thread Eugene Bright

Changes by Eugene Bright hex...@gmail.com:


--
type:  - behavior
versions: +Python 3.4

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-27 Thread Paul Moore

Paul Moore added the comment:

I'm -1 on this. The whole point of having a .pyz extension is so that you don't 
need to use an extension that's for files containing text to hold binary data.

If you want to do this, use zipapp and specify no interpreter line, then add 
the @python line yourself. Or just use a zip utility. Or build your own command 
line app. With the ability to supply an open file to create_archive, it's a 
3-liner:

with open(dest_filename, 'wb') as f:
f.write(b'@python -x %0 %*\n')
zipapp.create_archive(source_dir, f)

--

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



[issue22832] Tweak parameter names for fcntl module

2015-02-27 Thread Brett Cannon

Brett Cannon added the comment:

The patch LGTM. Serhiy, you have anything to add?

--
stage: needs patch - commit review

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



[issue23529] Limit decompressed data when reading from LZMAFile and BZ2File

2015-02-27 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 LZMAFile now uses BufferedReader.peek(). The current implementation seems 
 appropriate, but I am not comfortable with the current specification in the 
 documentation, which says it is allowed to not return any useful data.

What do you mean with useful data? peek() should always return at least one 
byte (except on EOF or on non-blocking streams, of course).

--

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



[issue21919] Changing cls.__bases__ must ensure proper metaclass inheritance

2015-02-27 Thread Mark Lawrence

Mark Lawrence added the comment:

@Eldar sorry that this issue slipped our net.

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.2

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



[issue23540] Proposal for asyncio: SubprocessTransport.detach() to detach a process from a transport

2015-02-27 Thread Martin Richard

New submission from Martin Richard:

I would like to add a detach() method to base_suprocess.BaseSuprocessTransport, 
which would release the underlying Popen object to the user, pretty much like 
socket.detach() detaches a socket object and returns the fd.

The rationale is the following: the lifetime of a subprocess started using a 
loop is bound to that loop, or require to clause the loop without terminating 
the process which leads to resource leaks (the stdin/stdout pipes can't be 
closed).

It may be useful in some cases. For instance, I create a fork of a process 
running a loop which started one or more subprocesses. In the child processus, 
I'd like to close the pipes and free the transport objects by calling:

proc = transport.detach()
transport.close()

proc.stdin.close()
proc.stdout.close()
proc.stderr.close()


The process is still running, in the parent process, everything looks like 
before the fork, the child can forget about the parent loop without fearing 
resource leaks.

It is somewhat related to http://bugs.python.org/issue21998 (Support fork).

I propose a patch which adds BaseSubprocessTransport.detach(), a specialized 
version for _UnixSubprocessTransport taking care of removing the callbacks from 
the ChildWatcher and a detach method for the pipes transports for unix and 
proactor.

--
components: asyncio
files: add-detach-to-subprocess_transport.patch
keywords: patch
messages: 236808
nosy: gvanrossum, haypo, martius, yselivanov
priority: normal
severity: normal
status: open
title: Proposal for asyncio: SubprocessTransport.detach() to detach a process 
from a transport
type: enhancement
versions: Python 3.3, Python 3.4, Python 3.5
Added file: 
http://bugs.python.org/file38263/add-detach-to-subprocess_transport.patch

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



[issue23539] Content-length not set for HTTP methods expecting body when body is None

2015-02-27 Thread James Rutherford

James Rutherford added the comment:

Thanks for setting up the new issue, I'll cook up a patch. I'm assuming this 
affects all Python 3.X versions but I've specifically encountered it on Python 
2.7.

--
nosy: +jimr
versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4

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



[issue22079] Ensure in PyType_Ready() that base class of static type is static

2015-02-27 Thread Matthias Klose

Matthias Klose added the comment:

reopening, this breaks some stuff in several places ...

https://bugs.launchpad.net/ubuntu/+source/terminator/+bug/1426294

--
nosy: +doko
resolution: fixed - 
status: closed - open

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



Re: Gaussian process regression

2015-02-27 Thread Peter Pearson
On Thu, 26 Feb 2015 09:59:45 -0800 (PST), jaykim.hui...@gmail.com wrote:

 I am trying to use Gaussian process regression for Near Infrared
 spectra. I have reference data(spectra), concentrations of reference
 data and sample data, and I am trying to predict concentrations of
 sample data. Here is my code.


 from sklearn.gaussian_process import GaussianProcess
 gp = GaussianProcess()
 gp.fit(reference, concentration)
 concentration_pred = gp.predict(sample)
[snip]

I'm sorry you're not getting help from this normally very helpful group.
I'd guess that's because nobody here uses sklearn.  Where did you get
sklearn?  Is it possible that there's an sklearn forum somewhere?

I've seen many of this group's regular participants go to great lengths
to help people with specialized problems, but for one of those people
to help with your problem, he or she would have to find and install
sklearn and learn enough about it to generate data sets on which
to exercise the code you've provided.  That's a lot to ask.  Can
you lower the activation barrier?

-- 
To email me, substitute nowhere-runbox, invalid-com.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue23538] New Windows installer in 3.5.0a1 breaks compatibility with Wine

2015-02-27 Thread Link Mauve

Link Mauve added the comment:

Maybe you could continue to distribute the msi?  I’ve also heard it’s used by 
Windows admins to install something on many computers at once.

--

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-27 Thread Ethan Furman

Ethan Furman added the comment:

I'm afraid I know next to nothing about git, so cannot help there.

I would think that it wouldn't be too hard for someone (such as Ryan or myself) 
to forward port a set of 3.4.2 patches to 3.5 -- so whatever is easiest for you.

--

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



[issue23539] Content-length not set for HTTP methods expecting body when body is None

2015-02-27 Thread Demian Brecht

Demian Brecht added the comment:

 I'm assuming this affects all Python 3.X versions but I've specifically 
 encountered it on Python 2.7.

Unless there are any core dev objections, I think it's applicable to 2.7, 3.4 
and 3.5 as other minor 3.x versions are in security mode 
(https://docs.python.org/devguide/devcycle.html#security-branches).

--

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



Re: Newbie question about text encoding

2015-02-27 Thread Grant Edwards
On 2015-02-27, Grant Edwards invalid@invalid.invalid wrote:
 On 2015-02-27, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: 
 Dave Angel wrote:
 On 02/27/2015 12:58 AM, Steven D'Aprano wrote: Dave Angel wrote:

 (Although I believe Seymour Cray was quoted as saying that virtual
 memory is a crock, because you can't fake what you ain't got.)

 If I recall correctly, disk access is about 1 times slower than RAM,
 so virtual memory is *at least* that much slower than real memory.

 It's so much more complicated than that, that I hardly know where to
 start.

 [snip technical details]

 As interesting as they were, none of those details will make swap faster,
 hence my comment that virtual memory is *at least* 1 times slower than
 RAM.

 Nonsense.  On all of my machines, virtual memory _is_ RAM almost all
 of the time.  I don't do the type of things that force the usage of
 swap.

And on some of the embedded systems I work on, _all_ virtual memory is
RAM 100.000% of the time.

-- 
Grant Edwards   grant.b.edwardsYow! Don't SANFORIZE me!!
  at   
  gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue23538] New Windows installer in 3.5.0a1 breaks compatibility with Wine

2015-02-27 Thread Steve Dower

Steve Dower added the comment:

The latest wine may not be up to date enough, since the new installer (and new 
Python) depend on MSVC 14.0, which is still only in preview.

Of course, there could be other issues, but without any more information it's 
very difficult to act on them.

--

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



[issue23538] New Windows installer in 3.5.0a1 breaks compatibility with Wine

2015-02-27 Thread Steve Dower

Steve Dower added the comment:

The new installer can also be used for that, and it's actually documented now 
(at least in the CHM - doesn't seem to have made it onto the website yet). I 
personally install it onto many computers at once fairly often, so I'm going to 
make sure that works.

The old single MSI installer is completely gone though and won't be coming back.

--

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



[issue23539] Content-length not set for HTTP methods expecting body when body is None

2015-02-27 Thread James Rutherford

James Rutherford added the comment:

OK, thanks.

--
versions:  -Python 3.2, Python 3.3

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



Re: Gaussian process regression

2015-02-27 Thread Fabien

On 27.02.2015 18:55, Peter Pearson wrote:

On Thu, 26 Feb 2015 09:59:45 -0800 (PST),jaykim.hui...@gmail.com  wrote:


I am trying to use Gaussian process regression for Near Infrared
spectra. I have reference data(spectra), concentrations of reference
data and sample data, and I am trying to predict concentrations of
sample data. Here is my code.

from sklearn.gaussian_process import GaussianProcess
gp = GaussianProcess()
gp.fit(reference, concentration)
concentration_pred = gp.predict(sample)

[snip]

I'm sorry you're not getting help from this normally very helpful group.
I'd guess that's because nobody here uses sklearn.  Where did you get
sklearn?  Is it possible that there's an sklearn forum somewhere?


http://blog.gmane.org/gmane.comp.python.scikit-learn

Cheers,

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


Re: Parallelization of Python on GPU?

2015-02-27 Thread Christian Gollwitzer
Am 26.02.15 um 06:53 schrieb John Ladasky:
 Thanks for the various links, Ethan.  I have encountered PyCUDA before, but 
 not the other options.
 
 So far, I'm not seeing code examples which appear to do what I would like, 
 which is simply to farm out one Python process to one GPU core.  The examples 
 all appear to parallelize array operations.  I know, that's the easier way to 
 break up a task.
 
 I may have to bite the bullet and learn how to use this:
 
 http://mklab.iti.gr/project/GPU-LIBSVM
 

If you can get this to run on your machine, it will surely outperform
any efforts what you can do with a python-CUDA bridge on your own. GPU
programming is hard, and efficient GPU programming is really hard. To
get an impression, this talk shows how some changes to an OpenCL program
can improve the speed by 60x compared to a naive implementation:

http://web.archive.org/web/20101217181349/http://developer.amd.com/zones/OpenCLZone/Events/assets/Optimizations-ImageConvolution1.pdf

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


[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-02-27 Thread Steve Dower

Steve Dower added the comment:

Builds fine on Ubuntu (sample size = 1, but it's about the best I can manage 
myself :) )

--

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



[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-02-27 Thread Steve Dower

Steve Dower added the comment:

New patch, which should cover all the other uses of _PyVerify_fd outside of 
posixmodule.

I've moved _PyVerify_fd into fileutils (but left _PyVerify_fd_dup2 in 
posixmodule, as it's basically deprecated at this point).

_Py_VERIFY_FD is now in fileutils.h, and is used everywhere it makes sense. I 
also fixed up some error handling for _Py_fstat that was using errno on Windows 
rather than GetLastError() - I can split this into a separate issue if it's in 
the way.

_Py_BEGIN/END_SUPPRESS_IPH are now in pymacro.h as they need to be after 
PyAPI_DATA is defined - the silent invalid parameter handler is now defined in 
PC/invalid_parameter_handler.c but setting and restoring it need to be in 
macros.

Builds are fine on VS 2015 CTP 6 (with this code enabled) and VS 2013 (with the 
old code enabled), and I'm getting set up to test a Linux build with the patch.

--
Added file: http://bugs.python.org/file38264/23524_2.patch

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



[issue23538] New Windows installer in 3.5.0a1 breaks compatibility with Wine

2015-02-27 Thread Link Mauve

Link Mauve added the comment:

I just tried it with wine-git, it doesn’t go further either by running the exe 
directly, or by running msiexec.exe /i on it.

Is there anything else required to run it?

--

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



[issue23538] New Windows installer in 3.5.0a1 breaks compatibility with Wine

2015-02-27 Thread Steve Dower

Steve Dower added the comment:

You should just run it directly - it isn't an MSI.

As I said, wine is probably not compatible with the new CRT version yet, but 
without at least an error message, it's impossible to tell.

--

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-27 Thread Cyd Haselton

Cyd Haselton added the comment:

Given Stephan's comments regarding Android support I'm beginning to think that 
I may have bitten off more than I can chew. Is there an option between 
'constant work' and 'zero contribution'?

I am not by any means an Android developer so the following is possibly riddled 
with miconceptions and errata, but, regarding locale support, I think there's a 
difference between 'regular' and 'native' development.  Native development 
involves using the NDK to port various bits of C-written utilities and 
libraries to Android...like python... and it is where the locale is broken, 
because of Android's limited libc.

--

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



Re: Newbie question about text encoding

2015-02-27 Thread alister
On Sat, 28 Feb 2015 01:22:15 +1100, Chris Angelico wrote:

 
 If you're trying to use the pagefile/swapfile as if it's more memory (I
 have 256MB of memory, but 10GB of swap space, so that's 10GB of
 memory!), then yes, these performance considerations are huge. But
 suppose you need to run a program that's larger than your available RAM.
 On MS-DOS, sometimes you'd need to work with program overlays (a concept
 borrowed from older systems, but ones that I never worked on, so I'm
 going back no further than DOS here). You get a *massive* complexity hit
 the instant you start using them, whether your program would have been
 able to fit into memory on some systems or not. Just making it possible
 to have only part of your code in memory places demands on your code
 that you, the programmer, have to think about. With virtual memory,
 though, you just write your code as if it's all in memory, and some of
 it may, at some times, be on disk. Less code to debug = less time spent
 debugging. The performance question is largely immaterial (you'll be
 using the disk either way), but the savings on complexity are
 tremendous. And then when you do find yourself running on a system with
 enough RAM? No code changes needed, and full performance. That's where
 virtual memory shines.
 ChrisA

I think there is a case for bringing back the overlay file, or at least 
loading larger programs in sections
only loading the routines as they are required could speed up the start 
time of many large applications.
examples libre office, I rarely need the mail merge function, the word 
count and may other features that could be added into the running 
application on demand rather than all at once.

obviously with large memory  virtual mem there is no need to un-install 
them once loaded. 



-- 
Ralph's Observation:
It is a mistake to let any mechanical object realise that you
are in a hurry.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue22832] Tweak parameter names for fcntl module

2015-02-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I found a lot of not related issues in the documentation.

--
nosy: +r.david.murray

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



[issue23534] `test_longdouble` fails on Mac when using system libffi (version 3.1)

2015-02-27 Thread Ronald Oussoren

Ronald Oussoren added the comment:

On OSX the internal copy of libffi that's used is based on the one in PyObjC, 
which in turn is based on the version of libffi on opensource.apple.com (IIRC 
with some small patches that fix minor issues found by the PyObjC testsuite).

--

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



[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-02-27 Thread STINNER Victor

STINNER Victor added the comment:

I don't understand the issue, can you please elaborate?

Can you please give an example of code which raise the bug, explain the 
behaviour on VS  2015 and the behaviour on VS  2015?

I don't understand why changes are restricted to posixmodule.c. Much more code 
manipulates file descriptors.

If Microsoft chose to kill a process when you pass an invalid file descriptor, 
why should Python behave differently? Is it only for Python unit test? If the 
problem only occurs with unit tests, why not only changing the behaviour with 
test.support.SuppressCrashReporter?

--

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-27 Thread Stefan Krah

Stefan Krah added the comment:

BTW, PEP 11 now demands a stable buildbot for official platform support
(IMO a very sane policy).

--

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



[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-02-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

May be include this in Py_BEGIN_ALLOW_THREADS / Py_END_ALLOW_THREADS?

--

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-27 Thread R. David Murray

R. David Murray added the comment:

Most of us fall toward the lower end of constant work and zero 
contribution, honestly, since the majority of us are doing it in spare time 
and not getting paid for it.  What is needed is a long-term commitment to fix 
bugs if they show up when new changes are made to CPython.  Which is where a 
buildbot is fairly critical...and I have no idea how complicated it will be to 
set up a buildbot for your environment.  I think it should be possible, though, 
since buildbot and twisted are written in python.

--

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



[issue23524] Use _set_thread_local_invalid_parameter_handler in posixmodule

2015-02-27 Thread Steve Dower

Steve Dower added the comment:

Larry - this may hold up the next release, so just keeping you in the loop. You 
don't have to review (though there are many changes in shared code, so you may 
not be useless :) )

--

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



[issue18382] multiprocessing's overlapped PipeConnection issues on Windows 8

2015-02-27 Thread Davin Potts

Davin Potts added the comment:

Steve:  FWIW, it looks like a good solution to me.

--

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



[issue23537] BaseSubprocessTransport includes two unused methods

2015-02-27 Thread Martin Richard

New submission from Martin Richard:

base_subprocess.BaseSuprocessTransport implements 
_make_write_subprocess_pipe_proto and _make_read_subprocess_pipe_proto.

Both are private and both raise NotImplementedError. However, when I grep in 
tulip sources for those methods, they are never called nor overridden by 
subclasses of BaseSuprocessTransport.

Shouldn't they be removed?

--
components: asyncio
messages: 236777
nosy: gvanrossum, haypo, martius, yselivanov
priority: normal
severity: normal
status: open
title: BaseSubprocessTransport includes two unused methods

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



  1   2   >