[issue26027] Support Path objects in the posix module

2016-06-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'll take a look.

--

___
Python tracker 

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



Re: Operator Precedence/Boolean Logic

2016-06-24 Thread Lawrence D’Oliveiro
On Thursday, June 23, 2016 at 9:57:35 PM UTC+12, Marko Rauhamaa wrote:
> Lawrence D’Oliveiro:
> 
>> On Thursday, June 23, 2016 at 9:11:05 PM UTC+12, Marko Rauhamaa wrote:
>>> The __len__ method is not guaranteed to execute in O(1).
>>
>> So what is?
> 
> The __bool__ method is the appropriate place to implement an efficient
> emptiness check. It might not be O(1) but it will be the most efficient
> way to check for emptiness, or the class is badly implemented.

Saying “or the class is badly implemented” sounds like circular reasoning...
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue27364] Deprecate invalid unicode escape sequences

2016-06-24 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +gvanrossum

___
Python tracker 

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



Re: how to python to use virtual memory?

2016-06-24 Thread Michael Torrie
On 06/24/2016 08:44 PM, Dennis Lee Bieber wrote:
>   I don't know how Linux handles swap disk -- Windows normally sets the
> swap space to ~2X physical memory (for small RAM -- my 12GB system has a
> 12GB swap and suggests 18GB).

Linux typically uses a user-set swap partition.  The old rule of thumb
was to make the swap partition 2x the size of RAM. Now, though, for most
installations with lots of RAM, 1:1 is often used.

However, if the OP's program really requires 70 to 100 GB of space,
relying on the virtual memory system to do this (64-bit only of course)
is a mistake.  The system will simply thrash itself to death on any OS
at that level of over-commit.  If he has that much data, he needs to
employ techniques for working with the data directly on disk himself.  I
highly doubt these big data sets that large companies work rely simply
on the OS to manage it!

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


[issue27377] Add smarter socket.fromfd()

2016-06-24 Thread Martin Panter

Martin Panter added the comment:

Okay, I guess the fdtype() API could be useful if we don’t alter fromfd(), i.e. 
as a workaround for Issue 18391.

IMO the specific SO_* constants should at least be listed in the documentation, 
so users know which versions of Python have which constants. Although exposing 
them is not necessary for the fromfd() implementation.

See also more comments on the code review.

--

___
Python tracker 

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



[issue27385] itertools.groupby has misleading doc string

2016-06-24 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The patch is fine.

--
assignee: docs@python -> rhettinger
priority: normal -> low

___
Python tracker 

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



[issue26907] Add missing getsockopt constants

2016-06-24 Thread Martin Panter

Martin Panter added the comment:

SO_PASSCRED was added to Python 3.3 as part of Issue 6560; it is just missing 
documentation.

--
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: Which one is the best XML-parser?

2016-06-24 Thread Ned Batchelder
On Friday, June 24, 2016 at 8:44:49 PM UTC-4, Sayth Renshaw wrote:
> On Friday, 24 June 2016 07:03:18 UTC+10, David Shi  wrote:
> > Which one is the best XML-parser?
> > Can any one tell me?
> > Regards.
> > David
> 
> Most use lxml http://lxml.de/index.html
> 
> Sayth

Sayth, is everything OK? Why are you posting multiple messages?

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


Re: Which one is the best XML-parser?

2016-06-24 Thread lorenzo . gatti
On Thursday, June 23, 2016 at 11:03:18 PM UTC+2, David Shi wrote:
> Which one is the best XML-parser?
> Can any one tell me?
> Regards.
> David

Lxml offers lxml.etree.iterparse 
(http://lxml.de/tutorial.html#event-driven-parsing), an important combination 
of the memory savings of incremental parsing and the convenience of visiting a 
DOM tree without dealing with irrelevant details. 
An iterable incrementally produces DOM element objects, which can be deleted 
after processing them and before proceeding to parse the rest of the document. 
This technique allows easy processing of huge documents containing many 
medium-size units of work whose DOM trees fit into memory easily. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Which one is the best XML-parser?

2016-06-24 Thread Sayth Renshaw
On Friday, 24 June 2016 07:03:18 UTC+10, David Shi  wrote:
> Which one is the best XML-parser?
> Can any one tell me?
> Regards.
> David

Most use lxml http://lxml.de/index.html

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


Re: Which one is the best XML-parser?

2016-06-24 Thread Sayth Renshaw
On Friday, 24 June 2016 07:03:18 UTC+10, David Shi  wrote:
> Which one is the best XML-parser?
> Can any one tell me?
> Regards.
> David

xml parser most use lxml http://lxml.de/index.html

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


LXML cannot access elements of dict created

2016-06-24 Thread Sayth Renshaw
I have created several varitions of my parser however I am still having the 
same issue, ,my return is the whole file, not a key of the dict as i have 
attempted to access.

Not really sure where I am going wrong with it.

I have left previous implementations in however to show where I have come from, 
as a first test case i am trying to parse the file and then return the dict key 
numbers and all its values.

def parseXML():
"""
given a file XML will parse for listed attributes.

using objectified lxml
"""
for file in getsMeet(file_list):
with open(file, "rb") as f:
xml = f.read()
root = objectify.parse(xml)
atts = ("number", "id", "horse", "saddlecloth", "barrier",
"weight", "rating", "description", "colours", "owners",
"dob", "age", "sex", "career", "thistrack", "thisdistance",
"goodtrack", "heavytrack", "finished", "weightvariation",
"variedweight", "decimalmargin", "penalty",
"pricestarting")

tree = etree.parse(StringIO(xml))
result = etree.tostring(tree.getroot(), pretty_print=True)
for sample in result:
noms = (dict(zip(atts, map(sample.attrib.get, atts
print(noms)
# print(etree.tostring(tree.getroot()))
#
# for sample in root.xpath('//race/nomination'):
# noms = (dict(zip(atts, map(sample.attrib.get, atts
# numbers = [(k, v) for k, v in noms.items()]
# print(noms)
# return numbers

# parser = etree.XMLParser(root, remove_comments=True)
# d = defaultdict(list)
# for sample in parser.xpath('//race/nomination'):
# print(sample)
# for sample in root.xpath('//race/nomination'):
# # print(sample)
# dct = sample.attrib
# for k in atts:
# # print(k)
# d[k].append(dct[k])

# print(d["number"])
return noms


a = parseXML()
for sample in a.items:
print(sample["number"])

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


lxml parsing whole file, unable to access elements

2016-06-24 Thread Sayth Renshaw
Hi

I have created several versions of a parser for XML with lxml both objectify 
and lxml. They all work in that the parser returns the whole file however I 
cannot access elements or keys as I have tried to create a dict of the results 
to make it easier to put in an sql query later.

However I keep receiving output as just the whole file, I have gone backwards 
since last time, learnt more however output is backwards.

Is there something obvious here I am doing wrong, all I am intending to do as a 
first test is to get the result and then get the key "number" and return that 
key and all its values.

i have left the commented versions in as well they all end in the same result 
to me.

def parseXML():
"""
given a file XML will parse for listed attributes.

using objectified lxml
"""
for file in getsMeet(file_list):
with open(file, "rb") as f:
xml = f.read()
root = objectify.parse(xml)
atts = ("number", "id", "horse", "saddlecloth", "barrier",
"weight", "rating", "description", "colours", "owners",
"dob", "age", "sex", "career", "thistrack", "thisdistance",
"goodtrack", "heavytrack", "finished", "weightvariation",
"variedweight", "decimalmargin", "penalty",
"pricestarting")

tree = etree.parse(StringIO(xml))
result = etree.tostring(tree.getroot(), pretty_print=True)
for sample in result:
noms = (dict(zip(atts, map(sample.attrib.get, atts
print(noms)
# print(etree.tostring(tree.getroot()))
#
# for sample in root.xpath('//race/nomination'):
# noms = (dict(zip(atts, map(sample.attrib.get, atts
# numbers = [(k, v) for k, v in noms.items()]
# print(noms)
# return numbers

# parser = etree.XMLParser(root, remove_comments=True)
# d = defaultdict(list)
# for sample in parser.xpath('//race/nomination'):
# print(sample)
# for sample in root.xpath('//race/nomination'):
# # print(sample)
# dct = sample.attrib
# for k in atts:
# # print(k)
# d[k].append(dct[k])

# print(d["number"])
return noms


a = parseXML()
for sample in a.items:
print(sample["number"])

confused

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


how to python to use virtual memory?

2016-06-24 Thread meInvent bbird
after set resource hard and soft both out of real memory 70GB to 100GB

and expecting the extra memory setting using virtual memory which is hard disk,

the program still wrongly be killed itself after running in background side

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


Re: Which one is the best XML-parser?

2016-06-24 Thread Sayth Renshaw
On Friday, 24 June 2016 07:03:18 UTC+10, David Shi  wrote:
> Which one is the best XML-parser?
> Can any one tell me?
> Regards.
> David

Most would use lxml

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


Re: Which one is the best XML-parser?

2016-06-24 Thread Sayth Renshaw
On Friday, 24 June 2016 07:03:18 UTC+10, David Shi  wrote:
> Which one is the best XML-parser?
> Can any one tell me?
> Regards.
> David

Most use lxml

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


Re: PyQt5: is the wrapper incomplete?

2016-06-24 Thread jladasky
On Thursday, June 16, 2016 at 12:16:21 AM UTC-7, Vincent Vande Vyvre wrote:

> On Debian, this is a separate package python3-pyqt5.qtserialport, I 
> don't know for other Linux
> 
> After install you can use:
> 
> from PyQt5.QtSeriaPort import QSerialPort

Thank you Vincent, that is exactly what I needed!

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


program return killed after run a very long time

2016-06-24 Thread meInvent bbird
i suspect it use so much memory,

however i have already assign 30GB memory in openstack cloud

is there any command to allow python to use more memory?

currently

program return killed after run a very long time
-- 
https://mail.python.org/mailman/listinfo/python-list


I seem to be creating a dict that I cannot access the keys of

2016-06-24 Thread Sayth Renshaw
Really getting a little lost here with lxml.

I cannot seem to create a dict of results using xpath or other that I could 
easily get the results from, currently I am always returned a printed copy of 
the whole file regardless of what parsing options I do.

Can I ask is there something obvious wrong, i have left the commented other 
versions in they "work" in that they all produce the same output the print 
whole file.


def parseXML():
"""
given a file XML will parse for listed attributes.

using objectified lxml
"""
for file in getsMeet(file_list):
with open(file, "rb") as f:
xml = f.read()
root = objectify.parse(xml)
atts = ("number", "id", "horse", "saddlecloth", "barrier",
"weight", "rating", "description", "colours", "owners",
"dob", "age", "sex", "career", "thistrack", "thisdistance",
"goodtrack", "heavytrack", "finished", "weightvariation",
"variedweight", "decimalmargin", "penalty",
"pricestarting")

tree = etree.parse(StringIO(xml))
result = etree.tostring(tree.getroot(), pretty_print=True)
for sample in result:
noms = (dict(zip(atts, map(sample.attrib.get, atts
print(noms)
# print(etree.tostring(tree.getroot()))
#
# for sample in root.xpath('//race/nomination'):
# noms = (dict(zip(atts, map(sample.attrib.get, atts
# numbers = [(k, v) for k, v in noms.items()]
# print(noms)
# return numbers

# parser = etree.XMLParser(root, remove_comments=True)
# d = defaultdict(list)
# for sample in parser.xpath('//race/nomination'):
# print(sample)
# for sample in root.xpath('//race/nomination'):
# # print(sample)
# dct = sample.attrib
# for k in atts:
# # print(k)
# d[k].append(dct[k])

# print(d["number"])
return noms


a = parseXML()
for sample in a.items:
print(sample["number"])

Confused

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


Re: PyQt5: is the wrapper incomplete?

2016-06-24 Thread jladasky
On Thursday, June 16, 2016 at 12:16:21 AM UTC-7, Vincent Vande Vyvre wrote:

> On Debian, this is a separate package python3-pyqt5.qtserialport


Many thanks, Vincent, that was exactly what I needed!

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


plotting of live data-python

2016-06-24 Thread rayprabhakarray
Hi All,

I'm plotting a continuous analog reading using python's drawnow package. I want 
to implement a data cursor which follows the graph and shows me the coordinates 
without me clicking or hovering over the specific point.

Basically since the plot is moving, it getting difficult to see the coordinates 
of any specific point.

Can anyone help me with this kind of problem.

Regards,
Prabhakar
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: not able to install mysqldb-python

2016-06-24 Thread Arshpreet Singh
On Thursday, 23 June 2016 23:18:27 UTC+5:30, Joaquin Alzola  wrote:
> >ImportError: No module named 'ConfigParser'
>  It is telling you the error
> This email is confidential and may be subject to privilege. If you are not 
> the intended recipient, please do not copy or disclose its content but 
> contact the sender immediately upon receipt.

Thanks but somehow it fixed itself. :P now able to install mysql-python without 
any problem.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26867] test_ssl test_options fails on ubuntu 16.04

2016-06-24 Thread Martin Panter

Martin Panter added the comment:

FWIW I had a quick look at ways to detect if you are running on Ubuntu. But 
platform.linux_distribution() seems to be deprecated and looks like it might 
have trouble differentiating Debian and Ubuntu. So it may be easier to just go 
with the current patch on all platforms, at least for the moment.

Maybe if someone that uses Ubuntu could suggest a specific file or config the 
test can check for.

--

___
Python tracker 

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



Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

2016-06-24 Thread Sayth Renshaw
On Tuesday, 21 June 2016 21:03:28 UTC+10, Pushpanth Gundepalli  wrote:
> Guys, can you please share me some sites where we can practice python 
> programs for beginners and Intermediate.

Here are some good beginner projects 
https://knightlab.northwestern.edu/2014/06/05/five-mini-programming-projects-for-the-python-beginner/

Also a community on reddit and github are trying to acheive this.

https://learnprogramming.github.io/

https://github.com/LearnProgramming

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


My Generator yields a dictionary. Return entire file not specified key, value

2016-06-24 Thread Sayth Renshaw
When I am running my file which takes a file off the command line reads it and 
creates an objecitifed xml instance and then parses for each attribute into a 
dictionary and then yields it.

At this point I am tring to use it to obtain specific key value elements, 
however I keep being returned the whole file output rather than the selection 
key.really not sure where I am going wrong.

The key part of my file that is using the generator is

for item in parseXML():
number = item["number"]
print(number)

Rest of file for reference


from lxml import objectify
import argparse
import os

parser = argparse.ArgumentParser()
parser.add_argument("path", type=str, nargs="+")
parser.add_argument('-e',
'--extension',
default='',
help='File extension to filter by.')

args = parser.parse_args()
name_pattern = "*" + args.extension
my_dir = args.path[0]

for dir_path, subdir_list, file_list in os.walk(my_dir):
for name_pattern in file_list:
full_path = os.path.join(dir_path, name_pattern)


def getsMeet(file_list):
"""generator which yields sorted file."""
for filename in sorted(file_list):
filename = my_dir + filename
yield filename


def parseXML():
"""
given a file XML will parse for listed attributes.

using objectified lxml
"""
for file in getsMeet(file_list):
with open(file, "rb") as f:
xml = f.read()

root = objectify.parse(xml)
atts = ("number", "id", "horse", "saddlecloth", "barrier",
"weight", "rating", "description", "colours", "owners",
"dob", "age", "sex", "career", "thistrack", "thisdistance",
"goodtrack", "heavytrack", "finished", "weightvariation",
"variedweight", "decimalmargin", "penalty",
"pricestarting")

for sample in root.xpath('//race/nomination'):
noms = (dict(zip(atts, map(sample.attrib.get, atts
yield noms


for item in parseXML():
number = item["number"]
print(number)



Thanks

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


Which one is the best XML-parser?

2016-06-24 Thread Sayth Renshaw
Lxml 
-- 
https://mail.python.org/mailman/listinfo/python-list


Live analog plotting - python

2016-06-24 Thread Prabhakar Ray
Hi Guys,

I'm reading a continuous analog value using python and plotting it using 
drawnow(). Since the plot is moving it's getting difficult to note down the 
coordinates of any specific point. I intend to implement a moving data cursor 
which can follow the graph and can give me real time coordinates of the point 
without the need of clicking or hovering over a point.

can anyone help me with this ?

Regards,
Prabhakar
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue27385] itertools.groupby has misleading doc string

2016-06-24 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +rhettinger
stage:  -> patch review
versions:  -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue27351] Unexpected ConfigParser.read() behavior when passed fileobject

2016-06-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Doing what the doc says is not a bug. The doc being obsolete in saying 'list' 
(which was once true) instead of the now correct 'iterable' is. The 3.6 
ConfigParser.__doc___ also says 'list', so both docstrings and docs for all 
current versions should be fixed.

--
components: +Documentation
nosy: +terry.reedy
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



[issue27038] Make os.DirEntry exist

2016-06-24 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for the patch, Jelle!

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

___
Python tracker 

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



[issue27038] Make os.DirEntry exist

2016-06-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b841972ed0bd by Brett Cannon in branch 'default':
Issue #27038: Expose DirEntry as os.DirEntry.
https://hg.python.org/cpython/rev/b841972ed0bd

--
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: Question on compiling on linux

2016-06-24 Thread Joaquin Alzola

>That gives me many .so files but no python*.so* file :(
Install the python-devel.
This email is confidential and may be subject to privilege. If you are not the 
intended recipient, please do not copy or disclose its content but contact the 
sender immediately upon receipt.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26027] Support Path objects in the posix module

2016-06-24 Thread Brett Cannon

Brett Cannon added the comment:

Did you still want to handle this, Serhiy, or should I assign the issue to 
myself?

--

___
Python tracker 

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



[issue27385] itertools.groupby has misleading doc string

2016-06-24 Thread Grant Mathews

New submission from Grant Mathews:

The itertools.groupby function is generally well-documented, but the fact that 
it only groups consecutive occurrences of keys is not mentioned in the doc 
string, which is where that information is most needed.

--
assignee: docs@python
components: Documentation
files: groupby_doc.patch
keywords: patch
messages: 269211
nosy: docs@python, gmathews
priority: normal
severity: normal
status: open
title: itertools.groupby has misleading doc string
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file43531/groupby_doc.patch

___
Python tracker 

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



[issue27182] PEP 519 support in the stdlib

2016-06-24 Thread Brett Cannon

Changes by Brett Cannon :


--
dependencies:  -Add a "What's New" entry for PEP 519

___
Python tracker 

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



Re: Seen bug in argparse module

2016-06-24 Thread Peter Otten
Jagdish Choudhary wrote:

> When argument provided from user which doesn't match to right option which
> is mentioned in help , it runs without issue..let me provide an example
> 
> https://docs.python.org/3.3/library/argparse.html
> 
> import argparse
> parser = argparse.ArgumentParser(description='Process some
> integers.')parser.add_argument('integers', metavar='N', type=int,
> nargs='+',
>help='an integer for the
> accumulator')parser.add_argument('--sum', dest='accumulate',
> action='store_const',
>const=sum, default=max,
>help='sum the integers (default: find the max)')
> args = parser.parse_args()print(args.accumulate(args.integers))
> 
> python prog.py -h
> usage: prog.py [-h] [--sum] N [N ...]
> 
> Process some integers.
> 
> positional arguments:
>  N   an integer for the accumulator
> 
> optional arguments:
>  -h, --help  show this help message and exit
>  --sum   sum the integers (default: find the max)
> 
> If user run it like below-
> 
> JAGDISHs-MacBook-Pro:test_python jagdish$ python prog.py 12 3 4 --sum
> 19
> JAGDISHs-MacBook-Pro:test_python jagdish$ python prog.py 12 3 4 --su
> 19
> JAGDISHs-MacBook-Pro:test_python jag

This works as designed:

https://docs.python.org/3.3/library/argparse.html#prefix-matching

Starting with Python 3.5 you can disable this behaviour with 
allow_abbrev=False, see

https://docs.python.org/3.6/library/argparse.html#allow-abbrev

If you think this should have been the default -- I agree.

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


[issue22928] HTTP header injection in urrlib2/urllib/httplib/http.client

2016-06-24 Thread Vlad K.

Vlad K. added the comment:

Doesn't this affect Python 3.3 as well, which is in security-only mode? 
Shouldn't that version be patched as well?

--
nosy: +vladk

___
Python tracker 

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



Re: Question on compiling on linux

2016-06-24 Thread Zachary Ware
On Fri, Jun 24, 2016 at 2:28 PM, Steven Truppe  wrote:
> That gives me many .so files but no python*.so* file :(

Where are you finding these many .so files?  There should be
libpython3.5m.so in the root of the source tree (alongside `python`).

By the way, I'm not sure how you're accessing the list/newsgroup, but
your quoting seems to be messed up somehow -- my message, which I'm
assuming the above was in reply to, was nowhere to be found in your
message.  Also, as a minor matter of netiquette, we prefer new content
to follow a quote of what the new message is in reply to, as I've done
in this message.

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


[issue27186] add os.fspath()

2016-06-24 Thread Ethan Furman

Ethan Furman added the comment:

Brett, no worries.  My time has been extremely limited.

I'll get the other locations in the stdlib fixed sometime in the next two 
months if no one beats me to it.

--

___
Python tracker 

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



[issue27186] add os.fspath()

2016-06-24 Thread Brett Cannon

Brett Cannon added the comment:

I think with the glossary change, this issue is done! Thanks everyone for the 
help with getting this far!

Now on to os.path...

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

___
Python tracker 

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



Re: Question on compiling on linux

2016-06-24 Thread Steven Truppe

That gives me many .so files but no python*.so* file :(

Am 2016-06-24 um 20:35 schrieb Steven Truppe:
So back to my first question now that you saw everything worked fine, 
but there is no python.so file, did i miss something when using 
./configure ?



Am 2016-06-24 um 20:23 schrieb Chris Angelico:
On Sat, Jun 25, 2016 at 4:19 AM, Steven Truppe 
 wrote:
But that's not a library file, it's the interpreter, i need the 
library to

extend and embend python into my own application ...

Bouncing back to the list (please keep it there).

The reason I mentioned ./python is that, if it isn't there, something
failed with the build. It's an easy way of checking that everything
worked.

ChrisA




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


[issue27186] add os.fspath()

2016-06-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9c57178f13dc by Brett Cannon in branch 'default':
Issue #27186: Define what a "path-like object" is.
https://hg.python.org/cpython/rev/9c57178f13dc

--

___
Python tracker 

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



[issue27384] itertools islice consumes items when given negative range

2016-06-24 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue27384] itertools islice consumes items when given negative range

2016-06-24 Thread Matthew Malcomson

New submission from Matthew  Malcomson:

While the itertools.islice(iterator, n, n) trick is useful as used in the 
consume recipe, I find the current behaviour if stop is less than start (e.g. 
itertools.islice(iterator, 3, 0) ) to be surprising.

It still consumes the first three elements of the iterator, in the same manner 
as when start and stop are equal.
This is what the documentation implies, but I don't know whether that 
coincidence is by accident or design.

I would expect an iterator that immediately raises StopIteration but doesn't 
consume anything, but whether that's what most people would expect or not is 
another matter.
This would match the python version of islice() in the documentation, though I 
realise that implementation already diverges from the actual one via Issue 
27212 .

--
components: Library (Lib)
messages: 269206
nosy: Matthew  Malcomson
priority: normal
severity: normal
status: open
title: itertools islice consumes items when given negative range
type: behavior
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



[issue27186] add os.fspath()

2016-06-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ea7b6a7827a4 by Brett Cannon in branch 'default':
Issue #27186: Update os.fspath()/PyOS_FSPath() to check the return
https://hg.python.org/cpython/rev/ea7b6a7827a4

--

___
Python tracker 

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



[issue27186] add os.fspath()

2016-06-24 Thread Brett Cannon

Brett Cannon added the comment:

And now that I have updated os.fspath() I realize that Ethan said he was going 
to implement the update. :( If you started on the work, Ethan, I'm really sorry 
for duplicating your (potential) work.

I'm going to commit Dusty's glossary term next and then go through and update 
the docs to use it. At that point that will leave updating os.path as the last 
explicit step in PEP 519 that needs to be short of updating "What's New". We're 
getting there. :)

--

___
Python tracker 

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



Re: Question on compiling on linux

2016-06-24 Thread Zachary Ware
On Fri, Jun 24, 2016 at 1:35 PM, Steven Truppe  wrote:
> So back to my first question now that you saw everything worked fine, but
> there is no python.so file, did i miss something when using ./configure ?

Try `./configure --enable-shared`.

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


Seen bug in argparse module

2016-06-24 Thread Jagdish Choudhary
Hi All,


When argument provided from user which doesn't match to right option which
is mentioned in help , it runs without issue..let me provide an example

https://docs.python.org/3.3/library/argparse.html

import argparse
parser = argparse.ArgumentParser(description='Process some
integers.')parser.add_argument('integers', metavar='N', type=int,
nargs='+',
   help='an integer for the
accumulator')parser.add_argument('--sum', dest='accumulate',
action='store_const',
   const=sum, default=max,
   help='sum the integers (default: find the max)')
args = parser.parse_args()print(args.accumulate(args.integers))

python prog.py -h
usage: prog.py [-h] [--sum] N [N ...]

Process some integers.

positional arguments:
 N   an integer for the accumulator

optional arguments:
 -h, --help  show this help message and exit
 --sum   sum the integers (default: find the max)

If user run it like below-

JAGDISHs-MacBook-Pro:test_python jagdish$ python prog.py 12 3 4 --sum
19
JAGDISHs-MacBook-Pro:test_python jagdish$ python prog.py 12 3 4 --su
19
JAGDISHs-MacBook-Pro:test_python jag


-- 
Thanks and Regards,
Jagdish Choudhary
IBM India Pvt Ltd, Bangalore
M.No-8971011661
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question on compiling on linux

2016-06-24 Thread Steven Truppe
So back to my first question now that you saw everything worked fine, 
but there is no python.so file, did i miss something when using 
./configure ?



Am 2016-06-24 um 20:23 schrieb Chris Angelico:

On Sat, Jun 25, 2016 at 4:19 AM, Steven Truppe  wrote:

But that's not a library file, it's the interpreter, i need the library to
extend and embend python into my own application ...

Bouncing back to the list (please keep it there).

The reason I mentioned ./python is that, if it isn't there, something
failed with the build. It's an easy way of checking that everything
worked.

ChrisA


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


Re: Question on compiling on linux

2016-06-24 Thread Chris Angelico
On Sat, Jun 25, 2016 at 4:19 AM, Steven Truppe  wrote:
> But that's not a library file, it's the interpreter, i need the library to
> extend and embend python into my own application ...

Bouncing back to the list (please keep it there).

The reason I mentioned ./python is that, if it isn't there, something
failed with the build. It's an easy way of checking that everything
worked.

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


[issue27383] executuable in distutils triggering microsoft anti virus

2016-06-24 Thread Rob Bairos

Rob Bairos added the comment:

thanks for the quick action!

--

___
Python tracker 

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



[issue25042] Create an "embedding SDK" distribution?

2016-06-24 Thread Steve Dower

Steve Dower added the comment:

This was done! Just never closed

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



[issue27344] zipfile *does* support utf-8 filenames

2016-06-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This note looks outdated.

In 2.x 8-bit file names are written as is, implying cp437 or what your 
consumers expect. Unicode file names are encoded to ascii or utf-8 (with 
setting utf-8 flag). In 3.x only Unicode file names are accepted, and they 
always are encoded to ascii or utf-8. There is no way to write non-ascii 
non-utf-8 file names. cp437 is not used at all.

Maybe just remove this misleading note?

--

___
Python tracker 

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



[issue26907] Add missing getsockopt constants

2016-06-24 Thread Neil Schemenauer

Neil Schemenauer added the comment:

Issue #27377 adds these constants.

--
nosy: +nascheme

___
Python tracker 

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



[issue18391] socket.fromfd()'s API is difficult or impossible to use correctly in general

2016-06-24 Thread Neil Schemenauer

Neil Schemenauer added the comment:

Sorry, forgot to link the patch: Issue #27377.

--

___
Python tracker 

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



[issue18391] socket.fromfd()'s API is difficult or impossible to use correctly in general

2016-06-24 Thread Neil Schemenauer

Neil Schemenauer added the comment:

I've created a patch to add fromfd2().  I think it addresses the original 
concern of this issue.  My patch also adds the constants suggested by Issue 
#26907.

--
nosy: +nascheme

___
Python tracker 

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



[issue27371] Runaway memory consumption using tkinter update()

2016-06-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please file a report on Tk bugtracker?

https://core.tcl.tk/tk/ticket

--

___
Python tracker 

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



[issue27377] Add smarter socket.fromfd()

2016-06-24 Thread Neil Schemenauer

Neil Schemenauer added the comment:

Thank you for the excellent review Martin.  I'm attaching a new patch which I 
think addresses your points.  I created it from hg, maybe that works nicer.

I've added constants for SO_DOMAIN, SO_PROTOCOL, SO_PASSCRED, SO_PEERSEC, and 
SO_PASSEC.

Using SO_PROTOCOL to get the protocol value seems to work fine on Linux.

I've dropped the union as you suggest.  I think the docs have been fixed.

I would be okay with making fdtype() a non-public function.  It seems possibly 
useful though.

Regarding the name, currently I think fromfd2 is best.  It really does what 
fromfd() should have done if SO_TYPE/SO_PROTOCOL was available and portable.  

Extending fromfd() seems a bad idea.  I don't want dup() and it seems better 
that application code can use hasattr() to test for new functionality.  You can 
work around not having fromfd2() by using getsockname() and then using some 
ugly text matching to work out what kind of socket you have.

--
Added file: http://bugs.python.org/file43530/fromfd2_v2.txt

___
Python tracker 

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



[issue26171] heap overflow in zipimporter module

2016-06-24 Thread Vlad K.

Vlad K. added the comment:

Any updates on this? We've committed the patch for Python 3.3 as well in 
FreeBSD.

https://svnweb.freebsd.org/ports?view=revision=417019

--

___
Python tracker 

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



[issue27383] executuable in distutils triggering microsoft anti virus

2016-06-24 Thread Steve Dower

Steve Dower added the comment:

Wow, that sucks.

I just rebuilt it and it's still detected, so presumably somebody distributed 
malware as a bdist_exe and it made it into the signature. There haven't been 
any unexpected modifications to the sources.

I've submitted the file to the right people, so hopefully it will be removed 
from the signature soon.

--
assignee:  -> steve.dower
resolution:  -> third party
status: open -> closed

___
Python tracker 

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



[issue27198] Adding an assertClose() method to unittest.TestCase

2016-06-24 Thread Chris Barker

Chris Barker added the comment:

Thanks Robert.

I'll try to find time to re-do the patch soon. 

There was enough resistance to the whole idea that I wanted some confirmation 
that is was worth my time to do that!

Stay tuned.

--

___
Python tracker 

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



PyDev 5.1.2 Released

2016-06-24 Thread Fabio Zadrozny
Release Highlights:
---

* **Important** PyDev now requires Java 8 and Eclipse 4.5 onwards.

* PyDev 4.5.5 is the last release supporting Java 7 and Eclipse 3.8.
* See: http://www.pydev.org/update_sites/index.html for the update site of
older versions of PyDev.
* See: the **PyDev does not appear after install** section on
http://www.pydev.org/download.html for help on using a Java 8 vm in Eclipse.

* The pytest integration was redone and should now work properly with the
latest pytest.

* Properly showing output of tests in PyUnit view.
* Improved dealing with items filtered through Ctrl+F9.
* Better support for xdist (no longer reporting that the session finished
when only a slave finished).
* Reporting skipped items as "skip" and not "ok".
* Properly showing running tests on PyUnit view.
* Not using tokenize.open() in Python 3.2 for the execfile custom
implementation.

* Expand and collapse keybindings changed to use the Numpad entries (so
that they don't override the add/subtract used for zooming). #PyDev 695.

* The hover in PyDev has an implementation which is now more flexible and
easier to extend in plugins (patch by Mark A. Leone).

What is PyDev?
---

PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and
IronPython development.

It comes with goodies such as code completion, syntax highlighting, syntax
analysis, code analysis, refactor, debug, interactive console, etc.

Details on PyDev: http://pydev.org
Details on its development: http://pydev.blogspot.com


What is LiClipse?
---

LiClipse is a PyDev standalone with goodies such as support for Multiple
cursors, theming, TextMate bundles and a number of other languages such as
Django Templates, Jinja2, Kivy Language, Mako Templates, Html, Javascript,
etc.

It's also a commercial counterpart which helps supporting the development
of PyDev.

Details on LiClipse: http://www.liclipse.com/



Cheers,

--
Fabio Zadrozny
--
Software Developer

LiClipse
http://www.liclipse.com

PyDev - Python Development Environment for Eclipse
http://pydev.org
http://pydev.blogspot.com

PyVmMonitor - Python Profiler
http://www.pyvmmonitor.com/
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue27382] calendar module .isleap() probleam

2016-06-24 Thread Dyl Tuckey

Dyl Tuckey added the comment:

Thank you ebarry. I would probably never have figured that out

--

___
Python tracker 

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



[issue27344] zipfile *does* support utf-8 filenames

2016-06-24 Thread Daniel Holth

Daniel Holth added the comment:

https://hg.python.org/cpython/file/2.6/Lib/zipfile.py#l331

Python 2.6 zipfile supports utf8 properly. It has only improved since then.

--

___
Python tracker 

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



Re: Question on compiling on linux

2016-06-24 Thread Chris Angelico
On Sat, Jun 25, 2016 at 1:00 AM, Steven Truppe  wrote:
> i want to write an application that does extend and embed Python. I
> downloaded the sources for 3.5.1 and used ./confiugure to build.
>
> In the old times i got a file called python.so somewhere but now i get many
> .so files and how can i change between debug and release build (32 and
> 64bit) ? I'm new to Makefiles and ./configure, i used MSVC2010 on windows
> and try to understand how this things do work under linux - can someone
> please help me out here ??
>

After typing ../configure, did you type 'make'? That's the part that
does most of the work. If that succeeds, it should leave a file called
'python' in the main build directory.

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


[issue27363] Complex with negative zero imaginary part

2016-06-24 Thread Mark Dickinson

Mark Dickinson added the comment:

> I suspect that literal_eval, on the other hand, should reproduce what the 
> interpreter does

I think that's going to be awkward to achieve without making the behaviour of 
literal_eval significantly less obvious and more DWIMmy. And I'm not convinced 
that `literal_eval` should follow the behaviour of the complex constructor 
rather than the behaviour of plain `eval`.

Of course, the "right" fix here is to change the complex repr entirely so that 
it looks like the compound object that it is rather than an eval-able 
expression:

>>> repr(1+2j)
complex(1.0, 2.0)

That would break backwards compatibility, but given the number of times 
complaints come up on this tracker, I'm beginning to think it might be worth it.

--

___
Python tracker 

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



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

2016-06-24 Thread Xiang Zhang

Xiang Zhang added the comment:

I think we can start from index 1 instead of 0.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue22455] idna/punycode give wrong results on narrow builds

2016-06-24 Thread Mark Lawrence

Changes 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



Re: Which one is the best XML-parser?

2016-06-24 Thread Peter Otten
Marko Rauhamaa wrote:

> Random832 :
>> You know what would be really nice? A "semi-incremental" parser that
>> can e.g. yield (whether through an event or through the iterator
>> protocol) a fully formed element (preferably one that can be queried
>> with xpath) at a time for each record of a document representing a
>> list of objects. Does anything like that exist?
> 
> You can construct that from a SAX parser, but it's less convenient than
> it could be. Python's JSON parser doesn't have it so I've had to build a
> clumsy one myself:
> 
> def decode_json_object_array(self):
> # A very clumsy implementation of an incremental JSON
> # decoder
> it = self.get_text()
> inbuf = ""
> while True:
> try:
> inbuf += next(it)
> except StopIteration:
> # a premature end; trigger a decode error
> json.loads("[" + inbuf)
> try:
> head, tail = inbuf.split("[", 1)
> except ValueError:
> continue
> break
> # trigger a decode error if head contains junk
> json.loads(head + "[]")
> inbuf = ""
> chunk = tail
> while True:
> bracket_maybe = ""
> for big in chunk.split("]"):
> comma_maybe = ""
> for small in big.split(","):
> inbuf += comma_maybe + small
> comma_maybe = ","
> try:
> yield json.loads(inbuf)
> #except json.JSONDecodeError:
> except ValueError: # legacy exception
> pass
> else:
> inbuf = comma_maybe = ""
> inbuf += bracket_maybe
> bracket_maybe = "]"
> try:
> yield json.loads(inbuf)
> #except json.JSONDecodeError:
> except ValueError: # legacy exception
> pass
> else:
> inbuf = ""
> try:
> chunk += next(it)
> except StopIteration:
> break
> # trigger a decode error if chunk contains junk
> json.loads("[" + chunk)
> 
> It could easily be converted to an analogous XML parser.

For XML you could use iterparse, see 

http://effbot.org/elementtree/iterparse.htm

I came up with the following and found memory usage to be stable.

import random
import xml.etree.ElementTree
from xml.sax.saxutils import escape


def iter_elems(file, tag):
it = xml.etree.ElementTree.iterparse(file, events=("start", "end"))
root = next(it)[1]
for event, elem in it:
if event == "end" and elem.tag == tag:
yield elem
root.clear()

# --- example below ---

class NeverendingXMLFile:
def __init__(self, words):
self.words = words
self.chunks = self.gen_chunks()

def gen_chunks(self):
words = self.words
yield b""
while True:
yield "{}".format(random.choice(words)).encode()

def read(self, size=None):
return next(self.chunks)
   
def filelike():
with open("/usr/share/dict/words") as f:
words = [escape(line.strip()) for line in f]
infile = NeverendingXMLFile(words)
return infile

if __name__ == "__main__":
for word in iter_elems(filelike(), "word"):
print(word.text)

In theory this should be even simpler with lxml as it exposes the root 
element and allows to filter per tag

http://lxml.de/parsing.html#iterparse-and-iterwalk

Unfortunately root seems to be set after the closing  and thus doesn't 
help with dereferencing seen elements during iteration.

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


Question on compiling on linux

2016-06-24 Thread Steven Truppe

 Hi all,

i want to write an application that does extend and embed Python. I 
downloaded the sources for 3.5.1 and used ./confiugure to build.


In the old times i got a file called python.so somewhere but now i get 
many .so files and how can i change between debug and release build 
(32 and 64bit) ? I'm new to Makefiles and ./configure, i used MSVC2010 
on windows and try to understand how this things do work under linux - 
can someone please help me out here ??



Thanks in advance,
Steven Truppe
--
https://mail.python.org/mailman/listinfo/python-list


[issue27383] executuable in distutils triggering microsoft anti virus

2016-06-24 Thread Zachary Ware

Changes by Zachary Ware :


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



[issue5225] OS X "Update Shell Profile" may not update $PATH if run more than once

2016-06-24 Thread R. David Murray

R. David Murray added the comment:

I don't think "out of date" means "hasn't been touched in X years", I think it 
means "there is no longer any need to fix this issue".  That might mean it is a 
bug in something we no longer support, or a bug that has been fixed 
accidentally by later development.

--

___
Python tracker 

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



[issue27383] executuable in distutils triggering microsoft anti virus

2016-06-24 Thread Rob Bairos

New submission from Rob Bairos:

python 3.5:  wininst-14.0.exe

Is triggering 
Microsoft Security Essentials virus detection:

Recommended action: Remove this software immediately.

Items: 
file:D:\PythonBuilds\202ee57ca3\py\Lib\distutils\command\wininst-14.0.exe

I've tried on two separate machines so far, with same quarantine.


Microsoft Security Essentials (running on Windows 7)

Antimalware Client Version: 4.9.218.0
Engine Version: 1.1.12805.0
Antivirus definition: 1.223.2544.0
Antispyware definition: 1.223.2544.0
Network Inspection System Engine Version: 2.1.12706.0
Network Inspection System Definition Version: 116.10.0.0

--
components: Distutils
messages: 269186
nosy: Rob Bairos, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: executuable in distutils triggering microsoft anti virus
type: security
versions: Python 3.5

___
Python tracker 

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



[issue27382] calendar module .isleap() probleam

2016-06-24 Thread Dyl Tuckey

New submission from Dyl Tuckey:

I don't know why but whenever I try and run this code:
import calendar
import time
calendar = calendar.month(2016,6)
print ("Loading date, time, month and leap year status")
time.sleep(5)
print (calendar)
localtime = time.asctime(time.localtime(time.time()))
print (localtime)
if calendar.isleap(2016) == True:
print("This year is a leap year")
else:
print("This year is not a leap year")


It come up with:
Loading date, time, month and leap year status
 June 2016
Mo Tu We Th Fr Sa Su
   1  2  3  4  5
 6  7  8  9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30

Fri Jun 24 15:46:12 2016
Traceback (most recent call last):
  File "C:\Users\Dylan\Desktop\Python\Calendar.py", line 9, in 
if calendar.isleap(2016) == True:
AttributeError: 'str' object has no attribute 'isleap'

And I don't know why I keep getting error messages

--
components: IDLE
messages: 269183
nosy: Dyl Tuckey
priority: normal
severity: normal
status: open
title: calendar module .isleap() probleam
type: compile error
versions: Python 3.5

___
Python tracker 

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



[issue16821] bundlebuilder broken in 2.7

2016-06-24 Thread R. David Murray

R. David Murray added the comment:

No, I think out of date is closest.  It's no longer relevant because it no 
longer exists in python3, so its support date has effectively passed EOL :)

--

___
Python tracker 

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



[issue27382] calendar module .isleap() probleam

2016-06-24 Thread Emanuel Barry

Emanuel Barry added the comment:

You're overriding the 'calendar' variable, holding the module, by the result of 
your 'calender.month' call, which happens to be a str. Use a different variable 
name (e.g. 'result') and the error will disappear.

Unrelated, but don't check for 'if x == True' - just do 'if x' and the result 
will be the same (also allows for any other result than booleans).

--
components:  -IDLE
nosy: +ebarry
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: compile error -> 

___
Python tracker 

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



[issue21106] Updated Mac folder icon

2016-06-24 Thread R. David Murray

R. David Murray added the comment:

Someone from the development team can contact legal, so yes there is a 
development action item here.

It could be marked as languishing, but that status hasn't actually proven 
useful in practice and I think we should drop it.

--

___
Python tracker 

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



[issue27371] Runaway memory consumption using tkinter update()

2016-06-24 Thread R. David Murray

Changes by R. David Murray :


--
stage:  -> resolved

___
Python tracker 

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



[issue27363] Complex with negative zero imaginary part

2016-06-24 Thread R. David Murray

R. David Murray added the comment:

That's a good point; however the goal of the "repr invariant" is to be able to 
losslessly reproduce the object when possible.  The fact that you have to use 
the complex constructor to do that is unfortunate, but is a consequence of the 
underlying problem.  I suspect that literal_eval, on the other hand, should 
reproduce what the interpreter does, but since I think it already doesn't do 
that 100% (though I can't offhand remember what makes me think that) perhaps 
that is a possibility.  I'll reopen the issue to discuss that.

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

___
Python tracker 

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



[issue22455] idna/punycode give wrong results on narrow builds

2016-06-24 Thread Josh Lee

Changes by Josh Lee :


--
nosy: +jleedev

___
Python tracker 

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



[issue27344] zipfile *does* support utf-8 filenames

2016-06-24 Thread R. David Murray

R. David Murray added the comment:

I bet the existing wording is just left over from the python2 docs.

I think cp437 should still be mentioned explicitly.  And mentioning "setting 
the utf-8 flag" would probably make the explanation clearer, though I'm not 
sure.

Tecnically speaking, I think zipfile supports utf8, not unicode.  Or it 
supports unicode via utf-8.

--

___
Python tracker 

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



[issue16821] bundlebuilder broken in 2.7

2016-06-24 Thread Carol Willing

Carol Willing added the comment:

R. David, Would there be a better resolution than 'out of date'? The other 
resolutions didn't really seem to fit either.

Agree, that the issue is a moot point.

--

___
Python tracker 

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



[issue13759] Python 3.2.2 Mac installer version doesn't accept multibyte character in interactive mode

2016-06-24 Thread Carol Willing

Carol Willing added the comment:

R. David, Fair enough. Thanks for pointing out the difference between 'out of 
date' and 'works for me'.

--

___
Python tracker 

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



[issue21106] Updated Mac folder icon

2016-06-24 Thread Carol Willing

Carol Willing added the comment:

R. David, I'm confused. There isn't anything actionable from a development 
standpoint on this issue. Why wouldn't it be marked languishing.

--

___
Python tracker 

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



[issue21106] Updated Mac folder icon

2016-06-24 Thread R. David Murray

R. David Murray added the comment:

We do not close issues just because they are old.  Someone could still pick 
this up and contact psf legal and get this merged.

--
nosy: +r.david.murray
resolution: out of date -> 
status: closed -> open

___
Python tracker 

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



[issue5225] OS X "Update Shell Profile" may not update $PATH if run more than once

2016-06-24 Thread Carol Willing

Carol Willing added the comment:

Perhaps it would be prudent to update the dev guide, or the contribution 
process, to close issues that have stagnated for years as opposed to marking 
them languishing. It would likely help with the issue backlog.

Also, expanding out of date to reflect that an issue has not been touched in 
over 'x' years would be helpful too. Perhaps that should be an addition to the 
dev guide.

--

___
Python tracker 

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



[issue13829] exception error in _scproxy.so when called after fork

2016-06-24 Thread R. David Murray

R. David Murray added the comment:

Why is it out of date?  Has it been fixed?  Has apple changed their abort 
policy?

Obviously it isn't high priority, though :)

--
assignee: ronaldoussoren -> 
nosy: +r.david.murray
priority: normal -> low
resolution: out of date -> 
status: closed -> open
title: exception error in _scproxy.so -> exception error in _scproxy.so when 
called after fork

___
Python tracker 

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



[issue5225] OS X "Update Shell Profile" may not update $PATH if run more than once

2016-06-24 Thread Carol Willing

Carol Willing added the comment:

This issue was closed as "out of date" since there has been no activity on the 
issue in 7 years.

IMHO the issue, if still relevant, should be opened as a new issue with better 
scope based on today's technology.

--

___
Python tracker 

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



Re: Which one is the best JSON parser?

2016-06-24 Thread Grant Edwards
On 2016-06-23, MRAB  wrote:
> On 2016-06-23 21:58, David Shi via Python-list wrote:
>> Can any one tell me?
>> Regards.
>> David
>>
> There's one in the standard library.

Which has always worked fine for me...

-- 
Grant Edwards   grant.b.edwardsYow! I want another
  at   RE-WRITE on my CEASAR
  gmail.comSALAD!!

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


[issue13759] Python 3.2.2 Mac installer version doesn't accept multibyte character in interactive mode

2016-06-24 Thread R. David Murray

R. David Murray added the comment:

This isn't out of date, it appears that it was not a bug in the first place, 
but the OP never got back to us with confirmation one way or the other.

--
nosy: +r.david.murray
resolution: out of date -> works for me

___
Python tracker 

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



[issue5225] OS X "Update Shell Profile" may not update $PATH if run more than once

2016-06-24 Thread R. David Murray

R. David Murray added the comment:

Why is it out of date?  Did Ned solve this another way at some point?

What I'm getting at is just closing an issue as "out of date" is not enough, 
really, it is best to record *why* the issue is out of date.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue8406] Make some setup.py paths exclude-able

2016-06-24 Thread R. David Murray

R. David Murray added the comment:

We don't close issues just because they are languishing.  We'd need to know 
that the issue has been superseded or is otherwise no longer an issue.  It 
sounds like this one falls into that category, since another issue is noted as 
a possible superseder, but I don't know enough about the issues involved to be 
sure.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue16821] bundlebuilder broken in 2.7

2016-06-24 Thread R. David Murray

R. David Murray added the comment:

It's not obvious that this issue would be out of date by our normal policies; 
however, since bundlebuilder doesn't exist in python3 it seems reasonable to 
close it.  What functionality python2 has at this point is what it has.

--
nosy: +r.david.murray

___
Python tracker 

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



Re: Which one is the best XML-parser?

2016-06-24 Thread Marko Rauhamaa
Random832 :
> You know what would be really nice? A "semi-incremental" parser that
> can e.g. yield (whether through an event or through the iterator
> protocol) a fully formed element (preferably one that can be queried
> with xpath) at a time for each record of a document representing a
> list of objects. Does anything like that exist?

You can construct that from a SAX parser, but it's less convenient than
it could be. Python's JSON parser doesn't have it so I've had to build a
clumsy one myself:

def decode_json_object_array(self):
# A very clumsy implementation of an incremental JSON decoder
it = self.get_text()
inbuf = ""
while True:
try:
inbuf += next(it)
except StopIteration:
# a premature end; trigger a decode error
json.loads("[" + inbuf)
try:
head, tail = inbuf.split("[", 1)
except ValueError:
continue
break
# trigger a decode error if head contains junk
json.loads(head + "[]")
inbuf = ""
chunk = tail
while True:
bracket_maybe = ""
for big in chunk.split("]"):
comma_maybe = ""
for small in big.split(","):
inbuf += comma_maybe + small
comma_maybe = ","
try:
yield json.loads(inbuf)
#except json.JSONDecodeError:
except ValueError: # legacy exception
pass
else:
inbuf = comma_maybe = ""
inbuf += bracket_maybe
bracket_maybe = "]"
try:
yield json.loads(inbuf)
#except json.JSONDecodeError:
except ValueError: # legacy exception
pass
else:
inbuf = ""
try:
chunk += next(it)
except StopIteration:
break
# trigger a decode error if chunk contains junk
json.loads("[" + chunk)

It could easily be converted to an analogous XML parser.


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


Re: Which one is the best XML-parser?

2016-06-24 Thread Random832
On Fri, Jun 24, 2016, at 02:39, dieter wrote:
> You want an incremental parser if the XML documents are so huge that
> you must process them incrementally rather than have a data structure
> representing the whole document (in memory). Incremental parsers
> for XML are usually called "SAX" parsers.

You know what would be really nice? A "semi-incremental" parser that can
e.g. yield (whether through an event or through the iterator protocol) a
fully formed element (preferably one that can be queried with xpath) at
a time for each record of a document representing a list of objects.
Does anything like that exist?
-- 
https://mail.python.org/mailman/listinfo/python-list


RSFile v2.1 released

2016-06-24 Thread Pascal Chambon

Dear pythoneers,

I'm pleased to announce a major update of the RSFile I/O Library: 
version 2.1.


RSFile provides drop-in replacements for the classes of the*io *module, 
and for the *open()* builtin.


Its goal is to provide a cross-platform, reliable, and comprehensive 
synchronous file I/O API, with advanced
features like fine-grained opening modes, shared/exclusive file record 
locking, thread-safety, cache synchronization,
file descriptor inheritability, and handy stat getters (size, inode, 
times...).


Possible use cases for this library: concurrently writing to logs 
without ending up with garbled data,
manipulating sensitive data like disk-based databases, synchronizing 
heterogeneous producer/consumer

processes when multiprocessing semaphores aren't an option...

Unix users might particularly be interested by the workaround that this 
library provides, concerning
the weird semantic of fcntl() locks (when any descriptor to a disk file 
is closed, the process loses ALL

locks acquired on this file through any descriptor).

RSFile has been tested with py2.7 and py3.3+, on Windows/Linux systems,
and should theoretically work on other *nix systems and python 
implementations


The technical documentation of RSFile includes a comprehensive description
of concepts and gotchas encountered while developing this library, which 
could
be useful to anyone interested in getting in touch with gory file I/O 
details.


The implementation is currently pure-python, so if you need high 
performances, using standard python streams

in parallel will remain necessary.

/Why v2.1 and not v2.0 you ask ? Just some pypi constraints I wasn't 
aware of, that'll teach me not to erase a just-released version to add 
some cleanup commits to it.../



Downloads:
https://pypi.python.org/pypi/RSFile/2.1

Documentation:
http://rsfile.readthedocs.io/en/latest/

Repository:
https://github.com/pakal/rsfile

_CHANGELOG:_
* Switch from Mercurial to Git
* Remove python2.6 support and its polyfills
* Move backends and test suites inside rsfile package
* Conform rsfile to the behaviour of latest "io" module and "open" builtin
* Make rsfile work against py33, py34 and py35, by leveraging their 
stdlib test suites
* Rename "win32" to "windows" everywhere (even pywin32 extensions 
actually handle x64 system)

* Improve the I/O benchmark runner
* Cache decorated methods to boost performances
* Add support for the new "x" mode flag in rsopen()
* Fix the corner case of uninitialized streams
* Tweak the excessive verbosity of locking tests
* Handle exceptions when closing raw streams (stream is marked as closed 
anyway)

* Normalize the naming of backend modules
* Fix bugs with __getattr__() lookup forwarding
* Use C/N flags for file existence on opening (-/+ supported but deprecated)
* Automatically compare the behaviour of all possible open modes, 
between stdlib/io and rsfile
* Autogenerate equivalence matrix for file opening modes, using 
python-tabulate.

* Switch from distutils to setuptools for setup.py
* Add support for the new "opener" parameter of open() builtin
* Strengthen tests around fileno/handle reuse and duplication
* Fix bug regarding improper value of file "modification_time" on windows
* Add implicit flush() before every sync()
* Remove heavy star imports from pywin32 backend
* Roughly test sync() parameters, via performance measurements
* Rename file "uid()" to "unique_id()", to prevent confusion with "user 
id" (but an alias remains)

* Fix nasty bug where file unique_id could be None in internal registries
* Add lots of defensive assertions
* Make FileTimes repr() more friendly
* Add support for the wrapping of [non-blocking] pipes/fifos
* Reject the opening of directories properly
* Reorganize and cleanup sphinx docs
* Improve docstrings of added/updated methods/attributes
* Explain the file locking semantic better
* Update and correct typos in the "I/O Overview" article
* Document lots of corner cases: thread safety, reentrancy, sync 
parameters, file-share-delete semantic...
* Remove the now obsolete "multi_syscall_lock" (thread-safe interface 
does better)

* Integrate tests and doc building with Tox
* Fix bug with windows/ctypes backend on python3.5 (OVERLAPPED structure 
was broken)

* Add tests for the behaviour of streams after a fork()
* Add optmizations for systems without fork (no need for multiprocessing 
locks then)

* Normalize "__future__" imports and code formatting
* Review and document the exception types used
* Cleanup/DRY tons of obsolete TODOs and comments
* Better document the CAVEATS of rsfile, regarding fcntl and 
interoperability with other I/O libs
* Add standard files to the repository (readme, contributing, changelog 
etc.)

* Integrate with Travis CI
* Add some tweaks to mimick the more tolerant behaviour of python2.7 
open(),

  regarding the mixing of str and unicode
* Add script for aggregate coverage reporting
* Strengthen tests of rsopen() usage errors

regards,
Pascal Chambon
--

Re: Can math.atan2 return INF?

2016-06-24 Thread Marko Rauhamaa
pdora...@pas-de-pub-merci.mac.com (Pierre-Alain Dorange):

> Marko Rauhamaa  wrote:
>
>> Note that the "valid point of view for external observers" is the
>> only valid scientific point of view.
>
> For a scientific point of view, right. But tell this to the one that
> will be close to a blackhole ;-)

Then, you'd better consult a priest than a scientist.


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


[issue27381] Typo in zipfile documentation

2016-06-24 Thread Berker Peksag

Berker Peksag added the comment:

Thanks!

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> behavior
versions: +Python 3.5

___
Python tracker 

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



[issue27381] Typo in zipfile documentation

2016-06-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset be435520e493 by Berker Peksag in branch '3.5':
Issue #27381: Remove superfluous paren in zipfile documentation
https://hg.python.org/cpython/rev/be435520e493

New changeset f859380d4708 by Berker Peksag in branch 'default':
Issue #27381: Merge from 3.5
https://hg.python.org/cpython/rev/f859380d4708

--
nosy: +python-dev

___
Python tracker 

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



[issue27381] Typo in zipfile documentation

2016-06-24 Thread Xiang Zhang

New submission from Xiang Zhang:

There is a redundant ')' in zipfile doc. Remove it.

--
assignee: docs@python
components: Documentation
files: zipfile_doc.patch
keywords: patch
messages: 269166
nosy: docs@python, xiang.zhang
priority: normal
severity: normal
status: open
title: Typo in zipfile documentation
versions: Python 3.6
Added file: http://bugs.python.org/file43528/zipfile_doc.patch

___
Python tracker 

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



  1   2   >