Re: A little test for you Guys

2015-09-22 Thread Akira Li
Python_Teacher via Python-list  writes:

...
> Let's define the function plural :
>
> def plural(words):
> plurals = []
> for word in words:
>plurals.append(word + 's')
> return plurals
>
> for word in plural(['cabagge','owl','toy']):
> print word

plural() should accept a single word. To handle list of words, call
map(plural, words)

...
> def str2print(f):
> def str2print_wrap(*args, **kwargs):
> """wrapper"""
> s = f(*args, **kwargs)
> print s
>return str2print_wrap
>
> def hello(s):
> """ Return "Hello $s" """
> return "%s %s" % ("Hello", s)

Use functools.wraps() to preserve the function info for introspection:

  import functools
  
  def prints_result(function):
  @functools.wraps(function)
  def wrapper(*args, **kwargs):
  result = function(*args, **kwargs)
  print(result)
  return result #XXX return
  return wrapper
  
  @prints_result
  def hello(...):
  pass

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


[issue24295] Backport of #17086 causes regression in setup.py

2015-09-22 Thread Moritz Sichert

Moritz Sichert added the comment:

No this isn't an issue in Python 3.5. It was caused by the backport that was 
diffed against an older version that didn't include 7955d769fdf5 and thus 
reverted that.

--

___
Python tracker 

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



Re: Successfully send sms with python

2015-09-22 Thread mm0fmf via Python-list

On 22/09/2015 12:19, Timon Rhynix wrote:

Hello, I have used pyserial, sms0.4 and other libraries to send sms via huawei 
E1750 modem.
The code runs well and no error is thrown but the text message is not 
sent/delivered to the number.
One of my code is as follows:

import serial
import time

class TextMessage:
 def __init__(self, recipient="0123456789", message="TextMessage.content not 
set."):
 self.recipient = recipient
 self.content = message

 def setRecipient(self, number):
 self.recipient = number

 def setContent(self, message):
 self.content = message

 def connectPhone(self):
 conn = 'COM13'
 self.ser = serial.Serial(conn, 460800, timeout=5)
 time.sleep(1)

 def sendMessage(self):
 self.ser.write('ATZ\r')
 time.sleep(1)
 self.ser.write('AT+CMGF=1\r')
 time.sleep(1)
 self.ser.write('''AT+CMGS="''' + self.recipient + '''"\r''')
 time.sleep(1)
 self.ser.write(self.content + "\r")
 time.sleep(1)
 self.ser.write(chr(26))
 time.sleep(1)
 print "message sent!"

 def disconnectPhone(self):
 self.ser.close()

When run it, the "message sent!" is printed but no message is sent/delivered.
Please assist on what I am missing. Thank you



If it's like the GSM modem I used then you should replace those "\r" 
strings with "\r\n".



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


[issue25212] Remove the double spaces in the C-API Intro

2015-09-22 Thread Georg Brandl

Georg Brandl added the comment:

> As a french, I was always distributed by this, but it's correct in english :-)

You know what you have to tell LaTeX to not put extra space after all full 
stops? \frenchspacing :)

--
nosy: +georg.brandl

___
Python tracker 

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



[issue25213] Regression: Python 3.5.0 shutil.copy2 doesn't raise PermissionError on Windows 7

2015-09-22 Thread eryksun

eryksun added the comment:

This issue doesn't pertain to the 64-bit version.

C:\Temp>py -3.5
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) 
[MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import shutil
>>> shutil.copy2('test.txt', 'C:\\')
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Program Files\Python 3.5\lib\shutil.py", line 251, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "C:\Program Files\Python 3.5\lib\shutil.py", line 115, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: 'C:\\test.txt'

In the 32-bit version, creating a file in the system root directory gets 
virtualized when the user doesn't have write access. It's not specific to 
shutil.copy2.

C:\Temp>py -3.5-32
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:16:59) 
[MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> open('C:\\test.txt', 'w').close()
>>> import pathlib
>>> pathlib.Path('C:\\test.txt').resolve()
WindowsPath('C:/Users/usradm/AppData/Local/VirtualStore/test.txt')

You can verify in the task manager's details tab that UAC Virtualization is 
enabled for 32-bit python.exe and disabled for 64-bit python.exe. The problem 
is that the manifest is missing the requestedExecutionLevel, which should be 
present and set to "asInvoker". This is discussed in the MSDN article [New UAC 
Technologies for Windows Vista][1].

>>> os.system('sigcheck -q -m "%s"' % sys.executable)
c:\users\usradm\appdata\local\programs\python\python35-32\python.exe:
Verified:   Signed
Signing date:   2:17 AM 9/13/2015
Publisher:  Python Software Foundation
Description:Python
Product:Python
Prod version:   3.5.0
File version:   3.5.0
MachineType:32-bit
Manifest:


  

  
  
  
  
  

  


3.4's manifest sets the requestedExecutionLevel:

C:\Temp>py -3.4-32
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) 
[MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, sys
>>> os.system('sigcheck -q -m "%s"' % sys.executable)
c:\users\usradm\appdata\local\programs\python\python34-32\python.exe:
Verified:   Unsigned
Link date:  9:43 PM 2/24/2015
Publisher:  n/a
Description:n/a
Product:n/a
Prod version:   n/a
File version:   n/a
MachineType:32-bit
Manifest:

  

  

  

  
 

[1]: https://msdn.microsoft.com/en-us/library/bb756960

--
components: +Windows -Library (Lib)
keywords: +3.5regression
nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal -> high

___
Python tracker 

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



[issue23329] _ssl cannot be compiled with LibreSSL anymore (on OpenBSD 5.5) because of ALPN

2015-09-22 Thread Remi Pointel

Remi Pointel added the comment:

Maybe we could check if the functionality is available instead of checking a 
version? What do you think about that?

--

___
Python tracker 

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



[issue10717] Multiprocessing module cannot call instance methods across processes

2015-09-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> wont fix
stage: needs patch -> resolved
status: pending -> closed

___
Python tracker 

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



A little test for you Guys

2015-09-22 Thread Python_Teacher via Python-list
you have 10 minutes Good luck!!


1. What is PEP8 ?

2. What are the different ways to distribute some python source code ?

2 Lists

Let's define the function plural :

def plural(words):
plurals = []
for word in words:
   plurals.append(word + 's')
return plurals

for word in plural(['cabagge','owl','toy']):
print word

Question : How could the code of the function plural be optimised?

3 Dictionaries

Here are two dictionnaries :

input = {
'foo1': 'bar1',
'chose': 'truc',
'foo2': 'bar2',
}
output = {
'bar1': 'foo1',
'truc': 'chose',
'bar2': 'foo2'
}

Question : Propose a function that returns output when you provide input ?

4 Iterators

Let's consider this program :

def program_1():
yield 1
yield 2
yield 3

g = program_1()
a = list(g)
b = list(g)
c = g()

Question : At the end of the program,

1. What is the type of g ?
2. What is the value of a ?
3. What is the value of b ?
4. What is the value of c ?

5 Decorators

Let's consider now :

def str2print(f):
def str2print_wrap(*args, **kwargs):
"""wrapper"""
s = f(*args, **kwargs)
print s
   return str2print_wrap

def hello(s):
""" Return "Hello $s" """
return "%s %s" % ("Hello", s)

Questions :

1. Decorate the method 'hello' with 'str2printf' and write the corresponding 
code.
2. What is the effect of the decorator on a call to the new method 'hello' ?
3. What is the return value of hello.__doc__
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue16251] pickle special methods are looked up on the instance rather than the type

2015-09-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Is this issue fixed?

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

___
Python tracker 

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



[issue25217] Method cache can crash at shutdown in _PyType_Lookup

2015-09-22 Thread Mark Shannon

Changes by Mark Shannon :


--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue16251] pickle special methods are looked up on the instance rather than the type

2015-09-22 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I don't think so.

On Tue, Sep 22, 2015, at 11:52, Serhiy Storchaka wrote:
> 
> Serhiy Storchaka added the comment:
> 
> Is this issue fixed?
> 
> --
> nosy: +serhiy.storchaka
> status: open -> pending
> 
> ___
> Python tracker 
> 
> ___

--
status: pending -> open

___
Python tracker 

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



Re: A little test for you Guys

2015-09-22 Thread Sven R. Kunze

Hmm, why not. :D

On 22.09.2015 20:43, Python_Teacher via Python-list wrote:

you have 10 minutes Good luck!!


1. What is PEP8 ?


A PEP.


2. What are the different ways to distribute some python source code ?


unison, rsync, scp, ftp, sftp, samba, http, https, mail, git, 


2 Lists

Let's define the function plural :

def plural(words):
 plurals = []
 for word in words:
plurals.append(word + 's')
 return plurals

for word in plural(['cabagge','owl','toy']):
 print word

Question : How could the code of the function plural be optimised?


Don't optimized until you need to. So, we leave it as is. ;)


3 Dictionaries

Here are two dictionnaries :

input = {
 'foo1': 'bar1',
 'chose': 'truc',
 'foo2': 'bar2',
}
output = {
 'bar1': 'foo1',
 'truc': 'chose',
 'bar2': 'foo2'
}

Question : Propose a function that returns output when you provide input ?


# :-P
def function(input):
return output


4 Iterators

Let's consider this program :

def program_1():
 yield 1
 yield 2
 yield 3

g = program_1()
a = list(g)
b = list(g)
c = g()

Question : At the end of the program,

1. What is the type of g ?
2. What is the value of a ?
3. What is the value of b ?
4. What is the value of c ?


The program ends with a traceback. So, my variables are all gone. :(


5 Decorators

Let's consider now :

def str2print(f):
 def str2print_wrap(*args, **kwargs):
 """wrapper"""
 s = f(*args, **kwargs)
 print s
return str2print_wrap

def hello(s):
 """ Return "Hello $s" """
 return "%s %s" % ("Hello", s)

Questions :

1. Decorate the method 'hello' with 'str2printf' and write the corresponding 
code.


@str2print
def hello(s):
""" Return "Hello $s" but actually returns None """
return "%s %s" % ("Hello", s)



2. What is the effect of the decorator on a call to the new method 'hello' ?

It prints "Hello {s}" and returns None.

3. What is the return value of hello.__doc__

'wrapper'

Best,
Sven
--
https://mail.python.org/mailman/listinfo/python-list


[issue25214] asyncio ssl transport regression

2015-09-22 Thread STINNER Victor

STINNER Victor added the comment:

The specific case of getpeercert(), there is an extra info. For other info,
did you notice that I just added ssl_object to extra info? :-)

http://bugs.python.org/issue25114

--

___
Python tracker 

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



[issue23513] Add support for classes/object model in multiprocessing/pickle

2015-09-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



Re: A little test for you Guys

2015-09-22 Thread Ian Kelly
On Tue, Sep 22, 2015 at 12:43 PM, Python_Teacher via Python-list
 wrote:
> you have 10 minutes Good luck!!

Sorry, I'm more interested in critiquing the questions than answering them.

> Let's define the function plural :
>
> def plural(words):
> plurals = []
> for word in words:
>plurals.append(word + 's')
> return plurals
>
> for word in plural(['cabagge','owl','toy']):
> print word
>
> Question : How could the code of the function plural be optimised?

Optimized in what way? To be faster? Use less memory? Be more readable?

> 3 Dictionaries
>
> Here are two dictionnaries :
>
> input = {
> 'foo1': 'bar1',
> 'chose': 'truc',
> 'foo2': 'bar2',
> }
> output = {
> 'bar1': 'foo1',
> 'truc': 'chose',
> 'bar2': 'foo2'
> }
>
> Question : Propose a function that returns output when you provide input ?

def f(maybe_input):
if maybe_input == input:
return output

I don't think I really understand what it is that you're asking for here.

> 3. What is the return value of hello.__doc__

hello.__doc__ isn't a function, so it doesn't have a return value. I
think you mean to ask what the expression evaluates to.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue9051] Improve pickle format for timezone aware datetime instances

2015-09-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For stability it is better to use public name 'timezone.utc' instead of '_utc'. 
Dotted names now are supported with all protocols.

> but there is still room for improvement:

Don't worry about this. When you pickle a number of datetime objects with the 
same timezone, the timezone is pickled only once and for all other datetime 
objects only a reference is used.

--
nosy: +serhiy.storchaka
type: behavior -> enhancement
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



Re: Lightwight socket IO wrapper

2015-09-22 Thread James Harris
"Dennis Lee Bieber"  wrote in message 
news:mailman.12.1442794762.28679.python-l...@python.org...

On Sun, 20 Sep 2015 23:36:30 +0100, "James Harris"
 declaimed the following:




There are a few things and more crop up as time goes on. For example,
over TCP it would be helpful to have a function to receive a specific
number of bytes or one to read bytes until reaching a certain 
delimiter
such as newline or zero or space etc. Even better would be to be able 
to

use the iteration protocol so you could just code next() and get the
next such chunk of read in a for loop. When sending it would be good 
to

just say to send a bunch of bytes but know that you will get told how
many were sent (or didn't get sent) if it fails. Sock.sendall() 
doesn't

do that.


Note that the "buffer size" option on a TCP socket.recv() gives you
your "specific number of bytes" -- if available at that time.


"If" is a big word!

AIUI the buffer size is not guaranteed to relate to the number of bytes 
returned except that you won't/shouldn't(!) get more than the buffer 
size.



I wouldn't want to user .recv(1) though to implement your "reaching a
certain delimiter"... Much better to read as much as available and 
search

it for the delimiter.


Yes, that's what I do at the moment. I keep a block of bytes, add any 
new stuff to it and scan it for delimiters.



I'll confess, adding a .readln() FOR TCP ONLY, might
be a nice extension over BSD sockets (might need to allow option for
whether line-ends are Internet standard  or some other marker, 
and
whether they should be converted upon reading to the native format for 
the

host).


Akira Li pointed out that there is just such an extension: makefile. 
Scanning to  is what I do just now as that includes  too and 
I leave them on the string. IIRC file.readline works in the same way.



I thought UDP would deliver (or drop) a whole datagram but cannot find
anything in the Python documentaiton to guarantee that. In fact
documentation for the send() call says that apps are responsible for
checking that all data has been sent. They may mean that to apply to
stream protocols only but it doesn't state that. (Of course, UDP
datagrams are limited in size so the call may validly indicate
incomplete transmission even when the first part of a big message is
sent successfully.)


Looking in the wrong documentation 

You probably should be looking at the UDP RFC. Or maybe just

http://www.diffen.com/difference/TCP_vs_UDP

"""
Packets are sent individually and are checked for integrity only if 
they
arrive. Packets have definite boundaries which are honored upon 
receipt,

meaning a read operation at the receiver socket will yield an entire
message as it was originally sent.
"""


I would rather see it in the Python docs because we program to the 
language standard and there can be - and often are, for good reason - 
areas where Python does not work in the same way as underlying systems.


Even if the IP layer has to fragment a UDP packet to meet limits of 
the
transport media, it should put them back together on the other end 
before
passing it up to the UDP layer. To my knowledge, UDP does not have a 
size
limit on the message (well -- a 16-bit length field in the UDP 
header). But
since it /is/ "got it all" or "dropped" with no inherent confirmation, 
one
would have to embed their own protocol within it -- sequence numbers 
with
ACK/NAK, for example. Problem: if using LARGE UDP packets, this 
protocol
would mean having LARGE resends should packets be dropped or arrive 
out of

sequence (and since the ACK/NAK could be dropped too, you may have to
handle the case of a duplicated packet -- also large).


Yes, it was the 16-bit limitation that I was talking about.


TCP is a stream protocol -- the protocol will ensure that all data
arrives, and that it arrives in order, but does not enforce any 
boundaries

on the data; what started as a relatively large packet at one end may
arrive as lots of small packets due to intermediate transport limits 
(one
can visualize a worst case: each TCP packet is broken up to fit 
Hollerith
cards; 20bytes for header and 60 bytes of data -- then fed to a reader 
and
sent on AS-IS). Boundaries are the end-user responsibility... line 
endings
(look at SMTP, where an email message ends on a line containing just a 
".")

or embedded length counter (not the TCP packet length).


Yes.

Receiving no bytes is taken as indicating the end of the 
communication.

That's OK for TCP but not for UDP so there should be a way to
distinguish between the end of data and receiving an empty datagram.


I don't believe UDP supports a truly empty datagram (length of 0) --
presuming a sending stack actually sends one, the receiving stack will
probably drop it as there is no data to pass on to a client (there is 
a PR
at work because we have a UDP driver that doesn't drop 0-length 
messages,

but also can't deliver them -- so the circular 

[issue25217] Method cache can crash at shutdown in _PyType_Lookup

2015-09-22 Thread Antoine Pitrou

New submission from Antoine Pitrou:

In the following gdb backtrace you'll see that if Python code is executed from 
the PyInterpreterState_Clear() step in Py_Finalize() (apparently when clearing 
the builtins), _PyType_Lookup() can be executed and crash on a NULL entry in 
the method cache.

Note the reason this happens is that we set a weakref callback on the global 
print() function, and for some reason the weakref is able to survive longer 
than the global print() function. We don't have the crash on previous versions 
of Python (< 3.5).

Here is the backtrace:

#0  0x7fc17dba90cf in _PyType_Lookup (type=type@entry=0x291e0d8, 
name=name@entry='_globals') at Objects/typeobject.c:2913
#1  0x7fc17db90346 in _PyObject_GenericGetAttrWithDict (obj=
, __doc__=None, __abstractmethods__=frozenset(), 
_abc_negative_cache=, _abc_cache=) at remote 0x2809e18>: ) at 
remote 0x7fc1741c2948>, <_TypeMetaclass(_abc_negative_cache_version=30, 
_abc_cache=, key=, __init__=, can_convert_to=, 
name=) at Objects/object.c:1119
#3  0x7fc17db8e3c4 in PyObject_GetAttr (
v=v@entry=, __doc__=None, __abstractmethods__=frozenset(), 
_abc_negative_cache=, _abc_cache=) at remote 0x2809e18>: ) at 
remote 0x7fc1741c2948>, <_TypeMetaclass(_abc_negative_cache_version=30, 
_abc_cache=, key=, __init__=, can_convert_to=)
at Objects/object.c:889
#4  0x7fc17dc37e9d in PyEval_EvalFrameEx (
f=f@entry=Frame 0x7fc17c7887f8, for file 
/home/antoine/numba/numba/typing/context.py, line 238, in on_disposal 
(wr=), throwflag=throwflag@entry=0) at 
Python/ceval.c:2688
#5  0x7fc17dc3c56c in _PyEval_EvalCodeWithName (_co=, globals=, locals=locals@entry=0x0, 
args=args@entry=0x7fc174b5e428, argcount=1, kws=kws@entry=0x0, kwcount=0, 
defs=0x0, defcount=0, kwdefs=0x0, 
closure=(,), name=0x0, qualname=0x0) at 
Python/ceval.c:3962
#6  0x7fc17dc3c659 in PyEval_EvalCodeEx (_co=, 
globals=, locals=locals@entry=0x0, 
args=args@entry=0x7fc174b5e428, 
argcount=, kws=kws@entry=0x0, kwcount=0, defs=0x0, 
defcount=0, kwdefs=0x0, closure=(,))
at Python/ceval.c:3983
#7  0x7fc17db66f08 in function_call (func=, arg=(,), kw=0x0)
at Objects/funcobject.c:632
#8  0x7fc17db30ce1 in PyObject_Call (func=func@entry=, arg=arg@entry=(,), 
kw=kw@entry=0x0) at Objects/abstract.c:2147
#9  0x7fc17db318e8 in PyObject_CallFunctionObjArgs 
(callable=callable@entry=) at 
Objects/abstract.c:2427
#10 0x7fc17dc04228 in handle_callback (ref=ref@entry=0x7fc1741bd2d8, 
callback=callback@entry=)
at Objects/weakrefobject.c:868
#11 0x7fc17dc047aa in PyObject_ClearWeakRefs (object=object@entry=)
at Objects/weakrefobject.c:913
#12 0x7fc17db8b57c in meth_dealloc (m=m@entry=0x7fc17e1b2d00) at 
Objects/methodobject.c:155
#13 0x7fc17db8ee49 in _Py_Dealloc (op=) at Objects/object.c:1786
#14 0x7fc17db79ca0 in free_keys_object (keys=keys@entry=0x221cef0) at 
Objects/dictobject.c:354
#15 0x7fc17db7bb63 in dict_dealloc (mp=mp@entry=0x7fc17e1d62f8) at 
Objects/dictobject.c:1567
#16 0x7fc17db8ee49 in _Py_Dealloc (
op={'FileExistsError': , 
'NotImplementedError': , 'eval': , 
'SystemError': , 'max': , 'repr': , 'sum': , 'ValueError': , 'Ellipsis': , 'next': 
, 'tuple': , 'StopIteration': 
, 'ReferenceError': , 'OverflowError': , 
'RuntimeWarning': , 'issubclass': , 'range': , filename@entry=0x7fc17e152550 "numba/pycc/pycc", 
closeit=closeit@entry=1, flags=flags@entry=0x7ffc35eb0970) at 
Python/pythonrun.c:401
#24 0x7fc17dc6900c in PyRun_AnyFileExFlags (fp=fp@entry=0x22bce90, 
filename=0x7fc17e152550 "numba/pycc/pycc", closeit=closeit@entry=1, 
flags=flags@entry=0x7ffc35eb0970) at Python/pythonrun.c:80
#25 0x7fc17dc83e57 in run_file (fp=fp@entry=0x22bce90, 
filename=filename@entry=0x21f4300 L"numba/pycc/pycc", 
p_cf=p_cf@entry=0x7ffc35eb0970)
at Modules/main.c:318
#26 0x7fc17dc84a9b in Py_Main 

Re: Sqlite pragma statement "locking_mode" set to "EXCLUSIVE" by default

2015-09-22 Thread Sol T
Hi,

I know I can do this per connection, however how can I have it set to
default? Does this need to be compiled into python?

On Tue, Sep 22, 2015 at 2:04 PM, Ryan Stuart 
wrote:

> On Thu, Sep 17, 2015 at 2:24 PM, sol433tt  wrote:
>
>> I would like to have the Sqlite pragma statement "locking_mode" set to
>> "EXCLUSIVE" by default (RO database). Does this need to be compiled in? How
>> might this be achieved?
>>
>
> You can issue any PRAGA statement you like using the execute method on a
> connection as per the documentation (
> https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.execute).
> For information on the specific PRAGMA option you need, see
> https://www.sqlite.org/pragma.html#pragma_locking_mode. I can't see any
> mention of it being a compile time PRAGMA.
>
> Cheers
>
>
>>
>> There is some performance to be gained. I have a number of python
>> scripts, and don't want to alter the pragma statement for every script.
>> This computer never writes to the databases.
>>
>> thank you
>>
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>>
>
>
> --
> Ryan Stuart, B.Eng
> Software Engineer
>
> W: http://www.kapiche.com/
> M: +61-431-299-036
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2015-09-22 Thread eryksun

eryksun added the comment:

> import locale
> locale.setlocale(locale.LC_ALL, '')
>
> import importlib
> import time
> importlib.reload(time)
>
> it does not work when imported after importing time. 
> What is the reason? Does reload() work only for 
> modules coded as Python sources? 

The import system won't reinitialize a builtin or dynamic extension module. 
Reloading just returns a reference to the existing module. It won't even reload 
a PEP 489 multi-phase extension module. (But you can create and exec a new 
instance of a multi-phase extension module.) 

> Is there any other approach that would implement the 
> workaroundXXX.py module?

If the user's default locale and the current thread's preferred language are 
compatible with the system ANSI encoding [1], then you don't actually need to 
call _tzset nor worry about time.tzname. Call setlocale(LC_CTYPE, ''), and then 
call time.strftime('%Z') to get the timezone name. 

If you use Win32 directly instead of the CRT, then none of this ANSI business 
is an issue. Just call GetTimeZoneInformation to get the standard and daylight 
names as wide-character strings. You have that option via ctypes.

[1]: A user can select a default locale (language) that's unrelated to the 
system ANSI locale (the ANSI setting is per machine, located under 
Region->Administrative). Also, the preferred language can be selected 
dynamically by calling SetThreadPreferredUILanguages or 
SetProcessPreferredUILanguages. All three could be incompatible with each 
other, in which case you have to explicitly set the locale (e.g. "ru-RU" 
instead of an empty string) and call _tzset.

--

___
Python tracker 

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



Re: A photo/image/video sharing app in Python

2015-09-22 Thread Chris Angelico
On Tue, Sep 22, 2015 at 3:53 PM, Cai Gengyang  wrote:
> A piece of software that would let end users easily create gorgeous 
> real-life, real-time cartoons on the web might not exist yet. But if it were 
> possible to invent this and get it commercialised , it could indeed become a 
> great product that users love and pay good money to use ... You might even 
> become a billionaire just through inventing and commercialising such a tool / 
> system  ...
>

Yes, you might become a billionaire. Does that suggest something to
you? If a project could make _that much money_, wouldn't someone have
done it already? The scope of this project is enormous, and if you're
to tackle it, you'll need to have a lot more than a basic notion of
"hey wouldn't this be nice".

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


[issue25177] OverflowError in statistics.mean when summing large floats

2015-09-22 Thread Steven D'Aprano

Steven D'Aprano added the comment:

Bar, thanks for the time you put into diagnosing this error, it is 
definitely a bug. The intention is for mean([huge, huge]) to return 
huge, not raise OverflowError.

I'm reluctant to say that mean() will *never* raise OverflowError, but 
it certainly shouldn't do so for this case if it can be avoided. I think 
Mark's diagnosis is probably correct that refactoring the code will fix 
this.

--

___
Python tracker 

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



[issue25209] Append space after completed keywords

2015-09-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Good catch Martin. Indeed, "pass", "break" and "continue" don't need a space, 
and "True", "False" and "None" need a space only in rare cases like "None in 
collection". Some keywords ("else", "finally", "try") need a colon. But while 
"return" and "lambda" not always need a space, I think that needing a space is 
more common case, and in any case the redundant space doesn't make a harm.

Here is revised patch that doesn't add a space in some cases and instead adds a 
colon in some cases.

--
Added file: http://bugs.python.org/file40549/rlcompleter_keyword_space_2.patch

___
Python tracker 

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



[issue25205] setattr accepts invalid identifiers

2015-09-22 Thread W deW

W deW added the comment:

Thanks for the ref to issue14029. I think I see how it works. As long as the 
object's __dict__ accepts the attributeName as a key, it needs not be a valid 
string nor a string at all. Though the latter *is* checked for, and that in 
turn can be circumvented by adding the attribute to the __dict__ directly. An 
object can be made attribute to itself.

However, the documentation falls short here. So far, I haven't found where it 
defines "attribute". Is there any point in defining an attribute that cannot be 
addressed as an attribute if the parser doesn't allow it?

It seems to me that in order to catch programing errors early, the default 
behaviour should include checking the valid syntax of the attribute's name.

--
components:  -Documentation
versions: +Python 2.7

___
Python tracker 

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



[issue25205] setattr accepts invalid identifiers

2015-09-22 Thread eryksun

eryksun added the comment:

This is a documentation issue and not specific to a particular version  of 
Python. What's the rule on version tagging in this case?

--
components: +Documentation

___
Python tracker 

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



[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-09-22 Thread Shirshendu Bhowmick

Shirshendu Bhowmick added the comment:

I am the person with this problem, i have tired the installation on another 
Windows 8.1 machine but faced the same error. Is there any update on this issue.

--
nosy: +Shirshendu Bhowmick

___
Python tracker 

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



[issue17781] optimize compilation options

2015-09-22 Thread Matthias Klose

Matthias Klose added the comment:

On 22.09.2015 12:31, Antoine Pitrou wrote:
> Also note LTO can make compilation times much longer (it's the linking step 
> actually, which can take minutes).

use -flto=jobserver

--

___
Python tracker 

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



Re: Lightwight socket IO wrapper

2015-09-22 Thread James Harris
"Marko Rauhamaa"  wrote in message 
news:8737y6cgp6@elektro.pacujo.net...

"James Harris" :


I agree with what you say. A zero-length UDP datagram should be
possible and not indicate end of input but is that guaranteed and
portable?


The zero-length payload size shouldn't be an issue, but UDP doesn't 
make

any guarantees about delivering the message. Your UDP application must
be prepared for some, most or all of the messages disappearing without
any error indication.

In practice, you'd end up implementing your own TCP on top of UDP
(retries, timeouts, acknowledgements, sequence numbers etc).


The unreliability of UDP was not the case in point here. Rather, it was 
about whether different platforms could be relied upon to deliver 
zero-length datagrams to the app if the datagrams got safely across the 
network.


James

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


Re: A little test for you Guys

2015-09-22 Thread sohcahtoa82
On Tuesday, September 22, 2015 at 11:45:00 AM UTC-7, Lj Fc wrote:
> you have 10 minutes Good luck!!
> 
> 
> 1. What is PEP8 ?
> 
> 2. What are the different ways to distribute some python source code ?
> 
> 2 Lists
> 
> Let's define the function plural :
> 
> def plural(words):
> plurals = []
> for word in words:
>plurals.append(word + 's')
> return plurals
> 
> for word in plural(['cabagge','owl','toy']):
> print word
> 
> Question : How could the code of the function plural be optimised?
> 
> 3 Dictionaries
> 
> Here are two dictionnaries :
> 
> input = {
> 'foo1': 'bar1',
> 'chose': 'truc',
> 'foo2': 'bar2',
> }
> output = {
> 'bar1': 'foo1',
> 'truc': 'chose',
> 'bar2': 'foo2'
> }
> 
> Question : Propose a function that returns output when you provide input ?
> 
> 4 Iterators
> 
> Let's consider this program :
> 
> def program_1():
> yield 1
> yield 2
> yield 3
> 
> g = program_1()
> a = list(g)
> b = list(g)
> c = g()
> 
> Question : At the end of the program,
> 
> 1. What is the type of g ?
> 2. What is the value of a ?
> 3. What is the value of b ?
> 4. What is the value of c ?
> 
> 5 Decorators
> 
> Let's consider now :
> 
> def str2print(f):
> def str2print_wrap(*args, **kwargs):
> """wrapper"""
> s = f(*args, **kwargs)
> print s
>return str2print_wrap
> 
> def hello(s):
> """ Return "Hello $s" """
> return "%s %s" % ("Hello", s)
> 
> Questions :
> 
> 1. Decorate the method 'hello' with 'str2printf' and write the corresponding 
> code.
> 2. What is the effect of the decorator on a call to the new method 'hello' ?
> 3. What is the return value of hello.__doc__

Pretty sure this guy is asking us to do his homework.  :-P
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25092] Regression: test_datetime fails on 3.5, Win 7, works on 3.4

2015-09-22 Thread Steve Dower

Changes by Steve Dower :


--
assignee:  -> steve.dower

___
Python tracker 

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



Re: Lightwight socket IO wrapper

2015-09-22 Thread Gregory Ewing

Random832 wrote:


Isn't this technically the same problem as pressing ctrl-d at a terminal
- it's not _really_ the end of the input (you can continue reading
after), but it sends the program something it will interpret as such?


Yes. There's no concept of "closing the connection" with UDP,
because there's no connection. So if a read returns 0 bytes,
it must be because someone sent you a 0-length datagram.

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


[issue25165] Windows uninstallation should not remove launcher if other versions remain

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

I'm going to look into having the launcher's MSI stay behind when the bundle is 
removed, so it will have to be uninstalled separately. It can already be 
installed separately, though there isn't a really easy way to get the installer 
so you can do that.

(Because prior versions of Python did not always use the same component ID for 
the launcher, we have to have a break here. However, we now have a single MSI 
that is identical for all future versions, so the problem should not arise 
again.)

--
assignee:  -> steve.dower

___
Python tracker 

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



[issue16701] Docs missing the behavior of += (in-place add) for lists.

2015-09-22 Thread Martin Panter

Martin Panter added the comment:

Here is a patch documenting the += and *= mutable sequence operations. Please 
review my wording.

These operations already seem to be tested, at least on the basic mutable 
sequences: see /Lib/test/list_tests.py, test_array, test_collections, 
test_bytes (tests bytearray).

The only other places that I thought might be missing augmented assignment were 
for sets, but there is no problem there: 
.

However, there are other operations that I think may be missing from this page 
of the documentation. But it might be better to handle those in a separate bug 
report. Some of this could build off the work in Issue 12067.

* Equality comparisons (mentioned for range and dict, but apparently not tuple, 
set, strings, etc)
* Ordering comparisons (not supported for range)
* min() and max() don’t really belong; maybe substitute with iter()

--
keywords: +patch
nosy: +martin.panter
stage: needs patch -> patch review
versions: +Python 3.6
Added file: http://bugs.python.org/file40552/seq-inplace.patch

___
Python tracker 

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



[issue25163] Windows installer in AllUsers mode presents wrong installation path

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

Just an incorrect variable reference in the localization file. Should be easy 
enough to fix (if the variable is initialized at the start of installation...)

--
assignee:  -> steve.dower

___
Python tracker 

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



[issue10404] IDLE on OS X popup menus do not work: cannot set/clear breakpoints

2015-09-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Right click for context menu in Mac Aqua is fixed in ##24570.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue25164] Windows default installation path is inconsistent between per-user and system-wide installation

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

Might be too much of a breaking change for 3.5.1 - what do the other Windows 
guys think about making them both "Python 3.5" (or "Python 3.5-32" in the 
per-user case, to avoid conflicting with a 64-bit install)?

--

___
Python tracker 

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



[issue24570] IDLE Autocomplete and Call Tips Do Not Pop Up on OS X with ActiveTcl 8.5.18

2015-09-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b79dd0d7dc98 by Terry Jan Reedy in branch '2.7':
Issue #24570: Right-click for context menus now work on Mac Aqual also.
https://hg.python.org/cpython/rev/b79dd0d7dc98

New changeset 51b2b1a821b7 by Terry Jan Reedy in branch '3.4':
Issue #24570: Right-click for context menus now work on Mac Aqual also.
https://hg.python.org/cpython/rev/51b2b1a821b7

--
nosy: +python-dev

___
Python tracker 

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



[issue25112] Windows installer assigns non-existent icons to Python file types

2015-09-22 Thread Steve Dower

Changes by Steve Dower :


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

___
Python tracker 

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



[issue24801] right-mouse click in IDLE on Mac doesn't work

2015-09-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Serhiy, thanks for the review.  I bungled the issue number on the commit 
message, so here are the commit notices.  Will correct for NEWS.

New changeset b79dd0d7dc98 by Terry Jan Reedy in branch '2.7':
Issue #24570: Right-click for context menus now work on Mac Aqual also.
https://hg.python.org/cpython/rev/b79dd0d7dc98

New changeset 51b2b1a821b7 by Terry Jan Reedy in branch '3.4':
Issue #24570: Right-click for context menus now work on Mac Aqual also.
https://hg.python.org/cpython/rev/51b2b1a821b7

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

___
Python tracker 

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



[issue25092] Regression: test_datetime fails on 3.5, Win 7, works on 3.4

2015-09-22 Thread Steve Dower

Changes by Steve Dower :


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

___
Python tracker 

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



[issue25196] Installer>Install in user folder by default when you check: for all users

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

Did you check the checkbox on the front page?

The checkbox that says "Install launcher for all users" only installs the 
launcher for all users, which is recommended for compatibility with Python 3.4 
or 2.7 (which would otherwise override the launcher with one that doesn't work).

To install Python itself for all users you need to go through Customize and 
select it on the second page.

--

___
Python tracker 

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



[issue25213] Regression: Python 3.5.0 shutil.copy2 doesn't raise PermissionError on Windows 7

2015-09-22 Thread Steve Dower

Changes by Steve Dower :


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

___
Python tracker 

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



[issue25085] Windows x86-64 embeddable zip file contains test directorys

2015-09-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:

If the Tcl/Tk/Idle bundle is installed, then I prefer that /idle-test be 
included, even if '[ ] include tests' is left blank, as I may someday make part 
of it runnable from the help menu.  IE, the status quo. I do not care about any 
of the other package test directories.

If I understand the patch correctly, you already excluded the tkinter bundle 
from the embeddable zip.  The change I see is elimination of site-packages 
(#?) and *.exe (#26086).  It appears that you rejected the proposal in this 
issue, so the resolution should say so.

--

___
Python tracker 

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



[issue25117] Windows installer: precompiling stdlib fails with missing DLL errors

2015-09-22 Thread eryksun

eryksun added the comment:

> The problem here is probably that installing the CRT update 
> required a restart

I saw that, but it didn't make any sense to me that the DLL isn't available 
immediately after wusa.exe exits. Is it in limbo until the system is restarted? 
I know in Windows 10 these api-ms-win-crt* DLLs are actually virtual API sets 
managed by the loader (i.e. they all have the same module handle, that of 
ucrtbase.dll). How does this relate to what's going on with Windows 8/Server 
2012, if at all? Marius reports that "Python seems to work", but doesn't 
mention whether or not a reboot was necessary.

--

___
Python tracker 

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



[issue25047] xml.etree.ElementTree encoding declaration should be capital ('UTF-8') rather than lowercase ('utf-8')

2015-09-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ff7aba08ada6 by Martin Panter in branch '3.4':
Issue #25047: Respect case writing XML encoding declarations
https://hg.python.org/cpython/rev/ff7aba08ada6

New changeset 9c248233754c by Martin Panter in branch '3.5':
Issue #25047: Merge Element Tree encoding from 3.4 into 3.5
https://hg.python.org/cpython/rev/9c248233754c

New changeset 409bab2181d3 by Martin Panter in branch 'default':
Issue #25047: Merge Element Tree encoding from 3.5
https://hg.python.org/cpython/rev/409bab2181d3

--
nosy: +python-dev

___
Python tracker 

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



[issue25047] xml.etree.ElementTree encoding declaration should be capital ('UTF-8') rather than lowercase ('utf-8')

2015-09-22 Thread Martin Panter

Changes by Martin Panter :


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

___
Python tracker 

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



Re: A little test for you Guys

2015-09-22 Thread Ray Cote
On Tue, Sep 22, 2015 at 7:32 PM, Mark Lawrence 
wrote:

>
>> 2 Lists
>>
>
> Tut, tut, tut.


That is not a list, that is a tutple.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25117] Windows installer: precompiling stdlib fails with missing DLL errors

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

The problem here is probably that installing the CRT update required a restart 
(see the line below from the log), but we didn't interrupt installation to make 
you restart before continuing.

>From the first log file:

[0A68:0EC8][2015-09-14T05:54:24]i319: Applied execute package: 
crt_14.0_v6.2_x64, result: 0x0, restart: Required


Handling this nicely could be some work. We would want to force the restart 
immediately if the user is installing pip or precompiling the stdlib, but 
otherwise they can finish installation and then restart. I'll try and look into 
this soon, but I don't think it needs to hold up a 3.5.1.

--

___
Python tracker 

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



[issue25143] 3.5 install fails poorly on Windows XP

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

I don't have any XP machines handy, but I'll see if I can at least get an early 
termination from the installer rather than broken UI.

IIRC, Larry was against having prominent warnings about unsupported platforms 
on the download page, but with python.org being the official source of Windows 
binaries and XP still having an overly large market share, maybe it needs to be 
there? (Though it probably won't ever be prominent *enough*, and we'll still 
have people miss it.)

--
nosy: +larry

___
Python tracker 

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



[issue25166] Windows AllUsers installation places uninstaller in user profile

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

Burn is always started in the per-user scope so that we can do per-user 
installs without elevating, but it looks like we need to manually change this 
once we know it's an all-users install.

--
assignee:  -> steve.dower

___
Python tracker 

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



[issue24570] IDLE Autocomplete and Call Tips Do Not Pop Up on OS X with ActiveTcl 8.5.18

2015-09-22 Thread Terry J. Reedy

Changes by Terry J. Reedy :


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

___
Python tracker 

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



[issue10404] IDLE on OS X popup menus do not work: cannot set/clear breakpoints

2015-09-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Sorry, #24801.

--

___
Python tracker 

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



[issue25112] Windows installer assigns non-existent icons to Python file types

2015-09-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4d0d987bf6a8 by Steve Dower in branch '3.5':
Issues #25112: py.exe launcher is missing icons
https://hg.python.org/cpython/rev/4d0d987bf6a8

--
nosy: +python-dev

___
Python tracker 

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



[issue25081] Windows installer Upgrade->Customize->Back goes to Install page

2015-09-22 Thread Steve Dower

Changes by Steve Dower :


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

___
Python tracker 

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



[issue25102] Windows installer: 'precompile standard library' option should pre-compile with -O and -OO

2015-09-22 Thread Steve Dower

Changes by Steve Dower :


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

___
Python tracker 

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



[issue25126] Non-web installer fails without a connection when doing debug install

2015-09-22 Thread Steve Dower

Changes by Steve Dower :


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

___
Python tracker 

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



[issue25086] Windows x86-64 embeddable zip file, lot of big EXE files in distuils

2015-09-22 Thread Steve Dower

Changes by Steve Dower :


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

___
Python tracker 

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



[issue25085] Windows x86-64 embeddable zip file contains test directorys

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

The change is for two issues. I now filter out "Lib\*\test" and "Lib\*\tests" 
for this one, and bdist_wininst.py and *.exe for #25086. I believe that's what 
the suggestions were - the regular installer (that we've been discussing) 
wasn't mentioned in the original post.

(Adding site-packages to the set is a bit of tidying that I noticed while 
fixing the others. It doesn't have an issue anywhere.)

--

___
Python tracker 

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



[issue25166] Windows AllUsers installation places uninstaller in user profile

2015-09-22 Thread eryksun

eryksun added the comment:

Where is the API documented to change the install scope dynamically? I see 
where it's apparently defined in the burn manifest (extracted from the 
executable) as PerMachine="no":

http://schemas.microsoft.com/wix/2008/Burn;>
  <>
  
http://www.python.org/; 
 DisableModify="button"/>
  

--
nosy: +eryksun

___
Python tracker 

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



[issue25117] Windows installer: precompiling stdlib fails with missing DLL errors

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

Windows Updates may do something different here. I'd guess it's added to a 
queue and will be installed on next restart, probably based on something it 
detected as being in use, or maybe just because it's a server OS (or possibly 
both - typically a reboot isn't required to install the UCRT for the first 
time, but maybe an early prerelease version was there?).

--

___
Python tracker 

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



[issue22052] Comparison operators called in reverse order for subclasses with no override.

2015-09-22 Thread Martin Panter

Martin Panter added the comment:

Does anyone know enough about Python 2 to propose a fix? I don’t know enough 
about object classes versus “instance” classes, and potential interference of 
the __cmp__() method. In Python 2 the order seems to depend on the class type:

(<__main__.A instance at 0x7f730d37f5f0>, <__main__.B instance at 
0x7f730d37f518>)
(<__main__.B object at 0x7f730d37dc10>, <__main__.A object at 0x7f730d37d110>)

Or perhaps we should just close this now and forget about Python 2 ;)

--
stage:  -> needs patch
versions:  -Python 3.4, Python 3.5

___
Python tracker 

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



Re: sort help

2015-09-22 Thread Paul Rubin
Larry Martell  writes:
> def GetObjKey(a):
> return a[2]

This function is called operator.itemgetter:

from operator import itemgetter
sorted(a + b + c, key=itemgetter(2))

> So for example, if my initial data was this (I'll only show the fields
> involved with the sort - the first number is a[2] above and the second
> is the new additional sorting field, only present in a)

  sorted(sorted(a, key=itemgetter(5)) + b + c, key = itemgetter(2))

or whatever the new field (instead of 5) is for a.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25144] 3.5 Win install fails with "TARGETDIR"

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

Well, I made this happen once, but not a second time. That's better than most 
setup issues I get to deal with :)

Still working on it - will post when I figure it out.

--
assignee:  -> steve.dower

___
Python tracker 

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



[issue25162] Windows installation does not appear in list of installed applications

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

This is caused by the same configuration as issue 25166, so I'm closing this 
one as a duplicate.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> Windows AllUsers installation places uninstaller in user profile

___
Python tracker 

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



[issue16893] Generate Idle help from Doc/library/idle.rst

2015-09-22 Thread Martin Panter

Martin Panter added the comment:

The tests seem to have grown a new Deprecation Warning (triggered when run with 
python -bWall). Looks like this may be a side effect of revision 2d808b72996d.

[160/392] test_idle
/media/disk/home/proj/python/cpython/Lib/idlelib/EditorWindow.py:88: 
DeprecationWarning: EditorWindow.HelpDialog is no longer used by Idle.
It will be removed in 3.6 or later.
It has been replaced by private help.HelpWindow

  helpDialog = HelpDialog()  # singleton instance, no longer used

--
nosy: +martin.panter

___
Python tracker 

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



[issue25047] xml.etree.ElementTree encoding declaration should be capital ('UTF-8') rather than lowercase ('utf-8')

2015-09-22 Thread Martin Panter

Changes by Martin Panter :


--
assignee:  -> martin.panter
nosy: +berker.peksag
stage: patch review -> commit review

___
Python tracker 

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



[issue25166] Windows AllUsers installation places uninstaller in user profile

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

Not sure yet :)

There are a lot of undocumented (or not-yet-documented) APIs accessible from 
the bootstrap app and I haven't gone through them yet - see 
https://github.com/wixtoolset/wix3/tree/develop/src/libs, probably dutil.

It may also be something that we have to request or contribute to WiX.

--

___
Python tracker 

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



[issue25205] setattr accepts invalid identifiers

2015-09-22 Thread Martin Panter

Martin Panter added the comment:

Eryksun: If you mean tagging the bug report, I think we usually tag all the 
applicable open branches that are due for another release.

I’m not sure anything needs to be documented regarding setattr(). At best it is 
an implementation detail that should not be relied on, although making the 
implementation stricter could be a compatibility problem.

There are other places where troublesome names are allowed. One that caught my 
eye recently is os.sendfile(in=..., ...) is a syntax error, but you can still 
pass the “in” keyword via os.sendfile(**{"in": ...}, ...).

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

___
Python tracker 

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



[issue25085] Windows x86-64 embeddable zip file contains test directorys

2015-09-22 Thread Steve Dower

Changes by Steve Dower :


--
assignee:  -> steve.dower

___
Python tracker 

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



[issue25126] Non-web installer fails without a connection when doing debug install

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

Yeah, changing the item description is a good suggestion.

It basically doubles the size of the download to include everything all at once.

--
assignee:  -> steve.dower

___
Python tracker 

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



Re: Lightwight socket IO wrapper

2015-09-22 Thread James Harris
"Akira Li" <4kir4...@gmail.com> wrote in message 
news:mailman.18.1442804862.28679.python-l...@python.org...

"James Harris"  writes:
...

There are a few things and more crop up as time goes on. For example,
over TCP it would be helpful to have a function to receive a specific
number of bytes or one to read bytes until reaching a certain
delimiter such as newline or zero or space etc.


The answer is sock.makefile('rb') then `file.read(nbytes)` returns a
specific number of bytes.


Thanks, I hadn't seen that. Now I know of it I see references to it all 
over the place but beforehand it was in hiding


It is exactly the type of convenience wrapper I was expecting Python to 
have but expected it to be in another module. It looks as though it will 
definitely cover some of the issues I had.



`file.readline()` reads until newline (b'\n') There is Python Issue:
"Add support for reading records with arbitrary separators to the
standard IO stack"
 http://bugs.python.org/issue1152248
See also
 http://bugs.python.org/issue17083

Perhaps, it is easier to implement read_until(sep) that is best suited
for a particular case.


OK.

...

When sending it would be good to just say to send a bunch of bytes 
but
know that you will get told how many were sent (or didn't get sent) 
if

it fails. Sock.sendall() doesn't do that.


sock.send() returns the number of bytes sent that may be less than 
given.

You could reimplement sock.sendall() to include the number of bytes
successfully sent in case of an error.


I know. As mentioned, I wondered if there were already such functions to 
save me using my own.


I thought UDP would deliver (or drop) a whole datagram but cannot 
find

anything in the Python documentaiton to guarantee that. In fact
documentation for the send() call says that apps are responsible for
checking that all data has been sent. They may mean that to apply to
stream protocols only but it doesn't state that. (Of course, UDP
datagrams are limited in size so the call may validly indicate
incomplete transmission even when the first part of a big message is
sent successfully.)

Receiving no bytes is taken as indicating the end of the
communication. That's OK for TCP but not for UDP so there should be a
way to distinguish between the end of data and receiving an empty
datagram.


There is no end of communication in UDP and therefore there is no end 
of

data. If you've got a zero bytes in return then it means that you've
received a zero length datagram.

sock.recvfrom() is a thin wrapper around the corresponding C
function. You could read any docs you like about UDP sockets.

http://stackoverflow.com/questions/5307031/how-to-detect-receipt-of-a-0-length-udp-datagram


As mentioned to Dennis just now, I would prefer to write code to conform 
with the documented behaviour of Python and its libraries, as long as 
they were known to be reliable implementations of what was documented, 
of course.


I agree with what you say. A zero-length UDP datagram should be possible 
and not indicate end of input but is that guaranteed and portable? 
(Rhetorical.)  It seems not. Even the Linux man page for recv says: "If 
no  messages  are  available  at  the  socket, the receive calls wait 
for a message to arrive, unless the socket is nonblocking" In that 
case, of course, what it defines as a "message" - and whether it can be 
zero length or not - is not stated.



The recv calls require a buffer size to be supplied which is a
technical detail. A Python wrapper could save the programmer dealing
with that.


It is not just a buffer size. It is the maximum amount of data to be
received at once i.e., sock.recv() may return less but never more.


My point was that we might want to request the entire next line or next 
field of input and not know a maximum length. *C* programmers are used 
to giving buffers fixed sizes often because then they can avoid fiddling 
with memory management but Python normally does that for us. I was 
suggesting that the thin wrapper around the socket recv() call is too 
thin! The makefile() approach that you mentioned seems more Pythonesque, 
though.



You could use makefile() and read() if recv() is too low-level.


Yes.

James

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


Re: A little test for you Guys

2015-09-22 Thread James Harris
On Tuesday, September 22, 2015 at 7:45:00 PM UTC+1, Lj Fc wrote:
> you have 10 minutes Good luck!!

A good set of questions, IMO. Am answering as someone coming back to Python 
after a few years.

> 1. What is PEP8 ?

Coding guidelines, I think.

> 2. What are the different ways to distribute some python source code ?

I don't know what that's getting at as it specifically mentions source code 
apart from tar/gzip or zip. Maybe git or other scm?

> 2 Lists
> 
> Let's define the function plural :
> 
> def plural(words):
> plurals = []
> for word in words:
>plurals.append(word + 's')
> return plurals
> 
> for word in plural(['cabagge','owl','toy']):
> print word
> 
> Question : How could the code of the function plural be optimised?

I would go for

  [word + 's' for word in words]

> 3 Dictionaries
> 
> Here are two dictionnaries :
> 
> input = {
> 'foo1': 'bar1',
> 'chose': 'truc',
> 'foo2': 'bar2',
> }
> output = {
> 'bar1': 'foo1',
> 'truc': 'chose',
> 'bar2': 'foo2'
> }
> 
> Question : Propose a function that returns output when you provide input ?

  def f(input):
output = {}
for k,v in input.items():
  output[v] = k
return output

> 4 Iterators
> 
> Let's consider this program :
> 
> def program_1():
> yield 1
> yield 2
> yield 3
> 
> g = program_1()
> a = list(g)
> b = list(g)
> c = g()
> 
> Question : At the end of the program,
> 
> 1. What is the type of g ?
> 2. What is the value of a ?
> 3. What is the value of b ?
> 4. What is the value of c ?

Good one. I checked this and only got 1 and 2 right.

> 5 Decorators

No idea!

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


Re: Lightwight socket IO wrapper

2015-09-22 Thread Marko Rauhamaa
"James Harris" :

> I agree with what you say. A zero-length UDP datagram should be
> possible and not indicate end of input but is that guaranteed and
> portable?

The zero-length payload size shouldn't be an issue, but UDP doesn't make
any guarantees about delivering the message. Your UDP application must
be prepared for some, most or all of the messages disappearing without
any error indication.

In practice, you'd end up implementing your own TCP on top of UDP
(retries, timeouts, acknowledgements, sequence numbers etc).


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


[issue25159] Regression in time to import a module

2015-09-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I just have rebuilt my Python's in development brances after made distclean to 
avoid possible effects of incremental building, and got the same results.

(1) for i in `seq 5`; do ./python -I -m timeit -n1 -r1 -s "import sys; 
sys.modules.clear()" -- "import enum"; done

Python 3.4: 29 msec
Python 3.5: 43.4 msec (+50%)
Python 3.6: 44.4 msec (+2%, +53%)


(2) for i in `seq 5`; do ./python -I -m timeit "import enum"; done

Python 3.4: 3.02 usec
Python 3.5: 3.14 usec (+4%)
Python 3.6: 3.34 usec (+6%, +10%)


(3) for i in `seq 5`; do ./python -I -m timeit -n1 -r1 "import enum"; done

Python 3.4: 3.49 msec
Python 3.5: 4.19 msec (+20%)
Python 3.6: 4.45 msec (+6%, +28%)


32-bit Ubuntu 14.04, Linux 3.16, gcc 4.8.4, Intel(R) Atom(TM) CPU N570   @ 
1.66GH.

--

___
Python tracker 

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



[issue25092] Regression: test_datetime fails on 3.5, Win 7, works on 3.4

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

Arguably it's because of the platforms that don't reliably set errno. (I don't 
know exactly which those are, but I'm not about to enable it everywhere right 
now. If someone else wants to do it and deal with the fallout they're welcome.)

--

___
Python tracker 

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



Re: Python, convert an integer into an index?

2015-09-22 Thread Ian Kelly
On Sep 22, 2015 3:46 PM, "Chris Roberts"  wrote:
>
>
> (How do I make it into an index? )
> Preferably something fairly easy to understand as I am new at this.
>
> results = 134523  #(Integer)
>
> Desired:
> results = [1, 2, 3, 4, 5, 2, 3]   #(INDEX)
>
> Somehow I see ways to convert index to list to int, but not back again.

I'm not sure what you mean by "index" in this context, but do you just want
to convert the integer into a list of its digits? The simple way is to
convert it to a string, then convert each character back to an int, and put
the results into a list. More efficient way would be to strip the digits
off one at a time by dividing modulo 10.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: problem building python 3.5 extensions for windows

2015-09-22 Thread Terry Reedy

On 9/22/2015 9:35 AM, Robin Becker wrote:

On 22/09/2015 11:14, Robin Becker wrote:

On 22/09/2015 01:36, cjgoh...@gmail.com wrote:

.t

.


Thanks for the pointer Christoph.

I certainly didn't let it run for 30 minutes. When I build with 2.7,
3.3 or 3.4
the whole build including reportlab stuff is over in a couple of
minutes. I will
try again, but a linker that takes 30 minutes to create an extension
that ends
up 204Kb long has to be seriously broken. Is it trying to hard? Most
of the code
size is in arrays for code points etc etc.


I timed my builds of pyRXPU for x86 + amd64; these are on a core i5-3470
@ 3.20Ghz with 4Gb memory.

python 3.4   1 minute  14 seconds
python 3.5  52 minutes 50 seconds

so with VS2015 it will now take me an hour to make and test any changes
to this extension. I don't see how the issue can be considered closed.
VS2015 is clearly not the way forward for any reasonable development
process.


I think you should add the above to the issue.

--
Terry Jan Reedy

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


Re: A little test for you Guys

2015-09-22 Thread James Harris
 wrote in message 
news:5218c7f9-74ea-4ca0-abd1-46a9bcd3d...@googlegroups.com...


...


Pretty sure this guy is asking us to do his homework.  :-P


Maybe (and I hope not) but asking what PEP8 is could be easily found on 
the internet and asking what the values would be at the end of the 
program in question 4 could be easily found by trying it.


James

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


Re: problem building python 3.5 extensions for windows

2015-09-22 Thread cjgohlke
On Tuesday, September 22, 2015 at 1:49:16 PM UTC-7, Terry Reedy wrote:
> On 9/22/2015 9:35 AM, Robin Becker wrote:
> > On 22/09/2015 11:14, Robin Becker wrote:
> >> On 22/09/2015 01:36, CG wrote:
> > .t
> >>> .
> >>>
> >> Thanks for the pointer Christoph.
> >>
> >> I certainly didn't let it run for 30 minutes. When I build with 2.7,
> >> 3.3 or 3.4
> >> the whole build including reportlab stuff is over in a couple of
> >> minutes. I will
> >> try again, but a linker that takes 30 minutes to create an extension
> >> that ends
> >> up 204Kb long has to be seriously broken. Is it trying to hard? Most
> >> of the code
> >> size is in arrays for code points etc etc.
> >
> > I timed my builds of pyRXPU for x86 + amd64; these are on a core i5-3470
> > @ 3.20Ghz with 4Gb memory.
> >
> > python 3.4   1 minute  14 seconds
> > python 3.5  52 minutes 50 seconds
> >
> > so with VS2015 it will now take me an hour to make and test any changes
> > to this extension. I don't see how the issue can be considered closed.
> > VS2015 is clearly not the way forward for any reasonable development
> > process.
> 
> I think you should add the above to the issue.
> 
> -- 
> Terry Jan Reedy

It's a compiler bug. To work around, disable compiler optimizations, i.e. set 
`extra_compile_args=['/Od']` in setup.py.

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


Python, convert an integer into an index?

2015-09-22 Thread Chris Roberts

(How do I make it into an index? )
Preferably something fairly easy to understand as I am new at this.

results = 134523  #(Integer) 

Desired: 
results = [1, 2, 3, 4, 5, 2, 3]   #(INDEX)

Somehow I see ways to convert index to list to int, but not back again.

Thanks, 
crzzy1
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25116] It failed to install Py3.5 on win2008R2

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

If you could provide more information, that would be helpful.

In particular, there may be some entries in the Event Log around the time you 
were trying to install 3.5, if nothing popped up at all. There may also be log 
files in your %TEMP% directory.

--
components: +Windows
nosy: +paul.moore, tim.golden, zach.ware

___
Python tracker 

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



[issue25085] Windows x86-64 embeddable zip file contains test directorys

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

True, those files aren't needed in the embeddable distro.

Terry - you're right, if someone chooses to install Tcl/Tk/idle then they'll 
get the tests for them as well, regardless of their test suite selection. Since 
we're not really talking about a lot of files, I'd rather leave them this way 
(which I think is what you're also suggesting?) than deal with the 
cross-installer dependencies that would exist otherwise.

--

___
Python tracker 

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



[issue25209] Append space after completed keywords

2015-09-22 Thread Martin Panter

Martin Panter added the comment:

“Else” doesn’t always use a colon. Consider “1 if x else 2”. Again, if Python 
started adding unwanted spaces and colons I imagine users could be annoyed and 
think Python is being too smart and complicated for its own good. But maybe see 
what others say.

--

___
Python tracker 

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



[issue20519] Replace uuid ctypes usage with an extension module.

2015-09-22 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue25124] No single .msi available for 3.5 release

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

The decision cannot reasonably be reversed now - this sort of passionate 
feedback was really needed during the alphas to have any impact. I'm sorry you 
didn't feel the need to participate in Python's development, as this extra 
feedback would have been useful.

For most users who are installing Python for themselves, the bundle launcher 
provides a much better experience. As well as CRT detection, it also allows 
true per-user installation as well as decoupling tasks such as precompiling 
.pyc files from installing components and enabling the web installers. There is 
also a more reliable upgrade mechanism that retains previous settings and the 
launcher is now correctly reference counted (though there will be conflicts 
with the 2.7 and 3.4 installer...).

After discussions at PyCon US in April, I chose to make the per-user 
installation the default as it best fits the user segment we (as a development 
team) are most concerned about. Administrators who are deploying across a 
network do now need to work harder than before, which we considered a fair 
tradeoff for non-admin users to be able to install and use Python.

If you much prefer MSIs, you can pass the /layout option to the wrapper and 
obtain the raw MSIs and install them individually (passing 
"TARGETPATH=location" as a property). However, I think the documentation for 
the launcher options (https://docs.python.org/3.5/using/windows.html) is much 
better than anything we had in the past (I had nothing to do with the old 
installer, but had to regularly decompile it to diagnose installation issues).

So thankyou for the feedback, but on balance between administrators and 
individual users we've decided to help save individual users from having to 
read documentation, at the expense of needing administrators to refer to the 
instructions to do automated installation.

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

___
Python tracker 

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



[issue23630] support multiple hosts in create_server/start_server

2015-09-22 Thread Yann Sionneau

Yann Sionneau added the comment:

Thanks a lot Victor for your numerous reviews and your help on this!
Also thanks for all other who commented.

--

___
Python tracker 

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



[issue25103] 3.5.0 installed standard library on Windows has LF line endings

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

Yeah, this was just me forgetting to enable eol when I last recreated my build 
machine. It's on now, so the next release will be fine.

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

___
Python tracker 

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



[issue25112] Windows installer assigns non-existent icons to Python file types

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

The file associations are actually part of the launcher, which *technically* is 
independent of the Python install it is bundled with. So it doesn't have any 
references to the Python install directory, and double-clicking Python files 
with shebang lines will work properly.

For 3.5.1 I'm considering making the launcher an independent uninstall item (in 
response to another issue), so if you install 3.5.1 and then remove it, you can 
keep the launcher. For this to work, it has to be independent of the main 
install, so it can't refer to the DLLs directory.

--

___
Python tracker 

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



Re: A little test for you Guys

2015-09-22 Thread Ian Kelly
On Tue, Sep 22, 2015 at 3:18 PM,   wrote:
> On Tuesday, September 22, 2015 at 11:45:00 AM UTC-7, Lj Fc wrote:
>> you have 10 minutes Good luck!!
>
> Pretty sure this guy is asking us to do his homework.  :-P

Well, looks like it was due 2 hours ago.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25213] Regression: Python 3.5.0 shutil.copy2 doesn't raise PermissionError on Windows 7

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

Confirmed. I have a trivial fix coming to restore the requestedExecutionLevel.

--
assignee:  -> steve.dower

___
Python tracker 

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



[issue25086] Windows x86-64 embeddable zip file, lot of big EXE files in distuils

2015-09-22 Thread Steve Dower

Steve Dower added the comment:

Good catch, none of the bdist_wininst command is really needed. I'll drop it.

--
assignee:  -> steve.dower

___
Python tracker 

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



[issue16893] Generate Idle help from Doc/library/idle.rst

2015-09-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 26e819909891 by Terry Jan Reedy in branch '2.7':
Issue #16893: Move idlelib.EditorWindow.HelpDialog deprecation warning
https://hg.python.org/cpython/rev/26e819909891

New changeset c607004a98bf by Terry Jan Reedy in branch '3.4':
Issue #16893: Move idlelib.EditorWindow.HelpDialog deprecation warning
https://hg.python.org/cpython/rev/c607004a98bf

--

___
Python tracker 

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



[issue16893] Generate Idle help from Doc/library/idle.rst

2015-09-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Through the contributions of several people, Zack's key idea, that Idle 
documentation should have a single source, idle.rst, has come to fruition. So I 
think it time to close this.  I already mentioned #25198 for improving the 
tkinter viewer. I also opened #25218 for revising Zack's patch and possibly 
using an 'idledoc' target in the release process.

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

___
Python tracker 

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



[issue22834] Unexpected FileNotFoundError when current directory is removed

2015-09-22 Thread Christopher Meng

Changes by Christopher Meng :


--
nosy: +Christopher Meng

___
Python tracker 

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



[issue16893] Generate Idle help from Doc/library/idle.rst

2015-09-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Thank you for reporting this. My general problem is that idlelib was only 
informally private until PEP434 and I only started adding 'private' and 
'deprecated' to the code a week ago.  So I am trying to make changes in 
existing versions while not breaking even unlikely uses of the current API. The 
specific problem is the the class init method *is* used -- to create an unused 
instance -- on import.

  helpDialog = HelpDialog()  # singleton instance, no longer used

The patch fixes the problem by moving the deprecation to the show method, which 
Idle really does not now call.

--

___
Python tracker 

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



Re: Successfully send sms with python

2015-09-22 Thread Michael Torrie
On 09/22/2015 05:19 AM, Timon Rhynix wrote:
> When run it, the "message sent!" is printed but no message is sent/delivered.
> Please assist on what I am missing. Thank you

Is this "message sent!" from your code or is it a message you get back
on the serial port from the gsm modem? Oh nevermind I see that it comes
from your own code.

Just an observation, but your code looks quite Java-like. Seems to me
that wrapping this up in a class is not necessary, since the goal is to
provide an interface to send a text message, I'd just use a plain
function, stored in its own module so it can also store things like the
name of the serial port, timeout values, etc. There's no need to make
the caller save any state.

Consider something like this with no error checking when using the
serial port, no context managers for the serial device:
file sms.py:
--
import serial
import time

serial_port = 'COM13'
timeout = 5
baud = 460800

def send_message(recipient, message):
ser = serial.Serial(serial_port, baud, timeout=timeout)
time.sleep(1)
self.ser.write('ATZ\r')
time.sleep(1)
self.ser.write('AT+CMGF=1\r')
time.sleep(1)
self.ser.write('''AT+CMGS="''' + self.recipient + '''"\r\n''')
time.sleep(1)
self.ser.write(self.content + "\r\n")
time.sleep(1)
self.ser.write(chr(26))
time.sleep(1)
print "message sent!"

ser.close()


Someone can just do:

import sms
sms.serial_port = "/dev/ttyUSB2"
sms.send_message("555","Hi there")

Call it good.  Unlike Java, Python does not require everything to be
wrapped up in a class.  Particularly if what you really want is a
singleton.  In many respects you can treat a python module (a python
file) as a singleton.  You can use its namespace to store some state or
basic config information, and define the functions you want others to
use.  Private helper functions can start with an underscore, telling
others not to use them.

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


[issue22555] Tracking issue for adjustments to binary/text boundary handling

2015-09-22 Thread Nick Coghlan

Nick Coghlan added the comment:

The Fedora RFE at https://bugzilla.redhat.com/show_bug.cgi?id=902094 to provide 
a C.UTF-8 locale by default has been addressed for Fedora 24 (the current 
Fedora Rawhide).

This means the "LANG=C.UTF-8 python3" replacement for the ASCII-centric "LANG=C 
python3" will become more widely available over the course of 2016.

--

___
Python tracker 

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



Line by Line Debug Python Scripts In GDB

2015-09-22 Thread Jondy Zhao
There is a gdb extension "libpython.py" within Python sources, it could print 
Python frame, locals/globals variable, Python sources in GDB. But it couldn't 
set breakpoints in Python scripts directly. Finally, I decided to write a 
debugger to extend GDB could debug Python scripts line by line, just like 
debugging c/c++.

This project is published in github, https://jondy.github.io/pyddd

The purpose of this project is to debug Python scripts line by line as debug 
C/C++ in GDB, so that we can easily debug Python scripts and C/C++ extensions 
within GDB.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24455] IDLE debugger causes crash if not quitted properly before next run

2015-09-22 Thread Mark Roseman

Mark Roseman added the comment:

Like #15347 and #15348, this was also caused by nested event loops, though the 
exact problem is slightly different.  I've attached fix-mainloop2.patch which 
has a lengthy comment explaining the problem and how the patch solves it. 

This patch also includes the changes from fix-nested-mainloop.patch.

--
keywords: +patch
Added file: http://bugs.python.org/file40553/fix-mainloop2.patch

___
Python tracker 

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



[issue25218] Automate creation of idlelib/help.html from Doc/.../idle.html

2015-09-22 Thread Terry J. Reedy

New submission from Terry J. Reedy:

This continues #16893, which replaced help.txt with help.html for the Idle doc 
display.  It also replaced the display classes with new classes in help.py.  I 
currently create help.html in a .bat file.  With Doc as current directory, it 
uses
  ..\pcbuild\python_d.exe -c "from idlelib.help import copy_strip; copy_strip()"
With a change to the help.py if __name__ block so that
  ..\pcbuild\python_d.exe -m idlelib.help copy_strip
would work.

This issue is first about revising Zack Ware's makefile patch, 
https://bugs.python.org/file36975/issue16893-v4.diff, which adds an 'idledoc' 
target.  It is attached to #16893.  It needs 'copy' replaced by 'copy, strip, 
and rename'. The command above requires finding a compatible python.exe, and I 
do not know if that is a problem.

In normal use, 'idledoc' should only be invoked for the earliest 3.x getting 
maintenance patches, and the result merged forward.

If this is resolved, it would be nice if the new 'idledoc' target were built as 
apart of the release process, and any changes checked in.  But the latter 
should currently still be done for all 3.x branches

--
assignee: terry.reedy
messages: 251402
nosy: terry.reedy, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Automate creation of idlelib/help.html from Doc/.../idle.html
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



  1   2   >