[issue25201] lock of multiprocessing.Value is not a keyword-only argument

2015-09-21 Thread Martin Panter

Martin Panter added the comment:

I’m not familiar with this module, but I believe “lock” is indeed keyword-only. 
If you were to try a positional argument, it would be picked up as part of 
*args:

>>> multiprocessing.Value("I")  # Default to 0, lock=True

>>> multiprocessing.Value("I", False)  # False == 0, still lock=True

>>> multiprocessing.Value("I", lock=False)
c_uint(0)

--
nosy: +martin.panter

___
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-21 Thread Cameron Simpson

On 21Sep2015 12:40, Chris Angelico  wrote:

On Mon, Sep 21, 2015 at 11:55 AM, Cameron Simpson  wrote:

On 21Sep2015 10:34, Chris Angelico  wrote:

If you're going to add sequencing and acknowledgements to UDP,
wouldn't it be easier to use TCP and simply prefix every message with
a two-byte length?


Frankly, often yes. That's what I do. (different length encoding, but
otherwise...)


Out of interest, what encoding?


NB: this is for binary protocols.

I don't like embedding arbitrary size limits in protocols or data formats if I 
can easily avoid it. So (for my home grown binary protocols) I encode unsigned 
integers as big endian octets with the top bit meaning "another octet follows" 
and the bottom 7 bits going to the value. So my packets look like:


 encoded(length)data

For sizes below 128, one byte of length. For sizes 128-16383, two bytes. And so 
on. Compact yet unbounded.


My new protocols ar probably going to derive from the scheme implemented  in 
the code cited below. "New" means as of some weeks ago, when I completely 
rewrote a painful ad hoc protocol of mine and pulled out the general features 
into what follows.


The actual packet format is implemented by the Packet class at the bottom of 
this:


 https://bitbucket.org/cameron_simpson/css/src/tip/lib/python/cs/serialise.py

Simple and flexible.

As for using that data format multiplexed with multiple channels, see the 
PacketConnection class here:


 https://bitbucket.org/cameron_simpson/css/src/tip/lib/python/cs/stream.py

Broadly, the packets are length[tag,flags[,channel#],payload] and one 
implements whatever semantics one needs on top of that.


You can see this exercised over UNIX pipes and TCP streams in the unit tests 
here:


 https://bitbucket.org/cameron_simpson/css/src/tip/lib/python/cs/stream_tests.py

On the subject of packet stuffing, my preferred loop for that is visible in the 
PacketConnection._send worker thread method, which goes:


   fp = self._send_fp
   Q = self._sendQ
   for P in Q:
 sig = (P.channel, P.tag, P.is_request)
 if sig in self.__sent:
   raise RuntimeError("second send of %s" % (P,))
 self.__sent.add(sig)
 write_Packet(fp, P)
 if Q.empty():
   fp.flush()
   fp.close()

In short: get packets from the queue and write them to the stream buffer. If 
the queue gets empty, _only then_ flush the buffer. This assures synchronicity 
in comms while giving the IO library a chance to fill a buffer with several 
packets.


Cheers,
Cameron Simpson 

ERROR 155 - You can't do that.  - Data General S200 Fortran error code list
--
https://mail.python.org/mailman/listinfo/python-list


[issue25190] Define StringIO seek offset as code point offset

2015-09-21 Thread Martin Panter

Martin Panter added the comment:

I see the _pyio implementation wraps BytesIO with UTF-8 encoding. Perhaps it 
would be okay to change to UTF-32 encoding (a fixed-length Unicode encoding). 
That would use more memory, but the C implementation seems to use a Py_UCS4 
buffer already. Then you could reimplement seek(), tell(), and truncate() by 
detaching and rebuilding the TextIOWrapper over the top. Not super efficient, 
but perhaps that does not matter for the _pyio implementation.

The fact that it is so hard to do this (random write access to a large Unicode 
buffer) in native Python could be another argument to support this in the 
default StringIO implementation :)

--

___
Python tracker 

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



[issue23177] test_ssl: failures on OpenBSD with LibreSSL

2015-09-21 Thread STINNER Victor

STINNER Victor added the comment:

I don't care so much of issues introduced by LibreSSL, I don't understand why 
they broke the API. For me, it doesn't seem right to have a version different 
if it's a number or if it's a string: OPENSSL_VERSION_NUMBER should be 
consistent with OPENSSL_VERSION_INFO.

If you propose a patch for Python and it fixes test_ssl, I will apply it :-)

--

___
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-21 Thread Michael Ströder
Marko Rauhamaa wrote:
> I recommend using socket.TCP_CORK with socket.TCP_NODELAY where they are
> available (Linux).

If these options are not available are both option constants also not
available? Or does the implementation have to look into sys.platform?

Ciao, Michael.

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


[issue25138] test_socket: socket.EAI_NODATA doesn't exist on FreeBSD

2015-09-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f13a5b5a2824 by Victor Stinner in branch '3.4':
Issue #25138: test_socket.test_idna() uses support.transient_internet() instead
https://hg.python.org/cpython/rev/f13a5b5a2824

New changeset a7baccf0b1c2 by Victor Stinner in branch '3.5':
Merge 3.4 (test_socket, issue #25138)
https://hg.python.org/cpython/rev/a7baccf0b1c2

New changeset d8dd06ab00e4 by Victor Stinner in branch 'default':
Merge 3.5 (test_socket, issue #25138)
https://hg.python.org/cpython/rev/d8dd06ab00e4

--
nosy: +python-dev

___
Python tracker 

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



Re: Postscript to pdf

2015-09-21 Thread Baladjy KICHENASSAMY
well one more question :/

i tried this

def save():
 Canevas.update()
 Canevas.postscript(file=tkFileDialog.asksaveasfilename(),
colormode='color')
 subprocess.call(["ps2pdf", "-dEPSCrop", "test.ps", "test.pdf"])


i got the ps file but i didn't get the pdf file :/

2015-09-20 21:52 GMT+02:00 Laura Creighton :
> In a message of Sun, 20 Sep 2015 21:32:34 +0200, Baladjy KICHENASSAMY writes:
>>o ok i got it
>>actually it's very easy the commande is :
>>ps2pdf -dEPSCrop image.ps
>>
>>sorry but i'm new to python  my last question is how to integrate this
>>to python... i want that the output file must be a pdf ?
>>
>>1) i created a button which i'll save my id card as "ps" file
>>
>>def save():
>>Canevas.update()
>>Canevas.postscript(file=tkFileDialog.asksaveasfilename(), 
>> colormode='color')
>
>>2) so now i want to create a button to convert this "ps" file into "pdf" 
>>
>>def convert():
>>   help :/
>
> You need to run the subprocess module to run your command.
> https://docs.python.org/2/library/subprocess.html  (for python 2)
> https://docs.python.org/3.4/library/subprocess.html (for python 3)
>
> is this enough or do you need more help getting it to work?
>
> Laura
>



-- 
KICHENASSAMY Baladjy
Ingénieur en Génie Mécanique
Spécialiste Contrôle Non Destructif et Qualification des procédés spéciaux
COSAC CND Niveau 2 RT et PT
Aircelle SAFRAN
Tel:06.03.72.53.12
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Lightwight socket IO wrapper

2015-09-21 Thread Marko Rauhamaa
Chris Angelico :

> On Mon, Sep 21, 2015 at 4:27 PM, Cameron Simpson  wrote:
>> For sizes below 128, one byte of length. For sizes 128-16383, two bytes. And
>> so on. Compact yet unbounded.
>
> [...]
>
> It's generally a lot faster to do a read(2) than a loop with any
> number of read(1), and you get some kind of bound on your allocations.
> Whether that's important to you or not is another question, but
> certainly your chosen encoding is a good way of allowing arbitrary
> integer values.

You can read a full buffer even if you have a variable-length length
encoding.


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


Re: Lightwight socket IO wrapper

2015-09-21 Thread Marko Rauhamaa
Michael Ströder :

> Marko Rauhamaa wrote:
>> I recommend using socket.TCP_CORK with socket.TCP_NODELAY where they
>> are available (Linux).
>
> If these options are not available are both option constants also not
> available? Or does the implementation have to look into sys.platform?

   >>> import socket
   >>> 'TCP_CORK' in dir(socket)
   True

The TCP_NODELAY option is available everywhere but has special semantics
with TCP_CORK.


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


[issue25184] "python -m pydoc -w" fails in nondecodable directory

2015-09-21 Thread STINNER Victor

STINNER Victor added the comment:

Technically, I think that it's possible to put bytes in an URL using %HH 
format. I didn't check if we can retrieve the "raw bytes".

--
nosy: +haypo

___
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-21 Thread Chris Angelico
On Mon, Sep 21, 2015 at 5:59 PM, Marko Rauhamaa  wrote:
> Chris Angelico :
>
>> On Mon, Sep 21, 2015 at 4:27 PM, Cameron Simpson  wrote:
>>> For sizes below 128, one byte of length. For sizes 128-16383, two bytes. And
>>> so on. Compact yet unbounded.
>>
>> [...]
>>
>> It's generally a lot faster to do a read(2) than a loop with any
>> number of read(1), and you get some kind of bound on your allocations.
>> Whether that's important to you or not is another question, but
>> certainly your chosen encoding is a good way of allowing arbitrary
>> integer values.
>
> You can read a full buffer even if you have a variable-length length
> encoding.

Not sure what you mean there. Unless you can absolutely guarantee that
you didn't read too much, or can absolutely guarantee that your
buffering function will be the ONLY way anything reads from the
socket, buffering is a problem.

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


[issue25084] remove semi-busy loop in py2.7 threading.Condition.wait(timeout=x)

2015-09-21 Thread STINNER Victor

STINNER Victor added the comment:

Nick Coghlan added the comment:
> +1 - after the further discussion, addressing this downstream as a patch 
> specifically to the pthread backend sounds good to me.

Cool, I like when we agree :-)

@Flavio Grossi: Sorry for you, but it's time to upgrade to Python 3.
Twisted made great progress on Python 3 support. For Apache Thrift,
maybe you can help them to port the library to Python 3?

--

___
Python tracker 

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



[issue25138] test_socket: socket.EAI_NODATA doesn't exist on FreeBSD

2015-09-21 Thread STINNER Victor

STINNER Victor added the comment:

> Looking at this more closely, the check seems to be there just to check if 
> basic DNS lookups are working. It was added for Issue 12804. One option might 
> be to replace it with a support.transient_internet() handler: (...)

Oh good idea. This context manager sets also a timeout to 30 seconds which can 
help to skip the test only platforms with flacky internet connections.

By the way, I also saw the test failing randomly on the Windows 8.1 buildbot. I 
hope that support.transient_internet() will also skip the tes on this case.

I close the issue since the initial issue is fixed.

Thanks Martin for the hint ;)

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



[issue25118] OSError in os.waitpid() on Windows [3.5.0 regression]

2015-09-21 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +3.5regression

___
Python tracker 

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



[issue25155] Windows: datetime.datetime.now() raises an OverflowError for date after year 2038

2015-09-21 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +3.5regression

___
Python tracker 

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



[issue25095] test_httpservers hangs on 3.5.0, win 7

2015-09-21 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +3.5regression

___
Python tracker 

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



[issue25114] asynico: add ssl_object extra info

2015-09-21 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +3.5regression

___
Python tracker 

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



[issue25184] "python -m pydoc -w" fails in nondecodable directory

2015-09-21 Thread Martin Panter

Martin Panter added the comment:

Seems to be caused by the Python directory being non-decodable; the current 
working directory does not matter. What is going on is “pydoc” is trying to 
make a link to a module’s source code, such as

/usr/lib/python3.4/pydoc.py

For non-decodable paths, the following would work in Firefox:

/home/serhiy/py/cpy�thon-3.5/Lib/pydoc.py

but since URL percent encoding already uses UTF-8, this scheme isn’t foolproof 
(e.g. a UTF-8 sequence when the locale is ASCII would be ambiguous). A simpler 
and more consistent way forward would be an error handler substituting 
something like this, decoding the surrogate escape code with the “replace” 
handler, with the HTML link suppressed:

/home/serhiy/py/cpy�thon-3.5/Lib/pydoc.py (invalid filename encoding)

--
nosy: +martin.panter

___
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-21 Thread Marko Rauhamaa
Chris Angelico :

> On Mon, Sep 21, 2015 at 2:39 PM, Marko Rauhamaa  wrote:
>> Chris Angelico :
>>
>>> If you write a packet of data, then write another one, and another,
>>> and another, and another, without waiting for responses, Nagling
>>> should combine them automatically. [...]
>>
>> Unfortunately, Nagle and delayed ACK, which are both defaults, don't go
>> well together (you get nasty 200-millisecond hickups).
>
> Only in the write-write-read scenario.

Which is the case you brought up. Ideally, application code should be
oblivious to the inner heuristics of the TCP implementation. IOW,
write-write-read is perfectly valid and shouldn't lead to performance
degradation.

Unfortunately, the socket API doesn't provide a standard way for the
application to tell the kernel that it is done sending for now. Linux's
TCP_CORK+TCP_NODELAY is a nonstandard way but does the job quite nicely.

>> As for the topic, TCP doesn't need wrappers to abstract away the
>> difficult bits. That's a superficially good idea that leads to
>> trouble.
>
> Depends what you're doing - if you're working with a higher level
> protocol like HTTP, then abstracting away the difficult bits of TCP is
> part of abstracting away the difficult bits of HTTP, and something
> like 'requests' is superb.

Naturally, a higher-level protocol hides the lower-level protocol. It in
turn has intricacies of its own. Unfortunately, Python's stdlib HTTP
facilities are too naive (ie, blocking, incompatible with asyncio) to be
usable.


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


Re: Dummy Decoder Example (was Re: Parallel decoding lesson for you.)

2015-09-21 Thread Skybuck Flying
Just to be clear on this, the code you have to write doesn't need to be 
truely parallel.


It must be parallel in potential, so it should be able to execute 
independenlty from each other and out of order.


Bye,
 Skybuck. 


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


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

2015-09-21 Thread Stefan Behnel

Stefan Behnel added the comment:

LGTM

--
nosy: +scoder

___
Python tracker 

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



[issue25150] 3.5: Include/pyatomic.h is incompatible with OpenMP (compilation of the third-party yt module fails on Python 3.5)

2015-09-21 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +3.5regression

___
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-21 Thread Chris Angelico
On Mon, Sep 21, 2015 at 4:27 PM, Cameron Simpson  wrote:
> I don't like embedding arbitrary size limits in protocols or data formats if
> I can easily avoid it. So (for my home grown binary protocols) I encode
> unsigned integers as big endian octets with the top bit meaning "another
> octet follows" and the bottom 7 bits going to the value. So my packets look
> like:
>
>  encoded(length)data
>
> For sizes below 128, one byte of length. For sizes 128-16383, two bytes. And
> so on. Compact yet unbounded.

Ah, the MIDI Variable-Length Integer. Decent.

It's generally a lot faster to do a read(2) than a loop with any
number of read(1), and you get some kind of bound on your allocations.
Whether that's important to you or not is another question, but
certainly your chosen encoding is a good way of allowing arbitrary
integer values.

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


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

2015-09-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 855484b55da3 by Terry Jan Reedy in branch '2.7':
Issue #16893: Add idlelib.help.copy_strip() to copy-rstrip Doc/.../idle.html.
https://hg.python.org/cpython/rev/855484b55da3

New changeset df987a0bc350 by Terry Jan Reedy in branch '3.4':
Issue #16893: Add idlelib.help.copy_strip() to copy-rstrip Doc/.../idle.html.
https://hg.python.org/cpython/rev/df987a0bc350

New changeset f08437278049 by Terry Jan Reedy in branch '3.5':
Issue #16893: Add idlelib.help.copy_strip() to copy-rstrip Doc/.../idle.html.
https://hg.python.org/cpython/rev/f08437278049

New changeset 09ebed6a8cb8 by Terry Jan Reedy in branch 'default':
Issue #16893: Add idlelib.help.copy_strip() to copy-rstrip Doc/.../idle.html.
https://hg.python.org/cpython/rev/09ebed6a8cb8

--

___
Python tracker 

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



[issue25201] lock of multiprocessing.Value is not a keyword-only argument

2015-09-21 Thread Berker Peksag

Berker Peksag added the comment:

I didn't test it carefully. It was a mistake on my part :) But I think the 
function signature could be clearer by changing that part to "*, lock=True".

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



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

2015-09-21 Thread Ryan Stuart
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


[issue25210] Special-case NoneType() in do_richcompare()

2015-09-21 Thread Ezio Melotti

New submission from Ezio Melotti:

do_richcompare() has a comment (at Objects/object.c:689) that reads:

/* XXX Special-case None so it doesn't show as NoneType() */

This refers to the following error message:

>>> 3 < None
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unorderable types: int() < NoneType()

This is a common error that comes up while ordering/sorting, and NoneType() is 
potentially confusing, so I find the request reasonable.
If the consensus is favourable, it should be implemented, if not, the comment 
should be removed.

--
components: Interpreter Core
keywords: easy
messages: 251288
nosy: ezio.melotti
priority: low
severity: normal
stage: test needed
status: open
title: Special-case NoneType() in do_richcompare()
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



[issue24841] Some test_ssl network tests fail if svn.python.org is not accessible.

2015-09-21 Thread Berker Peksag

Berker Peksag added the comment:

The attached patch should fix the test failures.

--
keywords: +patch
stage: needs patch -> patch review
type:  -> behavior
Added file: http://bugs.python.org/file40542/issue24841.diff

___
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-21 Thread Cai Gengyang
On Tuesday, September 22, 2015 at 4:34:45 AM UTC+8, Christian Gollwitzer wrote:
> Am 21.09.15 um 17:16 schrieb Cai Gengyang:
> > 2) A system where where the users can then edit these
> > photos/images/videos into short , funny cartoons/videos
> >
> > This one's a bit open-ended, but more importantly, it needs a lot of
> > front-end work. Editing images in Python code won't be particularly
> > hard; but letting your users choose how those images are put
> > together? That's going to require a boatload of JavaScript work. How
> > good are you at front-end design and coding?
> >
> >  No experience at all. Guess I'll have to learn Javascript to do
> > this. I'll also need the capability to let users edit their
> > photos/images and videos into great looking real-time cartoons based
> > on themes
>  >
> > (what technologies would I need to learn to create this?)
> >
> 
> Magic.
> 
> Seriously, have you already seen a software which does approximately the
> image editing that you have in mind? If not, chances are that it is not
> possible or possible only by a group of experts. Drawing a cartoon is
> not a thing that a computer can do easily, much less if the only input
> is a photograph. Currently, cartoons are made by humans using computers, 
> not by an algorithm.
> 
> If you can make it work, you'll be a star on SIGGRAPH (a conference
> about image processing).
> 
>   Christian

Christian,

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  ...
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24870] Optimize coding with surrogateescape and surrogatepass error handlers

2015-09-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2cf85e2834c2 by Victor Stinner in branch 'default':
Issue #24870: Reuse the new _Py_error_handler enum
https://hg.python.org/cpython/rev/2cf85e2834c2

New changeset aa247150a8b1 by Victor Stinner in branch 'default':
Issue #24870: Add _PyUnicodeWriter_PrepareKind() macro
https://hg.python.org/cpython/rev/aa247150a8b1

--

___
Python tracker 

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



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

2015-09-21 Thread Sol T
Is anyone aware of documentation that describes how to compile various
sqlite options?



On Thu, Sep 17, 2015 at 2:24 PM, sol433tt  wrote:

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


[issue25201] lock of multiprocessing.Value is not a keyword-only argument

2015-09-21 Thread Davin Potts

Davin Potts added the comment:

Berker: It looks to me like the docs are indeed in sync with the code on Value 
in that lock really is a keyword-only argument.  It looks like it's been that 
way since at least 2.7 (I didn't look at earlier).  There are enough other 
things in the multiprocessing.sharedctypes, maybe it was one of the others that 
caught your attention instead?

I wished that block/blocking had turned out to be a keyword-only argument in 
multiprocessing.Lock as part of issue23484, which I immediately thought of when 
reading this issue.

--

___
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-21 Thread Martin Panter

Martin Panter added the comment:

I agree with adding a space in some cases, but not others. E.g. "pass" would 
only need a space if you wanted to add a comment, "return" often takes no 
argument, "lambda" may need an immediate colon (lambda: x). See 
 for 
a whitelist of keywords that I thought should always have spaces, but beware 
this list may not be up to date (no “await” nor “async” for instance).

BTW I don’t agree with the default of forcing an open bracket “(” for 
callables; consider decorators, subclassing, deferred function calls, etc, 
where that bracket may not be wanted.

--
nosy: +martin.panter

___
Python tracker 

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



Problem installing pip

2015-09-21 Thread Stephan
Good Morning,

 

I've tried ten times to install pip with no success in windows 10 using
python 64bit version.

Is there a solution available? 

I'm looking forward hearing you soon.

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


Re: Lightwight socket IO wrapper

2015-09-21 Thread MRAB

On 2015-09-21 09:47, Marko Rauhamaa wrote:

Michael Ströder :


Marko Rauhamaa wrote:

Michael Ströder :


Marko Rauhamaa wrote:

I recommend using socket.TCP_CORK with socket.TCP_NODELAY where they
are available (Linux).


If these options are not available are both option constants also not
available? Or does the implementation have to look into sys.platform?


   >>> import socket
   >>> 'TCP_CORK' in dir(socket)
   True


On which platform was this done?


Python3 on Fedora 21.
Python2 on RHEL4.

Sorry, don't have non-Linux machines to try.


How to automagically detect whether TCP_CORK is really available on a
platform?


I sure hope 'TCP_CORK' in dir(socket) evaluates to False on non-Linux
machines.


On Windows 10:

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 socket
>>> 'TCP_CORK' in dir(socket)
False
>>>

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


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

2015-09-21 Thread Simeon Warner

Simeon Warner added the comment:

Path looks fine and seems to work as expected -- Simeon

--

___
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-21 Thread Chris Angelico
On Mon, Sep 21, 2015 at 10:53 PM, Cai Gengyang  wrote:
> Ok, so basically these are the features I want the app to have :
>
> 1) A system where users can upload photos/images/videos of their loved ones 
> and family onto the web-based app (It's going to be web-based website)
> 2) A system where where the users can then edit these photos/images/videos 
> into short , funny cartoons/videos
> 3) A system where users can create an account with username/password/log in 
> information
> 4) A system where users can then share and publish these pictures on the 
> website itself using their account and also link and upload onto other 
> traditional social networks like Facebook, Twitter and Google+ accounts and 
> also onto their other handheld devices like IPhone , Apple Devices, Samsung 
> handphones etc
>
> As for the architecture itself , it will probably be similar to wedpics 
> (https://www.wedpics.com/) but better designed with gorgeous and pristine 
> features and a system where users can edit their pictures/photos/videos into 
> cartoons with different themes with their faces on it (funny, natural, 
> science) --- i.e. imagine you are able to make a cartoon of your bride , 
> family members and friends at your wedding ceremony into a funny cartoon with 
> your faces imprinted on cartoon characters , the have these cartoons 
> published on the website and also link with other social networks where you 
> can publish these cartoons on them as well 
>
> I currently have minimal experience with programming , and have only done a 
> course on Python on CodeAcademy(That's about it) , so I am posting here to 
> ask for help --- where is the best place to start and resources?
>

You've done the first step - figure out what you want, and (more
importantly) how it's different from existing services you know about.
Great!

The next step, though, is to get some idea of the scope of the
project. Let's take a quick run through your basic features.

> 1) A system where users can upload photos/images/videos of their loved ones 
> and family onto the web-based app (It's going to be web-based website)

Creating a web site using Python is pretty easy. Grab Flask, Django,
etc, and off you go. Uploading files isn't difficult, although since
you're working with large files here, you'll eventually need some
beefy hardware to run this on (free accounts might not have enough
storage and/or bandwidth to handle lots of users).

> 2) A system where where the users can then edit these photos/images/videos 
> into short , funny cartoons/videos

This one's a bit open-ended, but more importantly, it needs a lot of
front-end work. Editing images in Python code won't be particularly
hard; but letting your users choose how those images are put together?
That's going to require a boatload of JavaScript work. How good are
you at front-end design and coding?

> 3) A system where users can create an account with username/password/log in 
> information

Subtly tricky to get right if you do it manually, but trivially easy
to get someone else to do the work for you. Grab something like
Flask-Login and the job's done.

> 4) A system where users can then share and publish these pictures on the 
> website itself using their account and also link and upload onto other 
> traditional social networks like Facebook, Twitter and Google+ accounts and 
> also onto their other handheld devices like IPhone , Apple Devices, Samsung 
> handphones etc
>

Fundamentally, all this requires is stable URLs that people can post.
That's pretty easy (esp if you're using a good framework). Making sure
they work properly on mobile phones is generally a matter of starting
with something simple, and then testing every change on lots of
devices. It's a bit of work, but nothing unattainable.

Your hardest part is #2, and sadly, that's also the part that makes or
breaks this service. Without that, all you're doing is recreating FTP.
So that's what you have to think about: Can you write all that
front-end code? This will not be simple; it'll be a pretty big
project.

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


[issue25202] Windows: with-statement doesn't release file handle after exception on "No space left on device" error

2015-09-21 Thread STINNER Victor

Changes by STINNER Victor :


--
title: with-statement doesn't release file handle after exception -> Windows: 
with-statement doesn't release file handle after exception on "No space left on 
device" error

___
Python tracker 

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



[issue25202] Windows: with-statement doesn't release file handle after exception on "No space left on device" error

2015-09-21 Thread STINNER Victor

Changes by STINNER Victor :


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



Re: Postscript to pdf

2015-09-21 Thread Nobody
On Sun, 20 Sep 2015 23:11:20 +0200, Baladjy KICHENASSAMY wrote:

> i tried this
> 
> def save():
>  Canevas.update()
>  Canevas.postscript(file=tkFileDialog.asksaveasfilename(),
> colormode='color')
>  subprocess.call(["ps2pdf", "-dEPSCrop", "test.ps", "test.pdf"])
> 
> 
> i got the ps file but i didn't get the pdf file :/

Check that subprocess.call() returns zero, or use subprocess.check_output()
instead. Also, if this is a GUI program and you have no easy way to check
what is written to stdout or stderr, try:

p = subprocess.Popen(["ps2pdf", "-dEPSCrop", "test.ps", "test.pdf"],
 stderr=subprocess.PIPE)
out, err = p.communicate()
if p.returncode != 0:
raise RuntimeError(err)

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


[issue24520] Stop using deprecated floating-point environment functions on FreeBSD

2015-09-21 Thread STINNER Victor

STINNER Victor added the comment:

It looks like fpsetmask() was deprecated since many years, and that 
fedisableexcept() is available since FreeBSD 5.3. Since we try to support 
FreeBSD 9, it's fine to drop support of FreeBSD < 5.3.

I'm concerned by the "CAVEATS" section below. Should we put "#pragma STDC 
FENV_ACCESS ON" in all .c file using a C double?

@skrah: I saw this pragma in Modules/_decimal/libmpdec/mpdecimal.c. Any idea if 
applying this patch is fine?

Maybe we can start by applying it to the default branch?

If this patch is required to support arm64, I think that it's ok to apply it to 
2.7, 3.4 and 3.5 since we still accept changes to fix platform compatibility 
issues.

http://www.unix.com/man-page/freebsd/3/fpsetmask/
---
DESCRIPTION
 The routines described herein are deprecated.  New code should use the 
functionality provided by fenv(3).
---

http://www.unix.com/man-page/freebsd/3/fenv/
---
HISTORY
 The  header first appeared in FreeBSD 5.3.  It supersedes the 
non-standard routines defined in  and documented in fpgetround(3).

CAVEATS
 The FENV_ACCESS pragma can be enabled with
   #pragma STDC FENV_ACCESS ON
---

--
nosy: +haypo, skrah

___
Python tracker 

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



Re: problem building python 3.5 extensions for windows

2015-09-21 Thread Mark Lawrence

On 21/09/2015 13:55, Robin Becker wrote:

I have installed VS2015; this is the full version and was a great deal
of trouble to install. First time out it started whining and I had to
'repair' it.

Anyhow after the 'repair' it said all was OK and no complaints.

However, when I try to use it I don't see options for starting C++
projects, but instead only C#.

I get an error like this trying to build for x86 or amd64

  | building 'reportlab.lib._rl_accel' extension
Stderr:  | error: Unable to find vcvarsall.bat


The most reported problem trying to build anything on Windows that is 
Python related.




There is a folder "C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC", but it doesn't contain any batch scripts. Document
https://msdn.microsoft.com/en-us/library/x4d2c09s.aspx claims to be
about VS2015, but has as example

cd "\Program Files (x86)\Microsoft Visual Studio 12.0\VC"

which is presumably not for VS2015.


Correct, the folder you referenced first should contain the batch file.



Any ideas how to get this to work? Should I try a full reinstall of
VS2015? I can start the VS2015 Developer command prompt, but it doesn't
then know about the "cl" command.


I'd be inclined to go for the reinstall, painful as that might be.  I've 
tried finding the batch file as a separate download but there's just too 
many hits about "download Visual Studio".


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


[issue25194] Register of Financial Interests for core contributors

2015-09-21 Thread Ezio Melotti

Ezio Melotti added the comment:

> Wouldn't it be better to put the emphasis on a) core devs who do this 
> in their free time, b) core devs who would be available for hired work, 
> and c) showing off which companies indirectly support Python via 
> employing core devs and giving them time to do core dev work as part of 
> their job ?

I still think that a) and c) should be separate from b).  Core devs might be 
contributing in their free time (i.e. a) or as part as their job (i.e. c), and 
on top of this they might or might not be available for hired work (i.e. b).

> Essentially replacing "disclosure" and "financial interests" with 
> "motivation" and "support".

Agreed.  Perhaps even "affiliation" could be used, even though that doesn't 
imply that the affiliated company supports CPython.

--

___
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-21 Thread Great Avenger Singh
On Monday, 21 September 2015 15:08:53 UTC+5:30, Cai Gengyang  wrote:
> Hello,
> 
> 
> So, I want to use Python to design a photo/image/video sharing app that i can 
> >test on users.

One Example is DropBox  doing this at very large  extent. ;)


> I have Python 2.7.10, 3.3.2 and 3.3.4 downloaded and am using a Mac OS X 
> Yosemite Version 10.10.2 laptop and having gone through the Python course on 
> CodeAcademy a while ago (though I probably forgot most of it my now)
> 
> How / where do i start ? Any suggestions / resources / recommendations 
> >appreciated. 

As you have not mentioned how you want your application to be,
One way is using Dropbox/Google-drive Python API so user can get space 
somewhere online and generate Public Link to Share file.

Or If User want to share it locally with other computers using 
LAN/Bluetooth?WI-FI,

If you want to make it use with Android or IOS Kivy is there for you.(I am 
fantasized with Kivy!)

Or First you have to decide what kind of Architecture you want with your 
application or features. I guess my answer is vague so your question was ;) 

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


[issue25186] Don't duplicate _verbose_message in importlib._bootstrap and _bootstrap_external

2015-09-21 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue24520] Stop using deprecated floating-point environment functions on FreeBSD

2015-09-21 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
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-21 Thread Simeon Warner

Simeon Warner added the comment:

s/Path/Patch/

--

___
Python tracker 

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



[ANN] bbrecorder - a black box handler for logs

2015-09-21 Thread Laurent Pointal
Hello,

I'm please to annouce the availability of bbrecorder module and its 
BlackBoxHandler logging handler for Python 3 (tested on 3.4).

This logging handler manage caching of last N log records in memory until they 
are needed — and then generate them using standard common Python logging 
handlers.

It allows to enable a log level generating many log records, and only get last 
records when a crisis situation occur (typically in an exception handler).

Note: in case of hard Python crash (core dump), cached logs are lost ! — see 
important note in doc.

PyPI: https://pypi.python.org/pypi/bbrecorder/
Docs: http://bbrecorder.readthedocs.org/
Project: https://perso.limsi.fr/pointal/dev:bbrecorder

A+
L.Pointal.

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

Support the Python Software Foundation:
http://www.python.org/psf/donations/


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

2015-09-21 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
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-21 Thread Cai Gengyang
On Monday, September 21, 2015 at 7:38:21 PM UTC+8, Great Avenger Singh wrote:
> On Monday, 21 September 2015 15:08:53 UTC+5:30, Cai Gengyang  wrote:
> > Hello,
> > 
> > 
> > So, I want to use Python to design a photo/image/video sharing app that i 
> > can >test on users.
> 
> One Example is DropBox  doing this at very large  extent. ;)
> 
> 
> > I have Python 2.7.10, 3.3.2 and 3.3.4 downloaded and am using a Mac OS X 
> > Yosemite Version 10.10.2 laptop and having gone through the Python course 
> > on CodeAcademy a while ago (though I probably forgot most of it my now)
> > 
> > How / where do i start ? Any suggestions / resources / recommendations 
> > >appreciated. 
> 
> As you have not mentioned how you want your application to be,
> One way is using Dropbox/Google-drive Python API so user can get space 
> somewhere online and generate Public Link to Share file.
> 
> Or If User want to share it locally with other computers using 
> LAN/Bluetooth?WI-FI,
> 
> If you want to make it use with Android or IOS Kivy is there for you.(I am 
> fantasized with Kivy!)
> 
> Or First you have to decide what kind of Architecture you want with your 
> application or features. I guess my answer is vague so your question was ;)

Ok, so basically these are the features I want the app to have :

1) A system where users can upload photos/images/videos of their loved ones and 
family onto the web-based app (It's going to be web-based website)
2) A system where where the users can then edit these photos/images/videos into 
short , funny cartoons/videos 
3) A system where users can create an account with username/password/log in 
information 
4) A system where users can then share and publish these pictures on the 
website itself using their account and also link and upload onto other 
traditional social networks like Facebook, Twitter and Google+ accounts and 
also onto their other handheld devices like IPhone , Apple Devices, Samsung 
handphones etc 

As for the architecture itself , it will probably be similar to wedpics 
(https://www.wedpics.com/) but better designed with gorgeous and pristine 
features and a system where users can edit their pictures/photos/videos into 
cartoons with different themes with their faces on it (funny, natural, science) 
--- i.e. imagine you are able to make a cartoon of your bride , family members 
and friends at your wedding ceremony into a funny cartoon with your faces 
imprinted on cartoon characters , the have these cartoons published on the 
website and also link with other social networks where you can publish these 
cartoons on them as well 

My plan is to build this and get some users to test the product by posting the 
product online on sites like these, hacker news, word of mouth and also invite 
strangers on Facebook, Googles+ and Twitter to test this prototype and 
continuously iterate the product according to user feedback. Hope that is 
detailed enough to give you an idea of how it roughly would look like !

I currently have minimal experience with programming , and have only done a 
course on Python on CodeAcademy(That's about it) , so I am posting here to ask 
for help --- where is the best place to start and resources?

Thanks a lot , appreciate it !

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


[issue25184] "python -m pydoc -w" fails in nondecodable directory

2015-09-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

We could use url = urllib.parse.quote_from_bytes(os.fsencode(path)) on Posix 
systems, but I heart that on Windows os.fsencode() can irreversible spoil file 
names (replace unencodable characters with '?'). On other side, I'm not sure 
that Windows unicode path can't contain lone surrogates. In this case we should 
use the 'surrogatepass' error handler (at least it allow to restore the path in 
principle).

Here is a patch that tries to handle undecodable and unencodable paths. Need to 
test it on Windows.

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file40534/pydoc_undecodabple_path.patch

___
Python tracker 

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



Re: problem building python 3.5 extensions for windows

2015-09-21 Thread Chris Angelico
On Mon, Sep 21, 2015 at 11:27 PM, Mark Lawrence  wrote:
>> There is a folder "C:\Program Files (x86)\Microsoft Visual Studio
>> 14.0\VC", but it doesn't contain any batch scripts. Document
>> https://msdn.microsoft.com/en-us/library/x4d2c09s.aspx claims to be
>> about VS2015, but has as example
>>
>> cd "\Program Files (x86)\Microsoft Visual Studio 12.0\VC"
>>
>> which is presumably not for VS2015.
>
>
> Correct, the folder you referenced first should contain the batch file.
>

Which indicates a possible text bug in the linked-to document. None of
us can change that, though.

For some actually Python-specific info, I'd recommend checking out
what Steve Dower has written:

http://stevedower.id.au/blog/building-for-python-3-5-part-two/

Poking around on his blog and web site might turn up some other useful
info, too. I'm not a Windows guy so I can't help any more than that,
sorry.

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


[ANN] floatrange - a range() for floats

2015-09-21 Thread Laurent Pointal
Hello,

I'm please to publish a small utility module allowing to produce float based 
range sequences, with I hope a complete range-like interface. Because of 
floating point arithmetic, floatrange allows to specify a precision for 
"equality" when working with operators like 'in'.

It is Python2 and Python3 compatible.

PyPI: https://pypi.python.org/pypi/floatrange/
Doc: http://floatrange.readthedocs.org/
Project: https://perso.limsi.fr/pointal/python:floatrange

Float arithmetic: https://docs.python.org/3/tutorial/floatingpoint.html

A+
Laurent Pointal.

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

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[ANN] osc4py3 - Open Sound Control package for Python 3

2015-09-21 Thread Laurent Pointal
Hello,

I'm please to annouce the availability of osc4py3 package, yet another 
implementation of the OSC protocol (packets manipulations, transport, messages 
routing).

* encoding/decoding of OSC message packets (including bundles)
* routing of incoming messages based on selector regexps or globbing
* timed messages with possible delay period
* named client/server for sending/subscribing
* different scheduling models (single process, totally multithread, only
   multithread for communications)
* extra processing of packets (hack points to encrypt/decrypt, sign/verify…)


PyPI: https://pypi.python.org/pypi/osc4py3
Doc: http://osc4py3.readthedocs.org/
Project: https://perso.limsi.fr/pointal/dev:osc4py3

About OSC: opensoundcontrol.org

A+
Laurent Pointal
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[issue25183] python -m inspect --details fails in nondecodable directory

2015-09-21 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue25184] "python -m pydoc -w" fails in nondecodable directory

2015-09-21 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



Re: True == 1 weirdness

2015-09-21 Thread jmp

On 09/16/2015 02:53 PM, Jussi Piitulainen wrote:

 But now I expect to see a long thread about whether
chained comparisons are a natural thing to have in the language.


Nice forecast by the way.

JM


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


[issue25122] test_eintr randomly fails on FreeBSD

2015-09-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3184c43627f5 by Victor Stinner in branch '3.5':
Issue #25122: test_eintr: the FreeBSD fix will be released in FreeBSD 10.3
https://hg.python.org/cpython/rev/3184c43627f5

--

___
Python tracker 

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



[issue25185] Inconsistency between venv and site

2015-09-21 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue22729] `wait` and `as_completed` depend on private api

2015-09-21 Thread Ben Mather

Ben Mather added the comment:

Sorry for slow response.  I completely missed your reply.

I was working on a project that used a concurrent.futures thread pool but also 
needed to listen to responses from a chip-and-pin card reader.

Payment sessions operated in three phases:
  - check with card reader that payment is possible
  - save payment to database as if it has happened (always best to undercharge 
in the case of an error)
  - ask the payment provider to commit the payment

Up until confirmation is received, it is entirely possible to cancel the 
session.
Once confirmation is received the session starts trying to commit and you can 
only really wait for it to finish and then roll back (or break everything).

This maps pretty well to the interface of future (though with very different 
plumbing and with work happening before cancellation stops working) and it made 
sense to try to write it so that it could interoperate with futures 
representing tasks running on the thread pool.

I tried to add a method which returned a plain concurrent.futures.Future object 
but couldn't find a way to hook into the cancel method without introducing 
loads of race conditions.

Really it just seemed wrong that I had an object that quacked like a duck but 
wasn't a duck because real ducks communicated over a hidden side channel.

The card reader library is open source and mostly functional.  The class is in:

https://github.com/bwhmather/python-payment-terminal/blob/develop/payment_terminal/drivers/bbs/payment_session.py

I'm sure there are other places where this sort of interoperability would be 
useful.

--

___
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-21 Thread Jorgen Grahn
On Mon, 2015-09-21, Dennis Lee Bieber wrote:
> On Sun, 20 Sep 2015 23:36:30 +0100, "James Harris"
>  declaimed the following:

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

So they are "limited in size" like the OP wrote.  (A TCP stream OTOH is
potentially infinite.)

But also, the IPv4 RFC says:

All hosts must be prepared to accept datagrams of up to 576 octets
(whether they arrive whole or in fragments).  It is recommended
that hosts only send datagrams larger than 576 octets if they have
assurance that the destination is prepared to accept the larger
datagrams.

As for "all or nothing" with UDP datagrams, you also have the socket
layer case where the user does read() into a 1000 octet buffer and the
datagram was 1200 octets.  With BSD sockets you can (if you try)
detect this, but the extra 200 octets are lost forever.

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

The problem is IMO more this: the chunks of data that the application
writes doesn't map to what the other application reads.  In the lower
layers, I don't expect TCP segments to be split, and IP fragmentation
(if it happens at all) operates at an even lower level.

However the end result is still just as you write:

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

UDP datagrams of length 0 work (just tried it on Linux).  There's
nothing special about it.

> (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 buffer might fill with
> undeliverable headers)

Those messages should be delivered to the receiving socket, in the
sense that they are sanity-checked, used to wake up the application
and mark the socket readable, fill up one entry in the read queue and
so on ...

Of course your system at work may have the rights to be more
restrictive, if it's special-purpose.

/Jorgen

-- 
  // Jorgen Grahn    O  o   .
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem installing pip

2015-09-21 Thread Mark Lawrence

On 18/09/2015 06:54, Stephan wrote:

Good Morning,

I’ve tried ten times to install pip with no success in windows 10 using
python 64bit version.

Is there a solution available?

I’m looking forward hearing you soon.



The obvious solution is to get a version of Python like 3.4.3 or 3.5.0 
which comes with pip.  Failing that please cut and paste what you tried 
and what went wrong, we're not mind readers :)


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


[issue24657] CGIHTTPServer module discard continuous '/' letters from params given by GET method.

2015-09-21 Thread takayuki

takayuki added the comment:

This bug seems to remain in Python 3.5.0.

How to reproduce:

1. Save the attached cgitest.py into cgi-bin directory and changed it to 
executable file by "chmod +x cgitest.py"

2. Run CGIHTTPRequestHandler
[GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import http.server
>>> http.server.test(HandlerClass=http.server.CGIHTTPRequestHandler)

3. Visit http://localhost:8000/cgi-bin/cgitest.py by any browser.

4. Input "a/b/c//d//e///f///g" to form named "p".

5. The continuous slash letters are trimed and "a/b/c/d/e/f/g" is given to 
cgitest.py.

--

___
Python tracker 

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



[issue25202] with-statement doesn't release file handle after exception

2015-09-21 Thread Lauri Kajan

New submission from Lauri Kajan:

Hi all,

I found out that handle to a file opened with with-statement is not released in 
all cases.

I'm trying to delete a file when space on a disk is filled (0 bit left) by 
writing this file. I catch the IOError 28 to figure this out.
I write the file within the with-statement that is wrapped with try except. In 
the except block I try to delete the file but the handle to the file is not 
released.

In the following code fill-file can't be deleted because the file is still open.
I have described the problem also in stackoverflow [1].

# I recommend filling the disk almost full with some better tool.
import os
import errno

fill = 'J:/fill.txt'
try:
with open(fill, 'wb') as f:
while True:
n = f.write(b"\0")
except IOError as e:
if e.errno == errno.ENOSPC:
os.remove(fill)

This gives the following traceback:

Traceback (most recent call last):
  File "nospacelef.py", line 8, in 
n = f.write(b"\0")
IOError: [Errno 28] No space left on device

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "nospacelef.py", line 8, in 
n = f.write(b"\0")
IOError: [Errno 28] No space left on device

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "nospacelef.py", line 11, in 
os.remove(fill)
WindowsError: [Error 32] The process cannot access the file because it is being 
used by another process: 'J:/fill.txt'



[1] 
http://stackoverflow.com/questions/32690018/cant-delete-a-file-after-no-space-left-on-device

--
components: IO
messages: 251225
nosy: Lauri Kajan
priority: normal
severity: normal
status: open
title: with-statement doesn't release file handle after exception
type: behavior
versions: Python 3.4

___
Python tracker 

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



Re: Postscript to pdf

2015-09-21 Thread Christian Gollwitzer

Am 20.09.15 um 20:27 schrieb Baladjy KICHENASSAMY:

Hello,

I'm using macosx, ps2pdf version i don't know :/ sorry
ok actually i found what is the problem...

There is no problem with the ps file every thing is fine =)



You could try

ps2pdf -dEPSCrop input.ps output.pdf

that should create a PDF with the papersize derived from an EPS image.

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


[issue25207] ICC compiler warnings

2015-09-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 170cd0104267 by Victor Stinner in branch 'default':
Issue #25207, #14626: Fix my commit.
https://hg.python.org/cpython/rev/170cd0104267

--

___
Python tracker 

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



[issue14626] os module: use keyword-only arguments for dir_fd and nofollow to reduce function count

2015-09-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 170cd0104267 by Victor Stinner in branch 'default':
Issue #25207, #14626: Fix my commit.
https://hg.python.org/cpython/rev/170cd0104267

--

___
Python tracker 

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



Re: problem building python 3.5 extensions for windows

2015-09-21 Thread cjgohlke
On Monday, September 21, 2015 at 9:54:51 AM UTC-7, Robin Becker wrote:
> .
> >
> > This also sounds like the C++ stuff just wasn't installed.  I'm afraid
> > reinstallation is probably your best bet.
> >
> I used the default installation, but it failed first time around (perhaps a 
> network thing) and I stupidly assumed 'repair' would work.
> 
> After a full reinstallation at least vcvarsall is present and  I can at least 
> get the amd64/x86 compilers to work with bdist_wheel (I didn't get any errors 
> from using my already compiled relocatable libs) and I can no build the open 
> source reportlab extensions.
> 
> One simple extension
> 
> https://bitbucket.org/rptlab/pyrxp
> 
> doesn't get built. For some reason I get a hang in the linker for both amd64 
> & 
> x86. This builds fine for 27, 33 & 34.
> 
> 
> However, I see this in the output
> 
>   | creating C:\ux\XB33\repos\pyRXP\build\lib.win-amd64-3.5
>   | C:\Program Files (x86)\Microsoft Visual Studio 
> 14.0\VC\BIN\amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL
> /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\ux\XB33\py35_amd64\libs 
> /LIBPATH:C:\python35\libs /LIBPATH:C:\python35
> /LIBPATH:C:\ux\XB33\py35_amd64\PCbuild\amd64 "/LIBPATH:C:\Program Files 
> (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64"
>   "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 
> 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Win
> dows Kits\10\lib\10.0.10150.0\ucrt\x64" "/LIBPATH:C:\Program Files 
> (x86)\Windows 
> Kits\NETFXSDK\4.6\lib\um\x64" "/LIBPATH
> :C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" wsock32.lib 
> /EXPORT:PyInit_pyRXPU build\temp.win-amd64-3.5\
> Release\ux\XB33\repos\pyRXP\src\pyRXP.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\xmlparser.obj bui
> ld\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\url.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\s
> rc\rxp\charset.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\string16.obj 
> build\temp.win-amd64-3.5\Re
> lease\ux\XB33\repos\pyRXP\src\rxp\ctype16.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\dtd.obj build
> \temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\input.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\s
> rc\rxp\stdio16.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\system.obj 
> build\temp.win-amd64-3.5\Rele
> ase\ux\XB33\repos\pyRXP\src\rxp\hash.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\version.obj 
> build\
> temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\namespaces.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyR
> XP\src\rxp\http.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\nf16check.obj 
> build\temp.win-amd64-3.5\
> Release\ux\XB33\repos\pyRXP\src\rxp\nf16data.obj 
> /OUT:build\lib.win-amd64-3.5\pyRXPU.cp35-win_amd64.pyd /IMPLIB:build\te
> mp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\pyRXPU.cp35-win_amd64.lib
> 
>   | pyRXP.obj : warning LNK4197: export 'PyInit_pyRXPU' specified 
> multiple times; using first specification
>   |Creating library 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\pyRXPU.cp35-win_amd64.lib
>  
> and ob
> ject 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\pyRXPU.cp35-win_amd64.exp
> 
> 
>   | Generating code
> Stderr:  | error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 
> 14.0\\VC\\BIN\\amd64\\link.exe' failed with
> exit status 1
> 
> so there are some warnings which I don't understand. Maybe I need to do 
> something special for pyRXP (possibly I have some ifdefs poorly configured).
> -- 
> Robin Becker

How long did you let it "hang"? For me the incremental linker took in the order 
of 30 minutes to link. I mentioned this on the Python issue tracker at 
. 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24657] CGIHTTPServer module discard continuous '/' letters from params given by GET method.

2015-09-21 Thread Martin Panter

Martin Panter added the comment:

Yes it also seems to apply to Python 3.

Perhaps you forgot your test script, so I made my own. After running

python3 -m http.server --cgi

The response from the following URL has no double slashes to be seen:

http://localhost:8000/cgi-bin/test.py//x//y//?k=aa%2F%2Fbb&//q//p//=//a//b//

I am not a CGI expert, but I suspect the query string bits should have double 
slashes, but maybe the PATH_INFO is right not to (see RFC 3875).

--
nosy: +martin.panter
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40541/test.py

___
Python tracker 

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



[issue25184] "python -m pydoc -w" fails in nondecodable directory

2015-09-21 Thread Martin Panter

Martin Panter added the comment:

Serhiy’s patch essentially uses the local filesystem encoding and then percent 
encoding, rather than the current behaviour of strict UTF-8 encoding and 
percent encoding. This is similar to what the “pathlib” make_uri() methods do, 
so maybe we could let “pathlib” do the work instead.

This draft RFC discusses encoding “file:” URLs:

https://tools.ietf.org/html/draft-ietf-appsawg-file-scheme-03#section-4

It suggests leaving Unicode characters alone (in IRIs) if possible, or using 
UTF-8 and percent encoding even if the filesystem uses a non-UTF-8 encoding. 
Perhaps we could leave the filename in the HTML as Unicode characters without 
percent encoding, and only percent encode the undecodable (surrogate-escaped) 
bytes.

This “IRI” scheme is also recommended by 
, 
which says on Windows, “in file URIs, percent-encoded octets are interpreted as 
a byte in the user’s current codepage”. This contradicts the draft RFC and the 
“pathlib” implementation, which both use UTF-8.

--

___
Python tracker 

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2015-09-21 Thread Brett Cannon

Brett Cannon added the comment:

As soon as someone finds the time to make the change we can switch. While this 
is a necessary requirement to change the workflow it isn't gated by it either.

--

___
Python tracker 

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



Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread Chris Angelico
On Tue, Sep 22, 2015 at 7:36 AM,   wrote:
> Thank you very much. Can I write .py pages like in PHP or should I
> use a framework like Django, Web2py or TurboGears?

I recommend using WSGI and a framework that uses it (my personal
preference is Flask, but the above will also work). Here are a couple
of simple sites:

https://github.com/Rosuav/Flask1
https://github.com/Rosuav/MinstrelHall

You can see them in operation here:

http://rosuav.com/1/
http://minstrelhall.com/

Note how URLs are defined in the code, rather than by having a bunch
of loose files (the way a PHP web site works). This makes it a lot
easier to group things logically, and utility lines like redirects
become very cheap. The maintenance burden is far lighter with this
kind of one-file arrangement.

These sites are really tiny, though, so if you have something a bit
bigger, you'll probably want to split things into multiple files. Good
news! You can do that, too - it's easy enough to split on any boundary
you find logical.

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


[issue25206] PEP 498: Minor mistakes/outdateness

2015-09-21 Thread Martin Panter

Martin Panter added the comment:

Also in the first example, the colon (format specifier) and exclamation mark 
(conversion) are in the wrong order. It should either be

f"{expr3:!s}" → format(expr3, "!s")

or

f"{expr3!s:}" → format(str(expr3), "")

--
nosy: +martin.panter

___
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-21 Thread Martin Panter

Martin Panter added the comment:

Previous report: Issue 14029

--
nosy: +martin.panter

___
Python tracker 

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



[issue24870] Optimize coding with surrogateescape and surrogatepass error handlers

2015-09-21 Thread STINNER Victor

STINNER Victor added the comment:

Ok, I prepared the code for the UTF-8 optimization.

@Serhiy: would you like to rebase your patch  faster_surrogates_hadling.patch?

Attached utf8.patch is a less optimal implementation which only changes 
PyUnicode_DecodeUTF8Stateful(). Maybe it's enough?

I would like to see a benchmark here to choose the good compromise between 
performance and code complexity.

--
Added file: http://bugs.python.org/file40540/utf8.patch

___
Python tracker 

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



[issue24861] deprecate importing components of IDLE

2015-09-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e9edb95ca8b6 by Terry Jan Reedy in branch '2.7':
Issue #24861: add Idle news items and correct previous errors.
https://hg.python.org/cpython/rev/e9edb95ca8b6

New changeset 5087ca9e6002 by Terry Jan Reedy in branch '3.4':
Issue #24861: add Idle news item and correct previous errors.
https://hg.python.org/cpython/rev/5087ca9e6002

--

___
Python tracker 

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



[issue25188] regrtest.py improvement for Profile Guided Optimization builds

2015-09-21 Thread Brett Cannon

Brett Cannon added the comment:

Ah, OK. As I said I had not run it so I wasn't sure of the actual outcome. =)

As for keyword-only arguments/parameters, see 
https://www.python.org/dev/peps/pep-3102/ . They are a Python 3 feature.

--

___
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-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

NEWS entries are done.

I added a function, copy_strip, to help.py to rstrip (in bytes mode) idle.html 
as it copies to help.html.  (I changed the name to better remember which is 
which.)  In my .bat file, with Doc as current directory, I use
  ..\pcbuild\python_d.exe -c "from idlelib.help import copy_strip; copy_strip()"
I could change the if __name__ block so that
  ..\pcbuild\python_d.exe -m idlelib.help copy_strip
would work.  Either way, I would like to add 'idlehelp' to makefiles.  But not 
tonight.

--

___
Python tracker 

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2015-09-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Is that something that might happen 'soon' or only when the whole workflow is 
redone?

--

___
Python tracker 

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



[issue1731717] race condition in subprocess module

2015-09-21 Thread Vitaly

Vitaly added the comment:

Is this issue fixed in python 2.7.10? I am experiencing strange race conditions 
in code that combines threads with multiprocessing pool, whereby a thread is 
spawned by each pool worker. Running on latest Mac OS X.

--
nosy: +vitaly

___
Python tracker 

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



[issue24870] Optimize coding with surrogateescape and surrogatepass error handlers

2015-09-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3c430259873e by Victor Stinner in branch 'default':
Issue #24870: Optimize the ASCII decoder for error handlers: surrogateescape,
https://hg.python.org/cpython/rev/3c430259873e

--
nosy: +python-dev

___
Python tracker 

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



[issue24870] Optimize coding with surrogateescape and surrogatepass error handlers

2015-09-21 Thread STINNER Victor

STINNER Victor added the comment:

I pushed a change to optimize the ASCII decoder.

Attached bench.py script: microbenchmark on the ASCII decoder. My results 
follows.

Common platform:
Platform: Linux-4.1.5-200.fc22.x86_64-x86_64-with-fedora-22-Twenty_Two
Bits: int=32, long=64, long long=64, size_t=64, void*=64
Timer: time.perf_counter
CFLAGS: -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g 
-fwrapv -O3 -Wall -Wstrict-prototypes
CPU model: Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
Python unicode implementation: PEP 393
Timer info: namespace(adjustable=False, 
implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, 
resolution=1e-09)

Platform of campaign before:
Timer precision: 57 ns
Date: 2015-09-21 23:48:00
SCM: hg revision=73867bf953e6 branch=default date="2015-09-21 22:40 +0200"
Python version: 3.6.0a0 (default:73867bf953e6, Sep 21 2015, 23:47:35) [GCC 
5.1.1 20150618 (Red Hat 5.1.1-4)]

Platform of campaign after:
Timer precision: 55 ns
Date: 2015-09-21 23:52:55
Python version: 3.6.0a0 (default:bb0f55f1ec22+, Sep 21 2015, 23:52:43) [GCC 
5.1.1 20150618 (Red Hat 5.1.1-4)]
SCM: hg revision=bb0f55f1ec22+ tag=tip branch=default date="2015-09-21 23:06 
+0200"

--+-+---
ignore|  before |  after
--+-+---
256 x 10**1 bytes |  314 us (*) | 5.25 us (-98%)
256 x 10**3 bytes | 31.9 ms (*) |  509 us (-98%)
256 x 10**2 bytes | 3.13 ms (*) | 50.2 us (-98%)
256 x 10**4 bytes |  315 ms (*) | 5.12 ms (-98%)
--+-+---
Total |  351 ms (*) | 5.69 ms (-98%)
--+-+---

--+-+---
replace   |  before |  after
--+-+---
256 x 10**1 bytes |  352 us (*) | 6.32 us (-98%)
256 x 10**3 bytes | 35.2 ms (*) |  608 us (-98%)
256 x 10**2 bytes | 3.52 ms (*) | 60.9 us (-98%)
256 x 10**4 bytes |  354 ms (*) | 6.19 ms (-98%)
--+-+---
Total |  393 ms (*) | 6.87 ms (-98%)
--+-+---

--+-+---
surrogateescape   |  before |  after
--+-+---
256 x 10**1 bytes |  369 us (*) | 5.92 us (-98%)
256 x 10**3 bytes | 36.8 ms (*) |  570 us (-98%)
256 x 10**2 bytes | 3.69 ms (*) | 56.9 us (-98%)
256 x 10**4 bytes |  371 ms (*) | 5.79 ms (-98%)
--+-+---
Total |  412 ms (*) | 6.43 ms (-98%)
--+-+---

--+-+
backslashreplace  |  before |   after
--+-+
256 x 10**1 bytes |  357 us (*) |  361 us
256 x 10**3 bytes | 35.1 ms (*) | 36.1 ms
256 x 10**2 bytes | 3.52 ms (*) | 3.59 ms
256 x 10**4 bytes |  357 ms (*) |  365 ms
--+-+
Total |  396 ms (*) |  405 ms
--+-+

-+--+---
Summary  |   before |  after
-+--+---
ignore   |   351 ms (*) | 5.69 ms (-98%)
replace  |   393 ms (*) | 6.87 ms (-98%)
surrogateescape  |   412 ms (*) | 6.43 ms (-98%)
backslashreplace |   396 ms (*) | 405 ms
-+--+---
Total| 1.55 sec (*) |  424 ms (-73%)
-+--+---

--
Added file: http://bugs.python.org/file40539/bench.py

___
Python tracker 

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



[issue25114] asynico: add ssl_object extra info

2015-09-21 Thread Yury Selivanov

Yury Selivanov added the comment:

the patch lgtm

--

___
Python tracker 

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



[issue25202] Windows: with-statement doesn't release file handle after exception on "No space left on device" error

2015-09-21 Thread STINNER Victor

STINNER Victor added the comment:

@Lauri: What is your Python version? Can you retry your test with Python 3.5?

--
nosy: +haypo

___
Python tracker 

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



Re: Getting PyCharm to import sklearn

2015-09-21 Thread Joel Goldstick
On Mon, Sep 21, 2015 at 11:27 AM,  wrote:

> Beginner here.
>
> I'm trying to use sklearn in pycharm. When importing sklearn I get an
> error that reads "Import error: No module named sklearn" The project
> interpreter in pycharm is set to 2.7.10 (/anaconda/bin/python.app), which
> should be the right one. Under default preferenes, project interpreter, I
> see all of anacondas packages. I've double clicked and installed the
> packages scikit learn and sklearn. I still receive the "Import error: No
> module named sklearn"
>
> Does anyone know how to solve this problem?
> --
> https://mail.python.org/mailman/listinfo/python-list
>

It looks like they changed the name.  Maybe this link will help you:

http://scikit-learn.org/stable/install.html

-- 
Joel Goldstick
http://joelgoldstick.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hello

2015-09-21 Thread Zachary Ware
On Thu, Sep 17, 2015 at 10:10 AM, moon khondkar  wrote:
> Hello I have problem with python installation.I downloaded python 3.5 but I 
> cannot use it on my computer.I can not open the idle. I get something like 
> saying "users\local settings\Application 
> data\programs\python\python35-32\pythonw.exe is not valid win32 application. 
> Thanks that will be help if you can solve this.

This sounds suspiciously like you tried to install on Windows XP or
Windows Server 2003, both of which are not supported by Python 3.5.

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


Looking for a Database Developer with 2-3 years Python experience

2015-09-21 Thread liannebloemen
Looking for Database Developer - London (up to £30k)

The Database Developer requires a wide set of database development and data 
integration skills, along with demonstrated excellence in problem solving and 
communication. Experience with Python is highly essential, as we will be 
developing a bespoke Django framework that allows the organisation direct 
access to marketing software and their client database. You will work from the 
London office within a company that has invested significant resources in 
building what is already an impressive data management team. 

The Database Developer works on data querying and manipulation tools, marketing 
software, and automatising key business procedures.

It is a must to have 2-3 year's experience in programming in Python!

You will be supporting and adding to the bespoke data administering systems and 
improving ways to integrate the data with he rest of the organisation. 

Key skills

* Python!
* Experience manipulating databases
* Basic HTML knowledge
* Experience with web design and web app development
* Django experience
* Familiar with test-driven development working practices

Apply now and send your CV to ja...@caseltonclark.co.uk

Caselton Clark are a recruitment agency specialising in Media and Events based 
in Central London. For our latest vacancies please visit www.caseltonclark.co.uk
-- 
https://mail.python.org/mailman/listinfo/python-list


Getting PyCharm to import sklearn

2015-09-21 Thread edanmizrahi
Beginner here.

I'm trying to use sklearn in pycharm. When importing sklearn I get an error 
that reads "Import error: No module named sklearn" The project interpreter in 
pycharm is set to 2.7.10 (/anaconda/bin/python.app), which should be the right 
one. Under default preferenes, project interpreter, I see all of anacondas 
packages. I've double clicked and installed the packages scikit learn and 
sklearn. I still receive the "Import error: No module named sklearn"

Does anyone know how to solve this problem?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25202] Windows: with-statement doesn't release file handle after exception on "No space left on device" error

2015-09-21 Thread eryksun

eryksun added the comment:

Lauri changed the version from 3.4 to 3.2, and I was able to reproduce the 
problem in 3.2.5:

C:\Temp>py -3.2 --version
Python 3.2.5
C:\Temp>py -3.2 nospace.py
removing fill.txt
Traceback (most recent call last):
  File "nospace.py", line 8, in 
n = f.write(b"\0")
IOError: [Errno 28] No space left on device

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "nospace.py", line 8, in 
n = f.write(b"\0")
IOError: [Errno 28] No space left on device

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "nospace.py", line 12, in 
os.remove(fill)
WindowsError: [Error 32] The process cannot access the file because it is 
being used by another process: 'T:\\fill.txt'

It's a sharing violation, since the file handle isn't closed and wasn't opened 
with FILE_SHARE_DELETE.

There's no problem in 3.4 or 3.5 since it properly closes the file handle even 
if flush() fails:

C:\Temp>py -3.4 --version
Python 3.4.3
C:\Temp>py -3.4 nospace.py
removing fill.txt

C:\Temp>py -3.5 --version
Python 3.5.0
C:\Temp>py -3.5 nospace.py
removing fill.txt

--

___
Python tracker 

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



Re: problem building python 3.5 extensions for windows

2015-09-21 Thread Robin Becker




The most reported problem trying to build anything on Windows that is Python
related.


.


I'd be inclined to go for the reinstall, painful as that might be.  I've tried
finding the batch file as a separate download but there's just too many hits
about "download Visual Studio".


I think that's where I'm headed.

Sadly this has been the worst python upgrade for a long time in windows land. I 
would gladly forgo all the bells and whistles for a simple install of the C 
compiler, but I'm never certain that I'll be able to do cross-compiles etc etc 
etc  :(

--
Robin Becker

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


Re: problem building python 3.5 extensions for windows

2015-09-21 Thread Phil Thompson
On 21 Sep 2015, at 3:00 pm, Robin Becker  wrote:
> 
> 
>> 
>> The most reported problem trying to build anything on Windows that is Python
>> related.
>> 
> .
>> 
>> I'd be inclined to go for the reinstall, painful as that might be.  I've 
>> tried
>> finding the batch file as a separate download but there's just too many hits
>> about "download Visual Studio".
>> 
> I think that's where I'm headed.
> 
> Sadly this has been the worst python upgrade for a long time in windows land. 
> I would gladly forgo all the bells and whistles for a simple install of the C 
> compiler, but I'm never certain that I'll be able to do cross-compiles etc 
> etc etc  :(

I had no problems with the community edition. Just select a Custom install and 
select "Common Tools for Visual C++ 2015" as the only feature. That gave me 
command shells in the start menu for native and cross-compilers.

Phil

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


[issue25202] Windows: with-statement doesn't release file handle after exception on "No space left on device" error

2015-09-21 Thread Zachary Ware

Changes by Zachary Ware :


--
superseder:  -> file descriptor not being closed with context manager on 
IOError when device is full

___
Python tracker 

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



[issue24520] Stop using deprecated floating-point environment functions on FreeBSD

2015-09-21 Thread Stefan Krah

Stefan Krah added the comment:

Regarding volatile: gcc/clang seem to honor *some* changes to
the control word. At least in libmpdec both compilers have
always left the settings 80bit-prec/ROUND_CHOP intact, even
though it's not the default.

Let's rewrite Python in asm to avoid these issues. :)

--

___
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-21 Thread Cai Gengyang
Hi ChrisA,

1) A system where users can upload photos/images/videos of their loved ones and 
family onto the web-based app (It's going to be web-based website) 

Creating a web site using Python is pretty easy. Grab Flask, Django, etc, and 
off you go.Uploading files isn't difficult, although since you're working with 
large files here, you'll eventually need some beefy hardware to run this on 
(free accounts might not have enough storage and/or bandwidth to handle lots of 
users). 

 Sure , sounds good.

2) A system where where the users can then edit these photos/images/videos into 
short , funny cartoons/videos 

This one's a bit open-ended, but more importantly, it needs a lot of front-end 
work. Editing images in Python code won't be particularly hard; but letting 
your users choose how those images are put together? That's going to require a 
boatload of JavaScript work. How good are you at front-end design and coding? 

 No experience at all. Guess I'll have to learn Javascript to do this. I'll 
also need the capability to let users edit their photos/images and videos into 
great looking real-time cartoons based on themes (what technologies would I 
need to learn to create this?)

3) A system where users can create an account with username/password/log in 
information 

Subtly tricky to get right if you do it manually, but trivially easy to get 
someone else to do the work for you. Grab something like Flask-Login and the 
job's done. 

 Ok , sounds good

4) A system where users can then share and publish these pictures on the 
website itself using their account and also link and upload onto other 
traditional social networks like Facebook, Twitter and Google+ accounts and 
also onto their other handheld devices like IPhone , Apple Devices, Samsung 
handphones etc 

Fundamentally, all this requires is stable URLs that people can post. That's 
pretty easy (esp if you're using a good framework). Making sure they work 
properly on mobile phones is generally a matter of starting with something 
simple, and then testing every change on lots of devices. It's a bit of work, 
but nothing unattainable. 

- Ok, sounds good

Your hardest part is #2, and sadly, that's also the part that makes or breaks 
this service. Without that, all you're doing is recreating FTP. So that's what 
you have to think about: Can you write all that front-end code? This will not 
be simple; it'll be a pretty big project. 

- Yup, I'll have to find a way to make it work really well. The user must 
have the capability to create and design really good-looking real-time 
video-cartoons that they can then share with other users. It's going to be what 
differentiates my product from other services (as far as I can tell, no other 
site currently in existence has such a capability) 


Guess the first step I would need to do is to create a basic website in Python 
using Flask, Django then 

Cai Gengyang


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


[issue18967] Find a less conflict prone approach to Misc/NEWS

2015-09-21 Thread Brett Cannon

Brett Cannon added the comment:

It should be mentioned in this issue that the core-workflow mailing list 
decided on having NEWS entries being attached to the related issue in the issue 
tracker. This was then presented to python-committers and no one objected to 
the idea.

--

___
Python tracker 

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



Re: Getting PyCharm to import sklearn

2015-09-21 Thread edanmizrahi
On Monday, September 21, 2015 at 9:00:16 AM UTC-7, Joel Goldstick wrote:
> On Mon, Sep 21, 2015 at 11:27 AM,   wrote:
> Beginner here.
> 
> 
> 
> I'm trying to use sklearn in pycharm. When importing sklearn I get an error 
> that reads "Import error: No module named sklearn" The project interpreter in 
> pycharm is set to 2.7.10 (/anaconda/bin/python.app), which should be the 
> right one. Under default preferenes, project interpreter, I see all of 
> anacondas packages. I've double clicked and installed the packages scikit 
> learn and sklearn. I still receive the "Import error: No module named sklearn"
> 
> 
> 
> Does anyone know how to solve this problem?
> 
> --
> 
> https://mail.python.org/mailman/listinfo/python-list
> 
> 
> It looks like they changed the name.  Maybe this link will help you:
> 
> 
> http://scikit-learn.org/stable/install.html
> 
> 
> -- 
> 
> 
> 
> Joel Goldstick
> http://joelgoldstick.com

Thanks Joel.
1. In the terminal I get: Requirement already up-to-date: scikit-learn in 
/anaconda/lib/python2.7/site-packages"

2. In pycharm, a simple:
import sklearn
print sklearn.__file__

I get.. 

3. /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 
/Users/EdanMizrahi/PycharmProjects/untitled3/tryagain
Traceback (most recent call last):
  File "/Users/EdanMizrahi/PycharmProjects/untitled3/tryagain", line 1, in 

import sklearn
ImportError: No module named sklearn

Process finished with exit code 1

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


[issue23972] Asyncio reuseport

2015-09-21 Thread STINNER Victor

STINNER Victor added the comment:

Hum, the latest patch was not reviewed yet :-(

--
nosy: +ysionneau

___
Python tracker 

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



[issue25188] regrtest.py improvement for Profile Guided Optimization builds

2015-09-21 Thread Brett Cannon

Brett Cannon added the comment:

I left some comments on the Python 3.6 version of the patch. I don't know if we 
should apply such a change to Python 2.7 or 3.5, though, as it is a new feature 
of regrtest and thus runs the risk of breaking stuff. Then again, we have said 
that anything in the test package has not backwards-compatibility guarantees.

--

___
Python tracker 

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



[issue24779] Python/ast.c: decode_unicode is never called with rawmode=True

2015-09-21 Thread Eric V. Smith

Changes by Eric V. Smith :


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



[issue24779] Python/ast.c: decode_unicode is never called with rawmode=True

2015-09-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5230115de64d by Eric V. Smith in branch 'default':
Issue #24779: Remove unused rawmode parameter to unicode_decode.
https://hg.python.org/cpython/rev/5230115de64d

--
nosy: +python-dev

___
Python tracker 

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



  1   2   >