[issue28458] from __future__ import print_function does not emulate the flush param from py3k

2016-10-17 Thread Attila-Mihaly Balazs

New submission from Attila-Mihaly Balazs:

Doing the following in Python 2.7.12 does not work:

from __future__ import print_function
print(1, flush=True)

It says: "'flush' is an invalid keyword argument for this function"

While the following is a perfectly valid python 3k statement:

print(1, flush=True)

--
components: Library (Lib)
messages: 278797
nosy: Attila-Mihaly Balazs
priority: normal
severity: normal
status: open
title: from __future__ import print_function does not emulate the flush param 
from py3k
versions: Python 3.7

___
Python tracker 

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



[issue28458] from __future__ import print_function does not emulate the flush param from py3k

2016-10-17 Thread Berker Peksag

Berker Peksag added the comment:

That's because the flush argument was added in Python 3.3 (after print() was 
backported to 2.7 via a future import)

Thanks for the report.

--
nosy: +berker.peksag
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue28441] sys.executable is ambiguous on Cygwin without .exe suffix

2016-10-17 Thread Erik Bray

Erik Bray added the comment:

I agree this has a slight change in behavior which I was at first hesitant 
about.  But I think the previous behavior was wrong insofar as it was overly 
ambiguous.  I agree it should apply on MSYS2 as well (I actually thought 
__CYGWIN__ was defined on MSYS2 but I could be wrong about that).

I'm not sure what better solution there is.  I thought of tinkering with 
subprocess specifically, but that was too fragile.

--

___
Python tracker 

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



[issue24881] _pyio checks that `os.name == 'win32'` instead of 'nt'

2016-10-17 Thread Erik Bray

Erik Bray added the comment:

FWIW this patch broke the _pyio module on Cygwin, as the msvcrt module is not 
built on Cygwin.  AFAICT this is only a problem for Python built with MSVCRT, 
which Cygwin does not use.  When test case works as expected on Cygwin without 
this.

--
nosy: +erik.bray

___
Python tracker 

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



[issue24881] _pyio checks that `os.name == 'win32'` instead of 'nt'

2016-10-17 Thread STINNER Victor

STINNER Victor added the comment:

"FWIW this patch broke the _pyio module on Cygwin,"

Please open a new issue, this one is closed.

--

___
Python tracker 

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



[issue28459] _pyio module broken on Cygwin / setmode not usable

2016-10-17 Thread Erik Bray

New submission from Erik Bray:

Since the patch to #24881 was merged the _pyio module has been non-importable 
on Cygwin, due to an attempt to import from the msvcrt module.

However, the msvcrt module is not built on Cygwin (Cygwin does not use MSVCRT). 
 Cygwin's libc does, however, have _setmode.

The problem this is trying to solve is to call _setmode 
(https://msdn.microsoft.com/en-us/library/tw4k6df8.aspx) on file descriptors to 
ensure that they are O_BINARY instead of O_TEXT (a distinction that needs to 
made on Windows).

Fortunately, on Cygwin, it is fairly rare that a file descriptor will have mode 
O_TEXT, but it it is possible.  See 
https://cygwin.com/faq/faq.html#faq.programming.msvcrt-and-cygwin

This could be tricky to solve though.  Removing setmode() call entirely works 
for me as far as the test suite is concerned.  But it leaves _pyio slightly 
incongruous with the C implementation in this one small aspect, and it *is* a 
bug.

I would propose for Python 3.7 adding an os.setmode() function.  On Windows 
this could be simply an alias for msvcrt.setmode() (or vice-versa).  But 
because setmode() is available also in Cygwin (and technically some other 
platforms too, though none that are currently supported by Python) it would be 
a good candidate for inclusion in the os module I think (for those platforms 
that have it).

--
components: IO
messages: 278802
nosy: erik.bray
priority: normal
severity: normal
status: open
title: _pyio module broken on Cygwin / setmode not usable
type: crash

___
Python tracker 

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



[issue27806] 2.7 32-bit builds fail on macOS 10.12 Sierra due to dependency on deleted header file QuickTime/QuickTime.h

2016-10-17 Thread Lapsang Leaf

Lapsang Leaf added the comment:

Can we have this in English, please, for noobs?

I only use python in order to run zim on my mac. I do not have the same 
technical know-how as many users and I do not understand the parlance here.  
Currently I have OS X 10.12 with python 2.7 - updating to sierra seems to have 
broken it.

Please let me know, step by step, what I need to do to patch and get it running 
again.  Thanks

--
nosy: +Lapsang Leaf

___
Python tracker 

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



[issue28460] Minidom, order of attributes, datachars

2016-10-17 Thread Petr Pulc

New submission from Petr Pulc:

Hello,
just an idea for improvement of minidom.

Sometimes it is not convenient that the element attributes are sorted 
alphabetically.

Usually, users do hack the minidom file themselves to force some behaviour, yet 
the order can be quite nicely defined by the DTD, for example.

More on the "issue" side is another idea for improvement. Not all special 
characters do need to be changed to entities. For example, only < needs to be 
changed to entity in text data. I guess, that the _write_data function could be 
then diminished as well...

What do you mean of these two ideas? Comments will be appreciated.

--
components: XML
messages: 278804
nosy: Petr Pulc
priority: normal
severity: normal
status: open
title: Minidom, order of attributes, datachars
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue8376] Tutorial offers dangerous advice about iterators: “__iter__() can just return self”

2016-10-17 Thread loic rowe

loic rowe added the comment:

A new proposal is to add at the end of the paragraph on the iterator those 
point:
"""
As you should have noticed this Reverse let you iterate over the data only 
once::

   >>> rev = Reverse('spam')
   >>> for char in rev:
   ... print(char)
   ...
   m
   a
   p
   s
   >>> for char in rev:
   ... print(char)
   ...
   >>>

So now let's complete our example to have a container that allow you to iterate 
over his items backwards::

  class ReverseList(object):
   "Container that lets you iterate over the items backwards"
   def __init__(self, data):
   self.data = data
   def __iter__(self):
   return ReverseIterator(self.data)

   class ReverseIterator(object):
   "Iterator for looping over a sequence backwards"
   def __init__(self, data):
   self.data = data
   self.index = len(data)
   def __iter__(self):
   return self
   def next(self):
   if self.index == 0:
   raise StopIteration
   self.index = self.index - 1
   return self.data[self.index]

   >>> rev = ReverseList([1,2,3])
   >>> for char in rev:
   ... print (char)
   ...
   3
   2
   1
   >>> for char in rev:
   ... print (char)
   ...
   3
   2
   1
"""

--

___
Python tracker 

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



[issue28404] Logging SyslogHandler not appending '\n' to the end

2016-10-17 Thread José Manuel

José Manuel added the comment:

Sorry to bother you again, but I've tested this not only with Fluentd, but with 
a RSYSLOG server and it does not work with TCP except if you manually add the 
trailer LF character. Other than that, UDP default transport protocol has no 
issues and works fine with both systems. Here's my simple code:

---
sHandler = logging.handlers.SysLogHandler(address=(address[0], address[1]), 
socktype = socket.SOCK_STREAM)
sHandler.setFormatter(logging.Formatter(fmt=MSG_SYSLOG_FORMAT, 
datefmt=DATE_FMT))
self.addHandler(sHandler)
---

After reading RFC 6587 I think the SyslogHandler class should implement at 
least one of the framing mechanisms proposed by this RFC, meant for TCP 
transmission:
- Octet counting
- Trailer character (e.g. LF)

Besides, I've being checking out the library "pyloggr" 
(https://github.com/stephane-martin/pyloggr) and they are implementing both 
mechanisms. As for SyslogHandler, it will be as simple as adding another field 
to the class constructor (use_delimiter?) and to add these lines to the emit 
code (it works):

---
if (self.use_delimiter):
msg = msg + '\n'
else:
msg = str(len(msg)) + ' ' + msg # default behavior
---

Thank you again

--
status: closed -> pending

___
Python tracker 

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



[issue28461] Replacement of re with the regex package

2016-10-17 Thread Pierre Nugues

New submission from Pierre Nugues:

I am using Unicode regexes in the form of properties: \p{} and these are not 
standard in the re module. I have to use the new regex module, which has to be 
installed separately.

I would like to see the replacement of re with regex in the future Python 
versions. I was not sure where to post my request and I used this bug tracker 
with the enhancement category. I hope this is not a mistake.

--
components: Regular Expressions
messages: 278806
nosy: ezio.melotti, mrabarnett, pnugues
priority: normal
severity: normal
status: open
title: Replacement of re with the regex package
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue28461] Replacement of re with the regex package

2016-10-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See issue12734 for adding the support of properties in re.

See issue2636 for replacing re with regex.

See issue22594 for encouraging the use of regex.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Adding a new regex module (compatible with re)

___
Python tracker 

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



[issue28462] subprocess pipe can't see EOF from a child in case of a few children run with subprocess

2016-10-17 Thread Vyacheslav Grigoryev

New submission from Vyacheslav Grigoryev:

I'm creating a master stand-alone module on Python which should run some 
children via subprocess module. Working with children is done in separate 
worker threads. Additionally I need to receive real-time output from a child so 
in a worker thread I also create reader helper thread which reads on a pipe 
from the child.

All is working correctly while I have only one worker thread and run only one 
child. When the child finishes the reader helper thread gets EOF and exits. But 
when I have two worker threads and run two children, a pipe from early child 
doesn't see EOF until the second child is finished. Though they are completely 
unrelated.

Let's take a look on simplest example for reproducing the problem. There is a 
simplest child:
--
import time, sys

# first arg is an ID. Second arg is how long to work in seconds
sys.stdout.write("start slave %s\n" % sys.argv[1])
sys.stdout.flush()

time.sleep(int(sys.argv[2]))

sys.stdout.write("finish slave %s\n" % sys.argv[1])
sys.stdout.flush()
--

And there is a master module:
--
import subprocess, sys, os, threading, time

g_logLock = threading.Lock()

def log(msg):
with g_logLock:
t = time.time()
print "%s.%03d %-5s %s" % \
(time.strftime('%H:%M:%S', time.localtime(t)), int((t - t // 1) * 
1000), threading.currentThread().name, msg)

def thread1Proc():
def reader(stdout):
while True:
line = stdout.readline()
if not line:
break
log('slave said: %s' % line.strip())
log('finish slave reader thread')

log('thread 1 started')
timeToWork = '1'
util = subprocess.Popen((sys.executable, 'slave.py', '1', timeToWork), 
stdout=subprocess.PIPE)
readerT = threading.Thread(target=reader, args=(util.stdout,), name='t1-r')
readerT.start()
log('slave 1 returned %d' % util.wait())
readerT.join()
log('thread 1 finished')

def thread2Proc():
log('thread 2 started')
timeToWork = '3'
util = subprocess.Popen((sys.executable, 'slave.py', '2', timeToWork))
log('slave 2 returned %d' % util.wait())
log('thread 2 finished')

#---
log('starting test')

threads = (threading.Thread(target=thread1Proc, name='t1'), 
threading.Thread(target=thread2Proc, name='t2'))
for t in threads:
t.start()
for t in threads:
t.join()

log('finished test')
--

Here is what I see on the output (note - slave 1 outputs to the master via 
pipe, while slave 2 outputs to a console because its output is not redirected):

>master.py
08:57:31.342 MainThread starting test
08:57:31.342 t1thread 1 started
08:57:31.342 t2thread 2 started
08:57:31.405 t1-r  slave said: start slave 1
start slave 2
08:57:32.420 t1-r  slave said: finish slave 1
08:57:32.420 t1slave 1 returned 0
finish slave 2
08:57:34.415 t1-r  finish slave reader thread
08:57:34.415 t2slave 2 returned 0
08:57:34.415 t1thread 1 finished
08:57:34.431 t2thread 2 finished
08:57:34.431 MainThread finished test

Here you can see that even if the slave 1 finishes at 32.420, its reader thread 
receives EOF and exits only when the slave 2 finishes also - at 34.415 (slave 1 
works 1 second, slave 2 - 3 seconds).

Why the reader thread doesn't see EOF just in time?

The issue is reproduced in Python 2.7.12 x86 on Windows 7. On Linux Ubuntu 
16.04 with system Python 2.7 all works as expected.

--
components: Library (Lib)
messages: 278809
nosy: Vyacheslav Grigoryev
priority: normal
severity: normal
status: open
title: subprocess pipe can't see EOF from a child in case of a few children run 
with subprocess
type: behavior
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



[issue21429] Input.output error with multiprocessing

2016-10-17 Thread Florijan Hamzic

Florijan Hamzic added the comment:

Hi,

i have a similiar issue:

i have a really simple scenario

Callee:
```
@classmethod
def MoveDataToOtherSide(cls, model)
data = {
"FirstName": model.FirstName,
"LastName": model.LastName,
"Email": model.Email,
"Pass": model.Password,
"Images": cls.LoadUserImages(model.ID)
}

p = Process(target=UserService.MoveProfileToOtherSide, kwargs={"data": 
data})
p.start()
```

Processeee
```
@staticmethod
def MoveProfileToOtherSide(data): requests.get("https://mySecretUrl.de";, 
params={"token": "secBlub", "data": encode(data, unpicklable=False)})
```

I think it has something todo with stdout but i have no clue how i could debug 
this further, unfortunetely. 

The Application around this functionality (UserService) is cherrypy.

--
nosy: +Florijan Hamzic

___
Python tracker 

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



[issue27806] 2.7 32-bit builds fail on macOS 10.12 Sierra due to dependency on deleted header file QuickTime/QuickTime.h

2016-10-17 Thread Jeremy Sequoia

Jeremy Sequoia added the comment:

QuickTime/QuickTime.h was deprecated long ago.

python fails to compile if QuickTime/QuickTime.h isn't present.

QuickTime/QuickTime.h was removed in Sierra, causing the build to fail on 
Sierra.

This patch fixes that issue.

> On Oct 17, 2016, at 05:23, Lapsang Leaf  wrote:
> 
> 
> Lapsang Leaf added the comment:
> 
> Can we have this in English, please, for noobs?
> 
> I only use python in order to run zim on my mac. I do not have the same 
> technical know-how as many users and I do not understand the parlance here.  
> Currently I have OS X 10.12 with python 2.7 - updating to sierra seems to 
> have broken it.
> 
> Please let me know, step by step, what I need to do to patch and get it 
> running again.  Thanks
> 
> --
> nosy: +Lapsang Leaf
> 
> ___
> Python tracker 
> 
> ___

--
Added file: http://bugs.python.org/file45123/smime.p7s

___
Python tracker 

___

smime.p7s
Description: S/MIME cryptographic signature
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27806] 2.7 32-bit builds fail on macOS 10.12 Sierra due to dependency on deleted header file QuickTime/QuickTime.h

2016-10-17 Thread Lapsang Leaf

Lapsang Leaf added the comment:

Yes, I understood that part, sorry.  What I don’t understand is how to 
work/install the patch you have provided?
So, again, please let me know, step by step, what I need to do to patch and get 
it running.  Thanks

> On 17 Oct 2016, at 17:04, Jeremy Sequoia  wrote:
> 
> 
> Jeremy Sequoia added the comment:
> 
> QuickTime/QuickTime.h was deprecated long ago.
> 
> python fails to compile if QuickTime/QuickTime.h isn't present.
> 
> QuickTime/QuickTime.h was removed in Sierra, causing the build to fail on 
> Sierra.
> 
> This patch fixes that issue.
> 
>> On Oct 17, 2016, at 05:23, Lapsang Leaf  wrote:
>> 
>> 
>> Lapsang Leaf added the comment:
>> 
>> Can we have this in English, please, for noobs?
>> 
>> I only use python in order to run zim on my mac. I do not have the same 
>> technical know-how as many users and I do not understand the parlance here.  
>> Currently I have OS X 10.12 with python 2.7 - updating to sierra seems to 
>> have broken it.
>> 
>> Please let me know, step by step, what I need to do to patch and get it 
>> running again.  Thanks
>> 
>> --
>> nosy: +Lapsang Leaf
>> 
>> ___
>> Python tracker 
>> 
>> ___
> 
> --
> Added file: http://bugs.python.org/file45123/smime.p7s
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue28409] test.regrtest does not support multiple -x flags

2016-10-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset af06d9616c29 by Victor Stinner in branch '3.5':
Issue #28409: regrtest: fix the parser of command line arguments.
https://hg.python.org/cpython/rev/af06d9616c29

New changeset 26249f82c15d by Victor Stinner in branch '3.6':
Merge 3.6: Issue #28409: regrtest: fix the parser of command line arguments.
https://hg.python.org/cpython/rev/26249f82c15d

New changeset 9f03b3dbb929 by Victor Stinner in branch 'default':
Merge 3.7: Issue #28409: regrtest: fix the parser of command line arguments.
https://hg.python.org/cpython/rev/9f03b3dbb929

--
nosy: +python-dev

___
Python tracker 

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



[issue28409] test.regrtest does not support multiple -x flags

2016-10-17 Thread STINNER Victor

STINNER Victor added the comment:

Thanks for the bug report Charalampos! It's now fixed.

--

> Until python3.6.0a04 it was possible to pass multiple times the -x option at 
> regrtest.

To be clear: the regrtest parser of command line argument was broken since 
Python 2.7 at least.

"./python -m test.regrtest -v test_binop -v test_unaryop" on Python 2.7 tries 
to run "-v" test...

I fixed Python 3.5, 3.6 and 3.7, but not Python 2.7. Python 3 uses argparse, 
whereas Python 2 uses getopt. I'm not interested to try to fix the Python 2 
code using getopt.

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

___
Python tracker 

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



[issue27778] PEP 524: Add os.getrandom()

2016-10-17 Thread STINNER Victor

STINNER Victor added the comment:

Because of the lack of interest for getrandom_errno.patch, and Christian saying 
that it's not good to document specific errors, I now close the bug.

Thank you all for your help on this nice security enhancement in Python 3.6!

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

___
Python tracker 

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



[issue27779] Sync-up docstrings in C version of the the decimal module

2016-10-17 Thread Lisa Roach

Lisa Roach added the comment:

Anyone get the chance to look over this yet?

--

___
Python tracker 

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



[issue28455] argparse: convert_arg_line_to_args does not actually expect self argument

2016-10-17 Thread siccegge

siccegge added the comment:

Looks quite helpfull indeed to me! Thanks!

--

___
Python tracker 

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



[issue27806] 2.7 32-bit builds fail on macOS 10.12 Sierra due to dependency on deleted header file QuickTime/QuickTime.h

2016-10-17 Thread Ned Deily

Ned Deily added the comment:

Lapsang, sorry but this bug tracker is not a help forum.  There are many other, 
more appropriate places to ask for help in building software, like Stack 
Overflow or the Python mailing list.  But, if you are not comfortable patching 
and building software from source, you should consider using a third-party 
package manager like MacPorts or Homebrew to install zim and all of its 
dependencies, like Python.

--

___
Python tracker 

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



[issue28433] Add sorted (ordered) containers

2016-10-17 Thread Марк Коренберг

Марк Коренберг added the comment:

@r.david.murray

Please see answres at 
https://groups.google.com/forum/#!topic/python-ideas/nPOi2LtVsR4

No one say that adding sorted containers is bad idea. Some people say that 
specific use-cases require specific solutions, but they also said that it is 
good to add solution, that is not-so-bad for a gneric case.

The most appropriate solution (as I think) is pure-python sorted containers 
that are proven to be bug-free and has perfromance comparison against many 
other libraries. http://www.grantjenks.com/docs/sortedcontainers. This will 
make support of PyPy/IronPython/e.t.c automagically.

Why not to add it to CPython distribution (like asyncio) ?

--

___
Python tracker 

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



[issue28463] Email long headers parsing/serialization

2016-10-17 Thread Константин Волков

New submission from Константин Волков:

There is strange thing with long headers serialized, they have \n prefix. 
Example fails on Python3.4/3.5:

from email.message import Message
from email import message_from_bytes

x = '<147672320775.19544.6718708004153358...@mkren-spb.root.devdomain.local>'
header = 'Message-ID'
msg = Message()
msg[header] = x

data = msg.as_bytes()

msg2 = message_from_bytes(data)
print(x)
print(msg2[header])
assert msg2[header] == x


MessageID was generated by email.utils.make_msgid function.

--
components: email
messages: 278820
nosy: barry, r.david.murray, Константин Волков
priority: normal
severity: normal
status: open
title: Email long headers parsing/serialization
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



[issue28463] Email long headers parsing/serialization

2016-10-17 Thread Константин Волков

Константин Волков added the comment:

Something with copy paste.
x = '<147672320775.19544.6718708004153358...@mkren-spb.root.devdomain.local>'

--

___
Python tracker 

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



[issue28463] Email long headers parsing/serialization

2016-10-17 Thread Константин Волков

Константин Волков added the comment:

Something with inserting long strings here. Its duplicating for some reason.
Adding example as attachment.

--
Added file: http://bugs.python.org/file45124/test.py

___
Python tracker 

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



[issue28463] Email long headers parsing/serialization

2016-10-17 Thread R. David Murray

R. David Murray added the comment:

Ah, interesting case.  Both the old folder/parser and the new folder/parser 
fail, in slightly different ways.  I'll have to add this test case to the tests 
as I finish rewriting the folder.  Thanks for the report.

--

___
Python tracker 

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



[issue27659] Check for the existence of crypt()

2016-10-17 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Agreed. Adding -Werror=implicit-function-declaration is much simpler. Feel free 
to close it as rejected.

--

___
Python tracker 

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



[issue28448] C implemented Future doesn't work on Windows

2016-10-17 Thread INADA Naoki

Changes by INADA Naoki :


--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file45125/schedule_callbacks.patch

___
Python tracker 

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



[issue28409] test.regrtest does not support multiple -x flags

2016-10-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What is the difference between using parse_known_args() and 
nargs=argparse.REMAINDER?

--

___
Python tracker 

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



[issue28409] test.regrtest does not support multiple -x flags

2016-10-17 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka added the comment:
> What is the difference between using parse_known_args() and
nargs=argparse.REMAINDER?

Using REMAINDER, args become ["b", "-c", "d"] for -a b -c d.

I would be happy to not use parse_known_args(), but I didn't find how.

--

___
Python tracker 

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



[issue28462] subprocess pipe can't see EOF from a child in case of a few children run with subprocess

2016-10-17 Thread Martin Panter

Changes by Martin Panter :


--
components: +Windows
nosy: +paul.moore, steve.dower, 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



[issue28448] C implemented Future doesn't work on Windows

2016-10-17 Thread Yury Selivanov

Yury Selivanov added the comment:

> C implemented Future should allow overriding _schedule_callbacks.

I'm not so sure about this.  Maybe we can just fix _WaitCancelFuture somehow?

--

___
Python tracker 

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



[issue28452] Remove _asyncio._init_module function

2016-10-17 Thread Yury Selivanov

Yury Selivanov added the comment:

LGTM

--

___
Python tracker 

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



[issue28464] BaseEventLoop.close should shutdown executor before marking itself closed

2016-10-17 Thread Chris Meyer

New submission from Chris Meyer:

BaseEventLoop.close shuts down the executor associated with the event loop.

It should do that BEFORE it sets self._closed = True, otherwise any pending 
executor futures will attempt to 'call_soon' on the event loop when they 
finish, resulting in a confusing error message that the event loop is already 
closed.

--
components: asyncio
messages: 278829
nosy: cmeyer, gvanrossum, yselivanov
priority: normal
severity: normal
status: open
title: BaseEventLoop.close should shutdown executor before marking itself closed
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue28465] python 3.5 magic number

2016-10-17 Thread 曹忠

New submission from 曹忠:

On debian 9 and python 3.5.2:
>>> imp.get_magic()
b'\x17\r\r\n'

On windows and python 3.5.2
>>> imp.get_magic()
b'\x16\r\r\n'

the same python version, magic number is the same, why not?

--
components: Build
messages: 278830
nosy: 曹忠
priority: normal
severity: normal
status: open
title: python 3.5 magic number
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue28385] Bytes objects should reject all formatting codes with an error message

2016-10-17 Thread Eric V. Smith

Eric V. Smith added the comment:

LGTM, although I'm not so sure about your #3. Maybe it should be a separate 
issue and raised on python-dev? But I don't feel strongly enough about it to 
argue the point.

Thanks!

--

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-17 Thread Martin Panter

Martin Panter added the comment:

Well, I am not really an expert on the setup.py stuff, but I will ask a 
question anyway that may help the review process: Why do you remove the code 
that loops over Modules/Setup? Maybe is it redundant with the other code for 
removing the already-built-in modules?

Looking at the repository history, the code for avoiding already-built-in 
modules was first added as part of revision c503fa9b265e; see the __import__() 
call. Later, the second chunk of code looping over Setup was added in revision 
90e90c92198b, with discussion at 
.

The logic matching MODOBJS doesn’t look super robust. E.g. I suspect it will 
get confused if there are two Python modules that happen to use the same C 
filename in different subdirectories. Also, I suspect it could get confused by 
_math.c, which is shared by the “math” and “cmath” modules.

Perhaps I don’t know what I am talking about, but if you added 
Modules/Setup.config to the list of Setup files to process, would that 
eliminate the need to look at both MODOBJS and sys.builtin_module_names?

--
stage:  -> patch review

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-17 Thread Martin Panter

Martin Panter added the comment:

PS: I agree it would be good to add more documentation for cross-compiling. I 
tried to suggest something in an outdated patch once before; see the bottom of 
.

--

___
Python tracker 

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



[issue28452] Remove _asyncio._init_module function

2016-10-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d32ec6591c49 by INADA Naoki in branch '3.6':
Issue #28452: Remove _asyncio._init_module function
https://hg.python.org/cpython/rev/d32ec6591c49

New changeset ce85a1f129e3 by INADA Naoki in branch 'default':
Issue #28452: Remove _asyncio._init_module function
https://hg.python.org/cpython/rev/ce85a1f129e3

--
nosy: +python-dev

___
Python tracker 

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



[issue28452] Remove _asyncio._init_module function

2016-10-17 Thread INADA Naoki

Changes by INADA Naoki :


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

___
Python tracker 

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



[issue28466] SIGALRM fails to interrupt time.sleep() call on Python 3.5

2016-10-17 Thread Ryan Petrello

Changes by Ryan Petrello :


--
title: SIGALRM fails to interrupt time.sleep() call on Python 3.6 -> SIGALRM 
fails to interrupt time.sleep() call on Python 3.5

___
Python tracker 

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



[issue28466] SIGALRM fails to interrupt time.sleep() call on Python 3.6

2016-10-17 Thread Ryan Petrello

New submission from Ryan Petrello:

I may have found a bug in SIGALRM handling in Python3.5.  I've not been able to 
reproduce the same issue in Python2.7 or 3.4.  Here's a simple example that 
illustrates the issue (which I'm able to reproduce on OS X 10.11.3 El Capitan 
and Ubuntu 14.04):

$ python2 --version; python3.4 --version; python3.5 --version
Python 2.7.11
Python 3.4.4
Python 3.5.1

$ cat alarm.py
import signal, time

def handler(signum, frame):
print('Signal handler called with signal %s' % signum)

# Set the signal handler and a 1-second alarm
signal.signal(signal.SIGALRM, handler)
signal.alarm(1)

# We should not actually sleep for 10 seconds
time.sleep(10)
signal.alarm(0)

$ time python2 alarm.py
Signal handler called with signal 14
python2 alarm.py  0.04s user 0.02s system 5% cpu 1.075 total

$ time python3.4 alarm.py
Signal handler called with signal 14
python3.4 alarm.py  0.07s user 0.01s system 7% cpu 1.092 total

$ time python3.5 alarm.py
Signal handler called with signal 14
python3.5 alarm.py  0.09s user 0.02s system 1% cpu 10.115 total

Note that when run under python3.5, the program does not exit until 10 seconds 
have passed.

--
components: Library (Lib)
messages: 278835
nosy: ryan.petrello
priority: normal
severity: normal
status: open
title: SIGALRM fails to interrupt time.sleep() call on Python 3.6
versions: Python 3.5

___
Python tracker 

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



[issue27659] Check for the existence of crypt()

2016-10-17 Thread Martin Panter

Martin Panter added the comment:

If there is an obscure platform where we don’t include the right header file 
for a function, changing the warning into an error would cause the build to 
fail. If we do make it an error, it should only be so for 3.7.

--

___
Python tracker 

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



[issue28465] python 3.5 magic number

2016-10-17 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Hi.
imp.get_magic() is deprecated since 3.4, see the documentation here
https://docs.python.org/3/library/imp.html?highlight=get_magic#imp.get_magic

You should use importlib.util.MAGIC_NUMBER instead.

Please try it.
Thanks.

--
nosy: +Mariatta

___
Python tracker 

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



[issue28466] SIGALRM fails to interrupt time.sleep() call on Python 3.5

2016-10-17 Thread Martin Panter

Martin Panter added the comment:

This is by design; see PEP 475, and the documentation 
.

If you make your signal handler raise an exception, it will interrupt the 
sleep() call most of the time. But if the signal happens to be received just 
before the sleep() call is about to be entered, the handler will only be run 
when the underlying OS sleep() call returns 10 s later.

--
nosy: +martin.panter
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



[issue27931] Email parse IndexError <""@wiarcom.com>

2016-10-17 Thread Xiang Zhang

Xiang Zhang added the comment:

Ping.

--

___
Python tracker 

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



[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-17 Thread Tim Mitchell

Tim Mitchell added the comment:

Have stripped down the module __doc__ to a list of contents.
I chose to indent the descriptions of each argument to Popen. I know this is 
non-standard but it is such a long ramble otherwise.

Changed true -> :const:`True` in subprocess.rst.

--
keywords: +patch
nosy: +tim.mitchell
Added file: http://bugs.python.org/file45126/subprocess-docs.patch

___
Python tracker 

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



[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-17 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag
stage: needs patch -> patch review
versions: +Python 3.7

___
Python tracker 

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



[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-17 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Tim.

> Changed true -> :const:`True` in subprocess.rst.

This is out of scope for this issue and I actually prefer the current form.

Having method and class signatures in subprocess.__doc__ would make it less 
maintainable. I'd prefer having a short docstring that describes what the 
modules does, and what its modern API look like.

I don't think we should duplicate documentation of CalledProcessError, 
TimeoutExpired and Popen in their docstrings. Perhaps it would be better to 
just document which parameters are POSIX only.

Also, did you use the GitHub mirror to create the patch? If so, please use the 
official Mercurial repository: 
https://docs.python.org/devguide/setup.html#checkout Rietveld doesn't like 
patches created from the git repository so it was a bit hard to review the 
patch without using Rietveld. Thanks!

--

___
Python tracker 

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



[issue26240] Docstring of the subprocess module should be cleaned up

2016-10-17 Thread Antony Lee

Changes by Antony Lee :


--
nosy:  -Antony.Lee

___
Python tracker 

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



[issue28462] subprocess pipe can't see EOF from a child in case of a few children run with subprocess

2016-10-17 Thread Eryk Sun

Eryk Sun added the comment:

Due to a race condition, the Popen call in the second process is inadvertently 
inheriting the handle for the write end of the pipe that's created for the 
first process. Thus stdout.readline() in the first thread doesn't see EOF until 
that handle is closed. 

For the 2nd process, since you don't need to inherit standard handles, you can 
pass close_fds=True. In general if you do need to inherit standard handles in 
processes that are created concurrently, you can synchronize on a lock to 
ensure Popen properly closes inheritable handles. For example:

import threading
import subprocess

class Popen(subprocess.Popen):
_execute_lock = threading.Lock()
def __init__(self, *args, **kwds):
with self._execute_lock:
super(Popen, self).__init__(*args, **kwds)

In Python 3 this should be addressed by implementing the suggestion in issue 
19764 to use PROC_THREAD_ATTRIBUTE_HANDLE_LIST.

--
nosy: +eryksun

___
Python tracker 

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



[issue28448] C implemented Future doesn't work on Windows

2016-10-17 Thread INADA Naoki

INADA Naoki added the comment:

https://github.com/search?p=3&q=_schedule_callbacks&type=Code&utf8=%E2%9C%93

At least, Future class in uvloop have same API.
Most of other results seems just copy of Python source tree.
(But I didn't check all search result)

--

___
Python tracker 

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