[issue34561] Replace list sorting merge_collapse()?

2018-09-04 Thread Tim Peters


Tim Peters  added the comment:

A new version of the file models a version of the `powersort` merge ordering 
too.  It clearly dominates timsort and 2-merge in all cases tried, for this 
notion of "cost".

Against it, its code is much more complex, and the algorithm is very far from 
obvious.  The paper "motivates" it but doesn't really explain it in enough 
detail to make most of it clear (but refers to other papers where pieces of it 
are developed).

Curious:  unless a run is the last in an array, powersort never merges it 
immediately upon finding it.  Instead its start and length are used to compute 
a "power", in turn used to decide whether to merge some previous number of 
runs.  A dollar to anyone who can figure out what the heck the "power" 
computation is really doing in less than a full day without reading the paper 
;-)  Then two dollars if you can prove that the "never equal!" assert holds.

It would require timing lots of C code on various cases to see whether the 
possible delay in merging new runs really matters.  It's unclear to me a 
priori, because it buys something too (less memory copying overall).

In any case, just switching to 2-merge would be easy, and that alone is enough 
to squash the contrived "bad cases" for the current approach.  `powersort` 
would too, but may also actually help a bit in ordinary cases.  Or not.

--
Added file: https://bugs.python.org/file47785/runstack.py

___
Python tracker 

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



Re: Verifying the integrity/lineage of a file

2018-09-04 Thread Thomas Jollans
On 2018-09-04 16:13, Grant Edwards wrote:
> On 2018-09-01, Peter Pearson  wrote:
> 
>> Writing your own crypto software is fraught with peril, and that
>> includes using existing libraries.
> 
> Writing your own crypto software isn't a problem, and it can be very
> educational.
> 
> Just don't _use_ your own crypto software.
> 
> Howerver, the set of people who write software without intending to
> use it is pretty small...
> 

Apart from all the people writing specialist software that's not
relevant to their profession (seeing as they're programmers, not
whatever the target audience is) intending to sell it.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pass a list of values as options to 3 dropdown menus

2018-09-04 Thread Peter Pearson
On Tue, 4 Sep 2018 10:13:07 -0700 (PDT), Nick Berg wrote:
[snip]
>
> May i ask how you managed to send an email with a domain
> nowhere.invalid ? I would like to do the same.

I don't post by sending email, I post by using a news client (slrn),
which interacts with the Usenet system
(en.wikipedia.org/wiki/News_client), a largely decentralized
news-sharing system that dates from the 1970's (I think) and works
through the use of a somewhat casual network of servers that circulate
messages among themselves.  In contrast (if I read your headers right),
you read and post by using Google Groups, a newfangled invention that
we fossils from the days of gods and giants consider lame and hostile
to efficient organization, and we suspect that prolonged use
results in an inability to hoist one's trousers above one's buttocks
and a tendency to use interrogatory intonation on declarative sentences.

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


Re: Verifying the integrity/lineage of a file

2018-09-04 Thread Abdur-Rahmaan Janhangeer
i think he was referring to a wrapper for a crypto-software

Abdur-Rahmaan Janhangeer
https://github.com/Abdur-rahmaanJ
Mauritius

On Sat, 1 Sep 2018, 21:45 Peter Pearson,  wrote:

>
> Writing your own crypto software is fraught with peril,
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34563] invalid assert on big output of multiprocessing.Process

2018-09-04 Thread Oleksandr Buchkovskyi


Change by Oleksandr Buchkovskyi :


--
pull_requests: +8528

___
Python tracker 

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



Re: Verifying the integrity/lineage of a file

2018-09-04 Thread Gregory Ewing

Grant Edwards wrote:

Writing your own crypto software isn't a problem, and it can be very
educational.

Just don't _use_ your own crypto software.


Okay, so find a friend who also likes writing crypto
software, and use each other's software. Problem solved. :-)

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


[issue34568] Types in `typing` not anymore instances of `type` or subclasses of "real" types

2018-09-04 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

It was a deliberate decision. You can find some motivation in PEP 560, and yes 
we used provisional status here. It was a hard decision, but we decided that 
giving up few percent of backwards compatibility is a reasonable price for up 
to 5x performance boost.

It looks like some of your problems may be solved by 
https://github.com/ilevkivskyi/typing_inspect (use `pip install 
typing_inspect`) that aims at providing cross-version runtime introspection of 
typing objects by carefully wrapping some "hidden" internal API.

There is a plan to include most used part of typing_inspect in typing itself, 
see for example https://github.com/python/typing/issues/570.
(it is hard to give an estimate about when, I really want to do this soon, but 
just don't have time).

--

___
Python tracker 

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



Re: Cross platform mutex to prevent script running more than instance?

2018-09-04 Thread Cameron Simpson

On 04Sep2018 07:57, CFK  wrote:

What about using flock()? I don't know if it works on Windows, but it works
really well for Unix/Linux systems.  I typically create a log file in a
known location using any atomic method that doesn't replace/overwrite a
file, and flock() it for the duration of the script.


Please adopt the inline reply format. Thanks.

The good things about flock() and open(O_EXCL) and other variations is that if 
your program aborts (or its OS aborts) the lock goes away. The downside is that 
it is less cross platform (including network filesystems). Even ignoring 
nonUNIX systems I have counter examples: I've got a (pretty dumb) embedded 
Linux box here whose NFS doesn't support locking. SO flock() goes out the 
window if the lock uses it.


Now, many use cases are single machine or may never meaningfully use a network 
filesystem. But if I'm writing _library_ code then I, as the author, don't know 
who will be calling my code in the future. So my inclination is to go for mkdir 
because it is so portable and robust.


The downside with mkdir, and also with pd files really, is that a program or OS 
abort can leave them lying around. Being persistent objects, some kind of 
cleanup is needed. For me, that is usually a price I'll accept in order to have 
a robust works-anywhere tool.


Aside: pid files? How do you know they're really stale? PIDs can be reused. On 
Linux and many UNIXes, PIDs get reused really fast (sequentially allocated); 
even OpenBSD with its cool unpredictable PIDs has this issue to a lesser 
degree.


What you can get away with depends on your use cases. If you like automatic 
cleanup, flock and its file descriptor based variants are simple and at least 
always go away on program exit, whatever the reason. If you can wear some 
cleanup, mkdir is portable and releiable. (And you can store state information 
inside the dir!)


Given the subject line ("Cross platform mutex to prevent script running more 
than instance") I'd go for mkdir myself.


Cheers,
Cameron Simpson 


Thanks,
Cem Karan

On Mon, Sep 3, 2018, 11:39 PM Cameron Simpson  wrote:


On 03Sep2018 07:45, Malcolm Greene  wrote:
>Use case: Want to prevent 2+ instances of a script from running ...
>ideally in a cross platform manner. I've been researching this topic and
>am surprised how complicated this capability appears to be and how the
>diverse the solution set is. I've seen solutions ranging from using
>directories, named temporary files,  named sockets/pipes, etc. Is there
>any consensus on best practice here?

I like os.mkdir of a known directory name. This tends to be atomic and
forbidden when the name already exists, on all UNIX platforms, over remote
filesystems. And, I expect, likewise on Windows.

All the other modes like opening files O_EXCL etc tend to be platform
specific
and not reliable over network filesystems.

And pid based approaches don't work cross machine, if that is an issue.

Cheers,
Cameron Simpson 

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


[issue34583] os.stat() wrongfully returns False for symlink on Windows 10 v1803

2018-09-04 Thread Isaac Shabtay


New submission from Isaac Shabtay :

Windows 10 Pro, v1803.
Created a directory: D:\Test
Created a symbolic link to it: C:\Test -> D:\Test

The current user has permissions to access the link, however os.stat() fails:

>>> os.stat('C:\\Test')
Traceback (most recent call last):
  File "", line 1, in 
PermissionError: [WinError 5] Access is denied: 'C:\\Test'

The only change in my system since this has last worked, is that I upgraded to 
v1803 (used to be v1709 up until about a week ago).

--
components: Library (Lib)
messages: 324605
nosy: Isaac Shabtay
priority: normal
severity: normal
status: open
title: os.stat() wrongfully returns False for symlink on Windows 10 v1803
versions: Python 3.7

___
Python tracker 

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



[issue34582] VSTS builds should use new YAML syntax and pools

2018-09-04 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
pull_requests: +8527
stage:  -> patch review

___
Python tracker 

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



[issue34582] VSTS builds should use new YAML syntax and pools

2018-09-04 Thread David Staheli


Change by David Staheli :


--
nosy: David Staheli
priority: normal
severity: normal
status: open
title: VSTS builds should use new YAML syntax and pools

___
Python tracker 

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



[issue33083] math.factorial accepts non-integral Decimal instances

2018-09-04 Thread STINNER Victor


STINNER Victor  added the comment:

I agree to not backport the change to 3.7 and older. The change can be seen as 
subtle behaviour change which breaks backward compatibility.

--
status: pending -> closed
versions:  -Python 2.7, Python 3.7

___
Python tracker 

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



[issue34581] Windows : use of __pragma msvc extension without ifdef

2018-09-04 Thread Erik Janssens


Change by Erik Janssens :


--
keywords: +patch
pull_requests: +8526
stage:  -> patch review

___
Python tracker 

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



[issue34581] Windows : use of __pragma msvc extension without ifdef

2018-09-04 Thread Erik Janssens


New submission from Erik Janssens :

The socketmodule uses the MSVC extension __pragma.

The use of this extension is not enabled/disable by an #ifdef _MSC_VER.

This prevents compilation with other compilers then MSVC on Windows.

--
components: Extension Modules
messages: 324603
nosy: erikjanss
priority: normal
severity: normal
status: open
title: Windows : use of __pragma msvc extension without ifdef
type: compile error
versions: Python 3.8

___
Python tracker 

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



Re: Hi I'm trying to get live data from stock using python , is it possible?

2018-09-04 Thread Akkana Peck
Skip Montanaro writes:
> > I want to know if AAPL is more than value 300 and if it does I want it to 
> > send to me mail with gmail :) . thanks for the help..
> 
> Try searching pypi.org for "finance", then scroll through the many
> returned packages. A few show how to get stock data from Yahoo! or
> Google.

Yahoo and Google both used to offer APIs for financial data, and
matplotlib (later moved into a separate module, mpl_finance) used to
have a Python wrapper around Yahoo's API; but Yahoo shut their
financial API down in mid-2017 and Google followed suit soon after. See:
http://www.financial-hacker.com/bye-yahoo-and-thank-you-for-the-fish/

The comments include links to a lot of possible alternatives.
Most of them require API keys and some charge a fee.
You should probably try several to find out which works best
for you, and expect to update your code every year or two as
financial quote services seem to come and go.

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


Re: Any SML coders able to translate this to Python?

2018-09-04 Thread Thomas Jollans
On 2018-09-04 14:26, Steven D'Aprano wrote:
> I have this snippet of SML code which I'm trying to translate to Python:
> 
> fun isqrt n = if n=0 then 0
>  else let val r = isqrt (n/4)
>   in
> if n < (2*r+1)^2 then 2*r
> else 2*r+1
>   end
> 
> 
> I've tried reading up on SML and can't make heads or tails of the 
> "let...in...end" construct.


I don't know SML specifically, but my guess would be that
  let X = Y in A end
means "A, evaluated in a local scope where X refers to Y". Reasoning:
often (e.g. in JavaScript), 'let' sets something in a local scope, and I
think Haskell has a construct like this? It's been a while since I
played around with Haskell though... In an as-direct-as-possible Python
translation, (lambda X=Y: A)()

So,

isqrt = (lambda n: 0 if n == 0 else
(lambda r=isqrt(n//4):
2*r if n < (2*r+1)**2 else 2*r+1)())

This is obviously the same as your multi-expression function, with the
addition of the integer division as suggested by Marko.

Cheers,
Thomas



> 
> The best I've come up with is this:
> 
> def isqrt(n):
> if n == 0:
> return 0
> else:
> r = isqrt(n/4)
> if n < (2*r+1)**2:
> return 2*r
> else:
> return 2*r+1
> 
> but I don't understand the let ... in part so I'm not sure if I'm doing 
> it right.
> 
> 


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


[issue33083] math.factorial accepts non-integral Decimal instances

2018-09-04 Thread Mark Dickinson


Change by Mark Dickinson :


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

___
Python tracker 

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



[issue33083] math.factorial accepts non-integral Decimal instances

2018-09-04 Thread Mark Dickinson


Mark Dickinson  added the comment:

The issue description mentions 3.7 and 2.7, but GH-6149 wasn't marked for 
backport. My feeling is that it isn't worth backporting the fix, in which case 
this issue can be closed.

--

___
Python tracker 

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



[issue34563] invalid assert on big output of multiprocessing.Process

2018-09-04 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e8ca8806a9f47b3bac4ae1c6b8a54c47d1aad8f3 by Victor Stinner (Miss 
Islington (bot)) in branch '3.7':
bpo-34563: Fix for invalid assert on big output of multiprocessing.Process 
(GH-9027) (GH-9064)
https://github.com/python/cpython/commit/e8ca8806a9f47b3bac4ae1c6b8a54c47d1aad8f3


--

___
Python tracker 

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



[issue31226] shutil.rmtree fails when target has an internal directory junction (Windows)

2018-09-04 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.8

___
Python tracker 

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



[issue31512] Add non-elevated symlink support for dev mode Windows 10

2018-09-04 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.8 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue1654408] Windows installer should split tcl/tk and tkinter install options.

2018-09-04 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

In support of closing this, I note that we have gone the opposite direction on 
Mac, installing current tcl/tk together with _tkinter compiled against the 
tcl/tk being installed.

--
nosy:  -BreamoreBoy

___
Python tracker 

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



Re: Pass a list of values as options to 3 dropdown menus

2018-09-04 Thread Terry Reedy

On 9/4/2018 1:03 PM, Peter Pearson wrote:

On Sun, 2 Sep 2018 13:40:18 -0700 (PDT), Nick Berg wrote:

how can i be able to store a list of values to drop-down menu and then
grab the value that the user selects?


In a python program, use one of the gui packages.  Tkinter usually comes 
with python and can handle this easily with a Listbox or ttk.Combobox.


--
Terry Jan Reedy

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


[issue34577] imaplib Cyrillic password

2018-09-04 Thread Christian Heimes


Christian Heimes  added the comment:

This is not a bug in Python's imaplib but a limitation of the LDAP protocol. 
It's not possible to enable UTF-8 mode before the session is authenticatd. 
LOGIN supports only ASCII user name and password. You have to use SASL PLAIN 
handshake with AUTHENTICATE, see https://tools.ietf.org/html/rfc6855.html#page-5

--
status:  -> open

___
Python tracker 

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



[issue8110] subprocess.py doesn't correctly detect Windows machines

2018-09-04 Thread Zachary Ware


Change by Zachary Ware :


--
nosy: +giampaolo.rodola, gregory.p.smith
versions: +Python 3.6, Python 3.7, Python 3.8 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue34561] Replace list sorting merge_collapse()?

2018-09-04 Thread Tim Peters


Tim Peters  added the comment:

"Galloping" is the heart & soul of Python's sorting algorithm.  It's explained 
in detail here:

https://github.com/python/cpython/blob/master/Objects/listsort.txt

The Java fork of the sorting code has had repeated bugs due to reducing the 
size of "the stack" used to hold merge states.  Read the papers already 
referenced for details about that.

There is no "bug" here in the Python version.  It's that the complex code Java 
keeps tripping over ;-) , _could_ (possibly) be replaced by simpler code where 
the max stack size needed is obvious; that (e.g.) 2-merge moves around less 
memory overall in some cases where the current scheme is particularly wasteful 
in this respect; and that Munro & Wild present more ambitious merge-ordering 
schemes that are said to be provably near-optimal in a broader sense than 
2-merge achieves.

--

___
Python tracker 

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



[issue34561] Replace list sorting merge_collapse()?

2018-09-04 Thread Koos Zevenhoven

Koos Zevenhoven  added the comment:

It doesn’t seem like there’s a real problem here, but you seem to suggest there 
would be some useful improvements possible here. I don’t know much about 
sorting algorithms per se. What do you mean by galloping?

--
nosy: +koos.zevenhoven

___
Python tracker 

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



Re: Hi I'm trying to get live data from stock using python , is it possible?

2018-09-04 Thread Michael Torrie
On 09/04/2018 10:21 AM, alon.naj...@gmail.com wrote:
> Hi ,
> for example:
> I want to know if AAPL is more than value 300 and if it does I want it to 
> send to me mail with gmail :) . thanks for the help..
> 

Yes it's definitely possible!  Hop on Google and do some searches;
you're bound to find some articles on the subject, possibly some demo
code, and probably some Python libraries to automate the process.
Google search terms you'll want to try include things like "python stock
price email."
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hi I'm trying to get live data from stock using python , is it possible?

2018-09-04 Thread Skip Montanaro
> I want to know if AAPL is more than value 300 and if it does I want it to 
> send to me mail with gmail :) . thanks for the help..

Try searching pypi.org for "finance", then scroll through the many
returned packages. A few show how to get stock data from Yahoo! or
Google.

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


Re: Hi I'm trying to get live data from stock using python , is it possible?

2018-09-04 Thread Thomas Jollans
On 2018-09-04 18:22, alon.naj...@gmail.com wrote:
> On Tuesday, September 4, 2018 at 7:21:31 PM UTC+3, alon@gmail.com wrote:
>> Hi ,
>> for example:
>> I want to know if AAPL is more than value 300 and if it does I want it to 
>> send to me mail with gmail :) . thanks for the help..

Of course it's possible. The standard library includes facilities
modules for interacting with web services, modules for writing emails,
and everything else you'll need.

> 
> im using python 2.7
> 

Please use Python 3, especially if you're new to Python. Python 2.7 is
woefully out of date.
-- 
https://mail.python.org/mailman/listinfo/python-list


CURSES WINDOWS

2018-09-04 Thread shinobi
Hello All,

can anyone please let me know what's the path to port linux python curses
program to Windows?

Thanks

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


Re: Pass a list of values as options to 3 dropdown menus

2018-09-04 Thread Peter Pearson
On Sun, 2 Sep 2018 13:40:18 -0700 (PDT), Nick Berg wrote:
> how can i be able to store a list of values to drop-down menu and then
> grab the value that the user selects?
>
> **
> name = month = year = ''
>
> # populate names, months, years
> names.add( '' )
> months = ( '==', 'Ιανουάριο ...
> years  = ( '=', 2010, 2011, 2012, 2 ...
>
>
> pdata = pdata + '''
> Επιλεκτική Αναζήτηση: 
>
> 
>  %s 
> 
>
> 
>  %s 
> 
>
> 
>  %s 
> 
>  value="<Αναζήτηση>">
> 
> ''' % ( url_for( 'seek', name=name, month=month, year=year ), name, name, 
> month, month, year, year )
> **

I can't tell whether this is an HTML question or a Python question.
If you can reduce it to a Python question, perhaps I can help.

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


[issue34565] Launcher does not validate major versions

2018-09-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8525

___
Python tracker 

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



[issue34565] Launcher does not validate major versions

2018-09-04 Thread Steve Dower


Steve Dower  added the comment:


New changeset 3876af4f7c2ef87db6d2d83efc229955968926dd by Steve Dower (Brendan 
Gerrity) in branch 'master':
bpo-34565: Change a PC/launcher.c comment to accurately describe valid major 
versions. (GH-9037)
https://github.com/python/cpython/commit/3876af4f7c2ef87db6d2d83efc229955968926dd


--

___
Python tracker 

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



Re: Hi I'm trying to get live data from stock using python , is it possible?

2018-09-04 Thread alon . najman
On Tuesday, September 4, 2018 at 7:21:31 PM UTC+3, alon@gmail.com wrote:
> Hi ,
> for example:
> I want to know if AAPL is more than value 300 and if it does I want it to 
> send to me mail with gmail :) . thanks for the help..

im using python 2.7
-- 
https://mail.python.org/mailman/listinfo/python-list


Hi I'm trying to get live data from stock using python , is it possible?

2018-09-04 Thread alon . najman
Hi ,
for example:
I want to know if AAPL is more than value 300 and if it does I want it to send 
to me mail with gmail :) . thanks for the help..
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34563] invalid assert on big output of multiprocessing.Process

2018-09-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8524

___
Python tracker 

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



[issue34563] invalid assert on big output of multiprocessing.Process

2018-09-04 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 266f4904a222a784080e29aad0916849e507515d by Victor Stinner 
(Alexander Buchkovsky) in branch 'master':
bpo-34563: Fix for invalid assert on big output of multiprocessing.Process 
(GH-9027)
https://github.com/python/cpython/commit/266f4904a222a784080e29aad0916849e507515d


--
nosy: +vstinner

___
Python tracker 

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



[issue34575] Python 3.6 compilation fails on AppVeyor: libeay.lib was created with an older compiler

2018-09-04 Thread Steve Dower


Steve Dower  added the comment:

Works on VSTS build. I suspect AppVeyor is caching files between builds, but 
I'm not familiar enough with the configuration to fix that.

--

___
Python tracker 

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



Re: Cross platform mutex to prevent script running more than instance?

2018-09-04 Thread Thomas Jollans

On 09/04/2018 05:35 AM, Cameron Simpson wrote:

On 03Sep2018 07:45, Malcolm Greene  wrote:

Use case: Want to prevent 2+ instances of a script from running ...
ideally in a cross platform manner. I've been researching this topic and
am surprised how complicated this capability appears to be and how the
diverse the solution set is. I've seen solutions ranging from using
directories, named temporary files,  named sockets/pipes, etc. Is there
any consensus on best practice here?


I like os.mkdir of a known directory name. This tends to be atomic and 
forbidden when the name already exists, on all UNIX platforms, over 
remote filesystems. And, I expect, likewise on Windows.


The trouble with a simple lock file (or directory) is of course that it 
can't recover from the program being killed or from program or system 
crashes without manual intervention. For some use cases that's fine, for 
others it's a problem.




All the other modes like opening files O_EXCL etc tend to be platform 
specific and not reliable over network filesystems.


And pid based approaches don't work cross machine, if that is an issue.


I think a PID file is the traditional approach for *nix daemons, but as 
you say, it does have its own drawbacks.


-- Thomas

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


problem with json.dumps / complexjson.loads in python 3.4 virtualenv

2018-09-04 Thread M. Fioretti

Greetings,

I have an error in a python application that I installed. I already 
opened an issue about it on the application page at github, but I would 
also greatly appreciate any help to (at least) better debug the problem, 
because I urgently need to use that program.


Details:

I need to run the python client for the shaarli bookmarks manager, whose 
home page is https://github.com/shaarli/python-shaarli-client, on a 
Centos release 7.5 x86_64 server. Since that client requires python >= 
3.4, and I do not want to move the whole server to that version, I 
created a virtualenv following the instructions at 
https://github.com/shaarli/python-shaarli-client/blob/master/docs/user/installation.rst


When I try to run it, I get the error messages that I already reported 
in full at


https://github.com/shaarli/python-shaarli-client/issues/33

as far as I can understand after some searching, it **may** be the 
problem described at 
https://mcgrattan.org/2017/01/24/ordered-json-in-python-with-requests/


but I honestly don't know enough python, to go further without some 
help/pointers.


TIA,
Marco


--
http://mfioretti.com
--
https://mail.python.org/mailman/listinfo/python-list


[issue34577] imaplib Cyrillic password

2018-09-04 Thread Nikita Velykanov


Nikita Velykanov  added the comment:

Thank you for fast reply.
Here's full traceback for first case:

Traceback (most recent call last):
  File "some_my_file.py", line 10, in some_function
self.mail.login(login, password)
  File "/usr/lib64/python2.7/imaplib.py", line 518, in login
typ, dat = self._simple_command('LOGIN', user, self._quote(password))
  File "/usr/lib64/python2.7/imaplib.py", line 1083, in _simple_command
return self._command_complete(name, self._command(name, *args))
  File "/usr/lib64/python2.7/imaplib.py", line 870, in _command
self.send('%s%s' % (data, CRLF))
  File "/usr/lib64/python2.7/imaplib.py", line 1191, in send
sent = self.sslobj.write(data)
  File "/usr/lib64/python2.7/ssl.py", line 669, in write
return self._sslobj.write(data)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 30-39: 
ordinal not in range(128)

Full traceback for second case:

Traceback (most recent call last):
  File "some_my_file.py", line 10, in some_function
self.mail.login(login, password)
  File "/usr/lib64/python2.7/imaplib.py", line 518, in login
typ, dat = self._simple_command('LOGIN', user, self._quote(password))
  File "/usr/lib64/python2.7/imaplib.py", line 1083, in _simple_command
return self._command_complete(name, self._command(name, *args))
  File "/usr/lib64/python2.7/imaplib.py", line 852, in _command
data = '%s %s' % (data, self._checkquote(arg))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 1: ordinal 
not in range(128)


But okay, even if encoding depends on target system and it's usually utf-8 so 
why string operations in imaplib are not in usual format but in some other?

--

___
Python tracker 

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



[issue34579] test_embed.InitConfigTests fail on AIX

2018-09-04 Thread Michael Felt


Change by Michael Felt :


--
keywords: +patch
pull_requests: +8523
stage:  -> patch review

___
Python tracker 

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



[issue34580] sqlite doc: clarify the scope of the context manager

2018-09-04 Thread Daniel Jakots


New submission from Daniel Jakots :

In my experience, the first encounter for beginners with the context manager is 
with files. The highlighted feature is that you don't need to close the file, 
'with' is going to do it for you.

The sqlite3 documentation talks about the context manager in "12.6.8.3. Using 
the connection as a context manager". The problem in my opinion is that people 
may believe that the context manager may manage the open/close which is not the 
case, reading the Modules/_sqlite/connection.c:pysqlite_connection_exit shows 
that it only does the commit or the rollback.

I'm not sure about the best fix. It can be either (or both) a sentence in the 
description and/or adding at then end of the code snippet "con.close()" to show 
that it still needs to be done.

Thanks!

--
messages: 324591
nosy: vigdis
priority: normal
severity: normal
status: open
title: sqlite doc: clarify the scope of the context manager
type: enhancement

___
Python tracker 

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



Re: Anaconda with Python 3.7

2018-09-04 Thread gvim

On 03/09/2018 10:49, Thomas Jollans wrote:

On 2018-09-03 11:38, gvim wrote:

Anyone have any idea when Anaconda might ship a version compatible with
Python 3.7. I sent them 2 emails but no reply.

gvim


You can install Python 3.7 in a conda environment right now. Most
packages (certainly all the ones I use) appear to be available for
Python 3.7 at least on Windows and Linux already.



That's not the same as a specific Python 3.7 distribution. Why are they 
so tight-lipped about it? I mean it's been a couple of months now. Do 
they usually take so long?


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


[issue34579] test_embed.InitConfigTests fail on AIX

2018-09-04 Thread Michael Felt


Change by Michael Felt :


--
components: +Tests
versions: +Python 3.8

___
Python tracker 

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



[issue34579] test_embed.InitConfigTests fail on AIX

2018-09-04 Thread Michael Felt


New submission from Michael Felt :

test_init_default_config (test.test_embed.InitConfigTests) ... FAIL
test_init_dev_mode (test.test_embed.InitConfigTests) ... FAIL
test_init_env (test.test_embed.InitConfigTests) ... FAIL
test_init_from_config (test.test_embed.InitConfigTests) ... ok
test_init_global_config (test.test_embed.InitConfigTests) ... FAIL
test_init_isolated (test.test_embed.InitConfigTests) ... FAIL

This seems to be caused because the dump_config() output is not
'(null)' for the keys allocator, program, and pycache_prefix.

When these are 'expected' to be '' (rather than '(null)', all tests pass.

See PR

--
messages: 324590
nosy: Michael.Felt
priority: normal
severity: normal
status: open
title: test_embed.InitConfigTests fail on AIX

___
Python tracker 

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



[issue34578] Pipenv lock : ModuleNotFoundError: No module named '_ctypes'

2018-09-04 Thread Arselon


New submission from Arselon :

I migrated from 3.6.6 to 3.7.
Error during command: pipenv lock (environment was created before successfully):
LOG:
PS C:\Program Files (x86)\Microsoft Visual 
Studio\Shared\Python\repos\DjangoPollsNew> pipenv lock
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
ser\appdata\local\programs\python\python37\lib\site-packages\pipenv\vendor\click\core.py",
 line 8, in 
from .types import convert_type, IntRange, BOOL
  File 
"c:\users\user\appdata\local\programs\python\python37\lib\site-packages\pipenv\vendor\click\types.py",
 line 4, in 
from ._compat import open_stream, text_type, filename_to_ui, \
  File 
"c:\users\user\appdata\local\programs\python\python37\lib\site-packages\pipenv\vendor\click\_compat.py",
 line 536, in 
from ._winconsole import _get_windows_console_stream
  File 
"c:\users\user\appdata\local\programs\python\python37\lib\site-packages\pipenv\vendor\click\_winconsole.py",
 line 16, in 
import ctypes
  File 
"C:\Users\User\AppData\Local\Programs\Python\Python37\Lib\ctypes\__init__.py", 
line 7, in 
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'

What can I do?
I need to create new Pipfile.lock for heroku hosting.
Thanks in advance))

--
components: Library (Lib)
hgrepos: 378
messages: 324589
nosy: Arselon
priority: normal
severity: normal
status: open
title: Pipenv lock : ModuleNotFoundError: No module named '_ctypes'
type: crash
versions: Python 3.7

___
Python tracker 

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



[issue26544] platform.libc_ver() returns incorrect version number

2018-09-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +8522

___
Python tracker 

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



[issue26544] platform.libc_ver() returns incorrect version number

2018-09-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8521

___
Python tracker 

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



[issue26544] platform.libc_ver() returns incorrect version number

2018-09-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 20a8392cec2967f15ae81633c1775645b3ca40da by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-26544: Get rid of dependence from distutils in platform. (GH-8356). 
(GH-8970)
https://github.com/python/cpython/commit/20a8392cec2967f15ae81633c1775645b3ca40da


--

___
Python tracker 

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



[issue34577] imaplib Cyrillic password

2018-09-04 Thread Christian Heimes


Christian Heimes  added the comment:

You have cut off the exception message. Please provide a full traceback 
including the exception name and message.

Password algorithms typically handle only bytes. The encoding depends on your 
target system and is usually utf-8.

--
nosy: +christian.heimes

___
Python tracker 

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



Re: Verifying the integrity/lineage of a file

2018-09-04 Thread Grant Edwards
On 2018-09-01, Peter Pearson  wrote:

> Writing your own crypto software is fraught with peril, and that
> includes using existing libraries.

Writing your own crypto software isn't a problem, and it can be very
educational.

Just don't _use_ your own crypto software.

Howerver, the set of people who write software without intending to
use it is pretty small...

-- 
Grant Edwards   grant.b.edwardsYow! ... the MYSTERIANS are
  at   in here with my CORDUROY
  gmail.comSOAP DISH!!

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


[issue34577] imaplib Cyrillic password

2018-09-04 Thread Nikita Velykanov

New submission from Nikita Velykanov :

Let's consider there is an email box with password which contains Cyrillic 
symbols. When loging in

  imaplib.IMAP4_SSL(host, port).login(login, password)

password field is passed as "кириллица" (type is str, not unicode).
Then, I get this traceback:

  File "/usr/lib64/python2.7/imaplib.py", line 518, in login
typ, dat = self._simple_command('LOGIN', user, self._quote(password))
  File "/usr/lib64/python2.7/imaplib.py", line 1083, in _simple_command
return self._command_complete(name, self._command(name, *args))
  File "/usr/lib64/python2.7/imaplib.py", line 870, in _command
self.send('%s%s' % (data, CRLF))
  File "/usr/lib64/python2.7/imaplib.py", line 1191, in send
sent = self.sslobj.write(data)
  File "/usr/lib64/python2.7/ssl.py", line 669, in write
return self._sslobj.write(data)

This is because self._sslobj.write method requires unicode string.

In other case, if password field is passed as u"кириллица" (type unicode, not 
str), I get another traceback:

  File "/usr/lib64/python2.7/imaplib.py", line 518, in login
typ, dat = self._simple_command('LOGIN', user, self._quote(password))
  File "/usr/lib64/python2.7/imaplib.py", line 1083, in _simple_command
return self._command_complete(name, self._command(name, *args))
  File "/usr/lib64/python2.7/imaplib.py", line 852, in _command
data = '%s %s' % (data, self._checkquote(arg))

It's because '%s' % u"some unicode string" doesn't work.

I guess the problem was described in details.
The problem is that two different libraries are using different string types 
but they must be agreed.

--
components: Library (Lib), Unicode
messages: 324586
nosy: Nikita Velykanov, ezio.melotti, vstinner
priority: normal
severity: normal
status: open
title: imaplib Cyrillic password
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue34546] Add encryption support to zipfile

2018-09-04 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
pull_requests: +8520
stage:  -> patch review

___
Python tracker 

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



[issue34549] unittest docs could use another header

2018-09-04 Thread Nick


Nick  added the comment:

Ah, yes! Was searching for one of those helpful "Permalink to this ___" 
options. Didn't even see the link at the top.

Thank you!

--

___
Python tracker 

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



Re: Any SML coders able to translate this to Python?

2018-09-04 Thread Marko Rauhamaa
Steven D'Aprano :

> I have this snippet of SML code which I'm trying to translate to Python:
>
> fun isqrt n = if n=0 then 0
>  else let val r = isqrt (n/4)
>   in
> if n < (2*r+1)^2 then 2*r
> else 2*r+1
>   end
>
>
> I've tried reading up on SML and can't make heads or tails of the 
> "let...in...end" construct.
>
>
> The best I've come up with is this:
>
> def isqrt(n):
> if n == 0:
> return 0
> else:
> r = isqrt(n/4)
> if n < (2*r+1)**2:
> return 2*r
> else:
> return 2*r+1
>
> but I don't understand the let ... in part so I'm not sure if I'm doing 
> it right.

You must make sure "r" doesn't leak outside its syntactic context so:

def isqrt(n):
if n == 0:
return 0
else:
def f2398478957():
r = isqrt(n//4)
if n < (2*r+1)**2:
return 2*r
else:
return 2*r+1
return f2398478957()

(Also use // instead of /: isqrt = integer square root.)


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


[issue34549] unittest docs could use another header

2018-09-04 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Are you asking for a separate section grouping together all the assert methods 
from different parts which I think is useful. If you are looking for a better 
link then there is a link in the below text at the start of the page 

> If you are already familiar with the basic concepts of testing, you might 
> want to skip to the list of assert methods.

The text "list of assert methods" links to 
https://docs.python.org/3.7/library/unittest.html#assert-methods which I hope 
is what you are looking for.


Thanks

--
nosy: +xtreak

___
Python tracker 

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



Re: Any SML coders able to translate this to Python?

2018-09-04 Thread Paul Moore
On Tue, 4 Sep 2018 at 13:31, Steven D'Aprano
 wrote:
>
> I have this snippet of SML code which I'm trying to translate to Python:
>
> fun isqrt n = if n=0 then 0
>  else let val r = isqrt (n/4)
>   in
> if n < (2*r+1)^2 then 2*r
> else 2*r+1
>   end
>
>
> I've tried reading up on SML and can't make heads or tails of the
> "let...in...end" construct.
>
>
> The best I've come up with is this:
>
> def isqrt(n):
> if n == 0:
> return 0
> else:
> r = isqrt(n/4)
> if n < (2*r+1)**2:
> return 2*r
> else:
> return 2*r+1
>
> but I don't understand the let ... in part so I'm not sure if I'm doing
> it right.

I've not used SML much, but what you have looks right. let ... in is
basically a local binding "let x = 12 in x+2" is saying "the value of
x+2 with x set to 12".

As I'm sure you realise (but I'll add it here for the sake of any
newcomers who read this), the recursive approach is not natural (or
efficient) in Python, whereas it's the natural approach in functional
languages like SML. In Python an iterative solution would be better.

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


[issue34576] SimpleHTTPServer: warn users on security

2018-09-04 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34576] SimpleHTTPServer: warn users on security

2018-09-04 Thread STINNER Victor


STINNER Victor  added the comment:

> The SimpleHTTPServer module has been merged into http.server in Python 3. So 
> we add this to python2 document?

The node should be added to Python 2 and Python 3 documentations.

--

___
Python tracker 

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



[issue26544] platform.libc_ver() returns incorrect version number

2018-09-04 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks for adding tests ;-) It now looks better to me ;-)

--

___
Python tracker 

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



Any SML coders able to translate this to Python?

2018-09-04 Thread Steven D'Aprano
I have this snippet of SML code which I'm trying to translate to Python:

fun isqrt n = if n=0 then 0
 else let val r = isqrt (n/4)
  in
if n < (2*r+1)^2 then 2*r
else 2*r+1
  end


I've tried reading up on SML and can't make heads or tails of the 
"let...in...end" construct.


The best I've come up with is this:

def isqrt(n):
if n == 0:
return 0
else:
r = isqrt(n/4)
if n < (2*r+1)**2:
return 2*r
else:
return 2*r+1

but I don't understand the let ... in part so I'm not sure if I'm doing 
it right.


-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson

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


[issue26544] platform.libc_ver() returns incorrect version number

2018-09-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 7917aadb3edb7616d6164c5eaba24df6ac0a5fc6 by Serhiy Storchaka in 
branch 'master':
bpo-26544: Add test for platform._comparable_version(). (GH-8973)
https://github.com/python/cpython/commit/7917aadb3edb7616d6164c5eaba24df6ac0a5fc6


--

___
Python tracker 

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



Re: Cross platform mutex to prevent script running more than instance?

2018-09-04 Thread CFK
What about using flock()? I don't know if it works on Windows, but it works
really well for Unix/Linux systems.  I typically create a log file in a
known location using any atomic method that doesn't replace/overwrite a
file, and flock() it for the duration of the script.

Thanks,
Cem Karan

On Mon, Sep 3, 2018, 11:39 PM Cameron Simpson  wrote:

> On 03Sep2018 07:45, Malcolm Greene  wrote:
> >Use case: Want to prevent 2+ instances of a script from running ...
> >ideally in a cross platform manner. I've been researching this topic and
> >am surprised how complicated this capability appears to be and how the
> >diverse the solution set is. I've seen solutions ranging from using
> >directories, named temporary files,  named sockets/pipes, etc. Is there
> >any consensus on best practice here?
>
> I like os.mkdir of a known directory name. This tends to be atomic and
> forbidden when the name already exists, on all UNIX platforms, over remote
> filesystems. And, I expect, likewise on Windows.
>
> All the other modes like opening files O_EXCL etc tend to be platform
> specific
> and not reliable over network filesystems.
>
> And pid based approaches don't work cross machine, if that is an issue.
>
> Cheers,
> Cameron Simpson 
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue16438] Numeric operator predecence confusing

2018-09-04 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue8110] subprocess.py doesn't correctly detect Windows machines

2018-09-04 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue1621] Do not assume signed integer overflow behavior

2018-09-04 Thread Sergey Fedoseev


Change by Sergey Fedoseev :


--
pull_requests: +8519

___
Python tracker 

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



[issue34573] Simplify __reduce__() of set and dict iterators.

2018-09-04 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Interesting, I'll have a look when I'm back from vacation.

On Tue, 4 Sep 2018, 07:04 Raymond Hettinger,  wrote:

>
> Raymond Hettinger  added the comment:
>
> Also take a look at the other places that have similar logic.  I believe
> these all went in at the same time. See commit
> 31668b8f7a3efc7b17511bb08525b28e8ff5f23a
>
> --
> nosy: +kristjan.jonsson, rhettinger
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue34576] SimpleHTTPServer: warn users on security

2018-09-04 Thread Windson Yang


Windson Yang  added the comment:

The SimpleHTTPServer module has been merged into http.server in Python 3. So we 
add this to python2 document?

--
nosy: +Windson Yang

___
Python tracker 

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



[issue34530] distutils: find_executable() fails if the PATH environment variable is not set

2018-09-04 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7056ca880bf4ff428dfb2c4eee67919dc43ecd34 by Victor Stinner in 
branch '2.7':
bpo-34530: Fix distutils find_executable() (GH-9049) (GH-9058)
https://github.com/python/cpython/commit/7056ca880bf4ff428dfb2c4eee67919dc43ecd34


--

___
Python tracker 

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



[issue34576] SimpleHTTPServer: warn users on security

2018-09-04 Thread STINNER Victor


New submission from STINNER Victor :

Larry Hastings proposed on the PSRT mailing list to add the following note of 
the SimpleHTTPServer documentation:

Note: SimpleHTTPServer is, as its name implies, a simple HTTP
server.  We provide it as a sample implementation of the Python HTTP
server API.  However, SimpleHTTPServer is neither secure nor
high-performance, and as such you should not use SimpleHTTPServer in
security-sensitive or performance-sensitive applications.

For example, if you create a symbolic link outside the directory served by 
SimpleHTTPServer, SimpleHTTPServer follows symbolic links.

--
components: Library (Lib)
messages: 324577
nosy: vstinner
priority: normal
severity: normal
status: open
title: SimpleHTTPServer: warn users on security
type: security
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue34246] Gentoo Refleaks 3.7: test_smtplib has dangling threads

2018-09-04 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue34575] Python 3.6 compilation fails on AppVeyor: libeay.lib was created with an older compiler

2018-09-04 Thread STINNER Victor


New submission from STINNER Victor :

Example on my PR:
https://github.com/python/cpython/pull/9057

https://ci.appveyor.com/project/python/cpython/build/3.6build21480/job/lge7r4qknx0t0tlv

LINK : fatal error C1047: The object or library file 
'C:\projects\cpython\PCBuild\win32\libeay.lib' was created with an older 
compiler than other objects; rebuild old objects and libraries 
[C:\projects\cpython\PCbuild\_hashlib.vcxproj]
LINK : fatal error LNK1257: code generation failed 
[C:\projects\cpython\PCbuild\_hashlib.vcxproj]
LINK : fatal error C1047: The object or library file 
'C:\projects\cpython\PCBuild\win32\libeay.lib' was created with an older 
compiler than other objects; rebuild old objects and libraries 
[C:\projects\cpython\PCbuild\_ssl.vcxproj]
LINK : fatal error LNK1257: code generation failed 
[C:\projects\cpython\PCbuild\_ssl.vcxproj]
Command exited with code 1

--
components: Build, Windows
messages: 324576
nosy: paul.moore, steve.dower, tim.golden, vstinner, zach.ware
priority: normal
severity: normal
status: open
title: Python 3.6 compilation fails on AppVeyor: libeay.lib was created with an 
older compiler
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



[issue34530] distutils: find_executable() fails if the PATH environment variable is not set

2018-09-04 Thread miss-islington


miss-islington  added the comment:


New changeset 7aa3eadca2a50ce651ce603d6100b05bb7106f1c by Miss Islington (bot) 
in branch '3.7':
bpo-34530: Fix distutils find_executable() (GH-9049)
https://github.com/python/cpython/commit/7aa3eadca2a50ce651ce603d6100b05bb7106f1c


--
nosy: +miss-islington

___
Python tracker 

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



[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-09-04 Thread STINNER Victor


STINNER Victor  added the comment:

> Which bug? It's only a failing test.

Linux vendors run the full test suite. If the test suite fails, the build of 
the package fails as well. It's annoying.

--

___
Python tracker 

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



[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-09-04 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

I don't want to spend hours arguing.  This issue is sufficiently rare and 
unlikely in normal conditions that I don't think we should risk regressions by 
trying to fix it.

--

___
Python tracker 

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



[issue34530] distutils: find_executable() fails if the PATH environment variable is not set

2018-09-04 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8518

___
Python tracker 

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



[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-09-04 Thread STINNER Victor


STINNER Victor  added the comment:

By the way, "no user-visible bug is fixed here": I agree that it's not easy to 
trigger manually the bug (when pressing CTRL+C), but I don't see why an user 
couldn't hit this bug. The race condition is now obvious to me.

--

___
Python tracker 

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



[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-09-04 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le 04/09/2018 à 11:16, STINNER Victor a écrit :
> 
>> They work fine otherwise.
> 
> The race condition impacts everyone. It's just less likely if your computer 
> is fast enough. The bug is much more likely if you "force" the bad path:

Which bug? It's only a failing test.

--

___
Python tracker 

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



[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-09-04 Thread STINNER Victor


STINNER Victor  added the comment:

> Please only skip those tests on buildbots.

There is no easy wait to only skip a test on buildbots.

> They work fine otherwise.

The race condition impacts everyone. It's just less likely if your computer is 
fast enough. The bug is much more likely if you "force" the bad path:

diff --git a/Lib/multiprocessing/semaphore_tracker.py 
b/Lib/multiprocessing/semaphore_tracker.py
index 3b50a46ddc..7261b43725 100644
--- a/Lib/multiprocessing/semaphore_tracker.py
+++ b/Lib/multiprocessing/semaphore_tracker.py
@@ -107,6 +107,8 @@ getfd = _semaphore_tracker.getfd
 def main(fd):
 '''Run semaphore tracker.'''
 # protect the process from ^C and "killall python" etc
+import time
+time.sleep(0.5)
 signal.signal(signal.SIGINT, signal.SIG_IGN)
 signal.signal(signal.SIGTERM, signal.SIG_IGN)
 
diff --git a/Lib/test/_test_multiprocessing.py 
b/Lib/test/_test_multiprocessing.py
index 5c625dd495..6f9f7583e2 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -4193,7 +4193,6 @@ class TestSemaphoreTracker(unittest.TestCase):
 _multiprocessing.sem_unlink(name1)
 p.terminate()
 p.wait()
-time.sleep(2.0)
 with self.assertRaises(OSError) as ctx:
 _multiprocessing.sem_unlink(name2)
 # docs say it should be ENOENT, but OSX seems to give EINVAL

--

___
Python tracker 

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



[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-09-04 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Please only skip those tests on buildbots. They work fine otherwise.

--

___
Python tracker 

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



[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-09-04 Thread STINNER Victor


STINNER Victor  added the comment:

> If buildbots hurt, I suggest skipping the tests on the buildbots.

Let's do that. Pablo: do you want to write a PR to always skip 
TestSemaphoreTracker with a reference to this issue? Example: skipIf(True, 
"bpo-33613: the test has a race condition").

--

___
Python tracker 

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



[issue34530] distutils: find_executable() fails if the PATH environment variable is not set

2018-09-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8517

___
Python tracker 

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



[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-09-04 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

As I wrote on Github: no user-visible bug is fixed here, and we shouldn't risk 
introducing regressions by backporting those changes.

If buildbots hurt, I suggest skipping the tests on the buildbots.

--
versions:  -Python 3.6, Python 3.7

___
Python tracker 

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



[issue34530] distutils: find_executable() fails if the PATH environment variable is not set

2018-09-04 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 39487196c87e28128ea907a0d9b8a88ba53f68d5 by Victor Stinner in 
branch 'master':
bpo-34530: Fix distutils find_executable() (GH-9049)
https://github.com/python/cpython/commit/39487196c87e28128ea907a0d9b8a88ba53f68d5


--

___
Python tracker 

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



[issue34530] distutils: find_executable() fails if the PATH environment variable is not set

2018-09-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8516

___
Python tracker 

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



[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-09-04 Thread STINNER Victor


STINNER Victor  added the comment:

IMHO the fix should be backported to Python 3.6 and 3.7.

It cannot be backported to 2.7 since 2.7 doesn't have signal.pthread_sigmask().

--
versions: +Python 3.6, Python 3.7

___
Python tracker 

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



[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-09-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8515

___
Python tracker 

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



[issue33613] test_multiprocessing_fork: test_semaphore_tracker_sigint() fails with -W error

2018-09-04 Thread Antoine Pitrou


Antoine Pitrou  added the comment:


New changeset ec74d187f50a8a48f94eb37023300583fbd644cc by Antoine Pitrou (Pablo 
Galindo) in branch 'master':
bpo-33613, test_semaphore_tracker_sigint: fix race condition (#7850)
https://github.com/python/cpython/commit/ec74d187f50a8a48f94eb37023300583fbd644cc


--

___
Python tracker 

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



[issue34570] Segmentation fault in _PyType_Lookup

2018-09-04 Thread STINNER Victor


STINNER Victor  added the comment:

You can install and enable faulthandler to get the Python traceback where the 
bug occurs. It is likely that the bug comes from a third party C extension.

What are the C extensions used by pybot?

--
nosy: +vstinner

___
Python tracker 

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



[issue34570] Segmentation fault in _PyType_Lookup

2018-09-04 Thread Pablosky


Pablosky  added the comment:

My system is Hp Z4 with 128GB ram. It is not rather problem of lack of memory. 
When I monitored free memory it took at most 30GB when these 20 pybots were 
working.

I wonder if it is possible that these separate programs (pybots) interfere each 
other. I mean that sharing the same modules/libraries cause that situations. 
Maybe one instance is recompiling py module to pyc at the same time when this 
is used by another process. Is it possible?

I have never caught segfault when there was only one instance of pybot.

BTW I caught 3 more different cores. I consider reinstalling my whole system 
(maybe Ubuntu 18.04). Maybe my system is broken.

--

___
Python tracker 

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



[issue16438] Numeric operator predecence confusing

2018-09-04 Thread ron


ron  added the comment:

Any progress on this?

--
nosy: +ronron

___
Python tracker 

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



[issue34569] test__xxsubinterpreters.ShareableTypeTests._assert_values fails on AIX - 32-bit mode

2018-09-04 Thread Michael Felt


Change by Michael Felt :


--
components: +Tests

___
Python tracker 

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



[issue34569] test__xxsubinterpreters.ShareableTypeTests._assert_values fails on AIX - 32-bit mode

2018-09-04 Thread Michael Felt


Michael Felt  added the comment:

64-bit mode, no error.

root@x066:[/data/prj/python/python3-3.8.0]./python -m test -v 
test__xxsubinterpreters
== CPython 3.8.0a0 (heads/master-dirty:d500e5307a, Sep 3 2018, 13:55:44) [C]
== AIX-1-00C291F54C00-powerpc-64bit-COFF big-endian
== cwd: /data/prj/python/python3-3.8.0/build/test_python_16908532
== CPU count: 8
== encodings: locale=ISO8859-1, FS=iso8859-1
Run tests sequentially
0:00:00 [1/1] test__xxsubinterpreters
test_bad_id (test.test__xxsubinterpreters.ChannelIDTests) ... ok
...
test_int (test.test__xxsubinterpreters.ShareableTypeTests) ... ok
test_singletons (test.test__xxsubinterpreters.ShareableTypeTests) ... ok
test_types (test.test__xxsubinterpreters.ShareableTypeTests) ... ok

--
Ran 111 tests in 4.572s

OK (skipped=5)

== Tests result: SUCCESS ==

--
versions: +Python 3.8

___
Python tracker 

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



[issue34461] Availability of parsers in etree initializer

2018-09-04 Thread nilanjan roy


nilanjan roy  added the comment:

@serhiy.storchaka: 

If I concur with your comment then probably declaration of *__all__** over xml 
initializer(__init__) is little contradictory - because whenever we declare 
__all__ to enable global-scope means API provides the flexibility to use * 
during package import. Now this is totally depends on developer how the script 
need to optimize/simulate during development. Yes agree * should not be used 
due to high reference of memory usage. But as far __init__.py of xml and python 
convention this should not be explicitly restricted

--

___
Python tracker 

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



[issue34516] httplib sets unbefitting "Host" in request header when requests an ipv6 format url.

2018-09-04 Thread chen wu


chen wu  added the comment:

to fix this, we change the code of our urilib3. before passing params to 
httplib, we set Host in headers if it's ipv6 address.

Thanks so much.

--
resolution: duplicate -> not a bug
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue24698] get_externals.bat script fails

2018-09-04 Thread Zachary Ware


Zachary Ware  added the comment:

Closing as "out of date"; we no longer use svn to fetch external sources.

--
resolution:  -> out of date
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



[issue24401] Windows 8.1 install gives DLL required to complete could not run

2018-09-04 Thread Zachary Ware


Change by Zachary Ware :


--
resolution:  -> out of date
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