[issue24789] ctypes doc string

2016-01-09 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the patch!

--
nosy: +ezio.melotti
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed
versions:  -Python 3.4

___
Python tracker 

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



[issue26061] logging LogRecordFactory allow kwargs

2016-01-09 Thread Aviv Palivoda

New submission from Aviv Palivoda:

The logging LogRecord factory receives kwargs. However because _log and 
makeRecord functions in the Logger class don't support kwargs we can't actually 
pass additional positional arguments to LogRecord.

A use case for this is attached.

I had made a patch to fix this by changing _log and makeRecord to accept kwargs 
and pass them.

--
components: Library (Lib)
files: usecase.py
messages: 257831
nosy: palaviv, vinay.sajip
priority: normal
severity: normal
status: open
title: logging LogRecordFactory allow kwargs
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file41553/usecase.py

___
Python tracker 

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



[issue26063] Update copyright in the devguide

2016-01-09 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the patch!

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



[issue26063] Update copyright in the devguide

2016-01-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ac2b3bafd41c by Ezio Melotti in branch 'default':
#26063: update copyright.  Patch by Chris Gonzalez.
https://hg.python.org/devguide/rev/ac2b3bafd41c

--
nosy: +python-dev

___
Python tracker 

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



[issue26001] Tutorial: write() does not expect string in binary mode

2016-01-09 Thread Elena Oat

Elena Oat added the comment:

Wrapped the lines to 80 chars.

--
nosy: +Elena.Oat
Added file: http://bugs.python.org/file41556/issue26001.diff

___
Python tracker 

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



[issue25170] 3.5.0 documentation archives missing

2016-01-09 Thread Ezio Melotti

Ezio Melotti added the comment:

https://www.python.org/ftp/python/doc/3.5.0/ now contains some files, but they 
seem to be for the ones for alpha 1 and 3.  The dir for 3.5.1 is still missing.

--
nosy: +ezio.melotti

___
Python tracker 

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



Re: Problem with 'print'

2016-01-09 Thread D'Arcy J.M. Cain
On Sat, 9 Jan 2016 12:40:16 +0100
pablo gormi  wrote:
> Hello, recently I downloaded python, but when I try to execute one
> file with the command 'print' it shows me a error. The error is:
> 
> Missing parentheses in call to 'print'

You downloaded Python 3. but your script was written for
Python 2..  You have a few choices.

Remove Python and install Python 2.7.
Edit your script to bring it up to the latest version.
Run 2to3 on your script or even whole directories.

The first may be the easiest but you will have to do one of the others
eventually so I would discourage it.

There are plenty of sites (GIYF) that explain the differences between 2
and 3.  You can manually edit all of your files.

Current Python comes with a program called 2to3 that does 99% of the
work for you.  You should probably review the changes it makes (capture
the output) to see if anything needs to be tweaked.  This is definitely
the best solution IMO.

-- 
D'Arcy J.M. Cain
Vybe Networks Inc.
http://www.VybeNetworks.com/
IM:da...@vex.net VoIP: sip:da...@vybenetworks.com
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24918] Docs layout bug

2016-01-09 Thread Manvi B

Manvi B added the comment:

Both solutions msg257821, msg257822 seems to fix the issue.

--

___
Python tracker 

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



[issue26061] logging LogRecordFactory allow kwargs

2016-01-09 Thread Aviv Palivoda

Aviv Palivoda added the comment:

adding the patch :)

--
keywords: +patch
Added file: http://bugs.python.org/file41554/LogRecordFactoryKwargs.patch

___
Python tracker 

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



[issue26062] IPython4 bash magic ! with {} does not work with Python 3.5.1

2016-01-09 Thread Christoph Böddeker

New submission from Christoph Böddeker:

Hello, 

I found a wrong behavior with IPython 4 in combination with Python 3.5.1. 

Normally in a command like "In [2]: !echo {a}" everything inside {} is 
interpreted with python and inserted to executed the line with bash. After I 
done a upgrade tp Python 3.5.1 this wasn't working. After a downgrade (3.5.0) 
it was working.

In the bottom is an example, where "In [2]: !echo {a}" are the important lines.
In [2]: !echo {a}
 * Python 3.5.0 -> 3
 * Python 3.5.1 -> {a}

Best regards
Christoph 

---
$ ipython
Python 3.5.1 |Anaconda 2.4.0 (64-bit)| (default, Dec  7 2015, 11:16:01) 
Type "copyright", "credits" or "license" for more information.

IPython 4.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help  -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: a = 3

In [2]: !echo {a}
{a}

In [3]: 
---
conda install python=3.5.0
Fetching package metadata: 
Solving package specifications: 
Package plan for installation in environment /opt/anaconda3:

The following packages will be DOWNGRADED:

python: 3.5.1-0 --> 3.5.0-1

Proceed ([y]/n)? y

Unlinking packages ...
[  COMPLETE  ]|###| 100%
Linking packages ...
[  COMPLETE  ]|###| 100%

---

$ ipython
Python 3.5.0 |Anaconda 2.4.0 (64-bit)| (default, Oct 19 2015, 21:57:25) 
Type "copyright", "credits" or "license" for more information.

IPython 4.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help  -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: a = 3

In [2]: !echo {a}
3

In [3]:

--
messages: 257833
nosy: Christoph Böddeker
priority: normal
severity: normal
status: open
title: IPython4 bash magic ! with {} does not work with Python 3.5.1
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



Re: [pythran] Pythran 0.7.4 is out!

2016-01-09 Thread Neal Becker
How do I build pythran3?


On Thu, Jan 7, 2016 at 2:51 PM, serge guelton <
serge.guel...@telecom-bretagne.eu> wrote:

> (sorry for the double posting, if any)
>
> Dear pythraners and pythonists,
>
> The pythran team (a great total of 2 active developers) is delighted to
> announce the release of Pythran 0.7.4, available on the traditional
> channels:
>
> - pypi: https://pypi.python.org/pypi/pythran
> - conda: https://anaconda.org/serge-sans-paille/pythran
> - github: https://github.com/serge-sans-paille/pythran
>
> As usual, here is a (new) code sample, once again adapted from a
> stackoverflow question[0] that showcases pythran capability:
>
>
> #pythran export check_mask(bool[][], bool[])
> #  ^~~ non intrusive top-level annotation
>
> import numpy as np
> #  ^~ numpy support (partial)
> def check_mask(db, out, mask=[1, 0, 1]):
> for idx, line in enumerate(db):
> target, vector = line[0], line[1:]
> # ^ type destructuring, array view
> if (mask == np.bitwise_and(mask, vector)).all():
> # ^~~ optimization of high level construct
> if target == 1:
> out[idx] = 1
> return out
>
>
> Compiled with:
>
> % pythran check_mask.py
>
> And benchmarked with:
>
> % python -m timeit -s 'n=10e3 ; import numpy as np;db  =
> np.array(np.random.randint(2, size=(n, 4)), dtype=bool); out =
> np.zeros(int(n),dtype=bool); from eq import check_mask' 'check_mask(db,
> out)'
>
> On average, the CPython version runs in 137 msec while the pythran version
> run in 450us on my laptop :-)
>
>
> Here is an extract of the changelog:
>
> 2016-01-05 Serge Guelton 
>
> * IPython's magic for pythran now supports extra compile flags
>
> * Pythran's C++ output is compatible with Python3 and pythran3 can
> compile it!
>
> * More syntax checks (and less template traceback)
>
> * Improved UI (multiline pythran exports, better setup.py...)
>
> * Pythonic leaning / bugfixing (this tends to be a permanent item)
>
> * More generic support for numpy's dtype
>
> * Simpler install (no more boost.python deps, nor nt2
> configuration)
>
> * Faster compilation (no more boost.python deps, smarter pass
> manager)
>
> * Better testing (gcc + clang)
>
> Again, thanks a lot to Pierrick for his continuous top-quality work, and
> to the OpenDreamKit[1] project that funded (most of) the recent
> developments!
>
> Special thanks to @hainm, @nbecker, @pkoch, @fsteinmetz, @Suor for their
> feedbacks. *You* give us the motivation to go on!
>
>
> [0]
> http://stackoverflow.com/questions/34500913/numba-slower-for-numpy-bitwise-and-on-boolean-arrays
> [1] http://opendreamkit.org/
>



-- 
*Those who don't understand recursion are doomed to repeat it*
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


Pythran 0.7.4 is out!

2016-01-09 Thread serge guelton
(sorry for the double posting, if any)

Dear pythraners and pythonists,

The pythran team (a great total of 2 active developers) is delighted to
announce the release of Pythran 0.7.4, available on the traditional
channels:

- pypi: https://pypi.python.org/pypi/pythran
- conda: https://anaconda.org/serge-sans-paille/pythran
- github: https://github.com/serge-sans-paille/pythran

As usual, here is a (new) code sample, once again adapted from a
stackoverflow question[0] that showcases pythran capability:


#pythran export check_mask(bool[][], bool[])
#  ^~~ non intrusive top-level annotation

import numpy as np
#  ^~ numpy support (partial)
def check_mask(db, out, mask=[1, 0, 1]):
for idx, line in enumerate(db):
target, vector = line[0], line[1:]
# ^ type destructuring, array view
if (mask == np.bitwise_and(mask, vector)).all():
# ^~~ optimization of high level construct
if target == 1:
out[idx] = 1
return out


Compiled with:

% pythran check_mask.py

And benchmarked with:

% python -m timeit -s 'n=10e3 ; import numpy as np;db  = 
np.array(np.random.randint(2, size=(n, 4)), dtype=bool); out = 
np.zeros(int(n),dtype=bool); from eq import check_mask' 'check_mask(db, out)'

On average, the CPython version runs in 137 msec while the pythran version run 
in 450us on my laptop :-)


Here is an extract of the changelog:

2016-01-05 Serge Guelton 

* IPython's magic for pythran now supports extra compile flags

* Pythran's C++ output is compatible with Python3 and pythran3 can 
compile it!

* More syntax checks (and less template traceback)

* Improved UI (multiline pythran exports, better setup.py...)

* Pythonic leaning / bugfixing (this tends to be a permanent item)

* More generic support for numpy's dtype

* Simpler install (no more boost.python deps, nor nt2 configuration)

* Faster compilation (no more boost.python deps, smarter pass manager)

* Better testing (gcc + clang)

Again, thanks a lot to Pierrick for his continuous top-quality work, and
to the OpenDreamKit[1] project that funded (most of) the recent developments!

Special thanks to @hainm, @nbecker, @pkoch, @fsteinmetz, @Suor for their
feedbacks. *You* give us the motivation to go on!


[0] 
http://stackoverflow.com/questions/34500913/numba-slower-for-numpy-bitwise-and-on-boolean-arrays
[1] http://opendreamkit.org/


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


licenses

2016-01-09 Thread Martinez, Jorge Alberto (GE Aviation)
Hello
We develop applications here with Python and I want to know if there's issues 
by using.
We use NumPy, PyDaqMx, Py Visa

How can we cover this licensing?

Regards


Jorge Alberto Martinez
GE Aviation Systems
HW Team Manager
GEIQ Power Engineering

T +52 442 456 6446
E jorgealberto.marti...@ge.com

Calle Campo Real #1692,
Residencial el Refugio, Querétaro, Qro, CP 76146
Mexico.
GE Imagination at work
I have Feedback for GEIQ




Jorge Alberto Martinez
GE Aviation Systems
HW Team Manager
GEIQ Power Engineering

T +52 442 456 6446
E jorgealberto.marti...@ge.com

Calle Campo Real #1692,
Residencial el Refugio, Querétaro, Qro, CP 76146
Mexico.
GE Imagination at work
I have Feedback for GEIQ


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


Re: Need help on a project To :"Create a class called BankAccount with the following parameters "

2016-01-09 Thread geraldjuwah
On Friday, 8 January 2016 17:38:11 UTC+1, acushl...@gmail.com  wrote:
> On Wednesday, 30 December 2015 19:21:32 UTC+1, Won Chang  wrote:
> > i have these task which i believe i have done well to some level
> > 
> > Create a function get_algorithm_result to implement the algorithm below
> > 
> > 1- Get a list of numbers L1, L2, L3LN as argument 2- Assume L1 is the 
> > largest, Largest = L1 3- Take next number Li from the list and do the 
> > following 4- If Largest is less than Li 5- Largest = Li 6- If Li is last 
> > number from the list then 7- return Largest and come out 8- Else repeat 
> > same process starting from step 3
> > 
> > Create a function prime_number that does the following Takes as parameter 
> > an integer and Returns boolean value true if the value is prime or Returns 
> > boolean value false if the value is not prime
> > 
> > so i came up with this code below
> > 
> > def get_algorithm_result(my_list):
> > if not any(not type(y) is int for y in my_list):
> > largest = 0
> > for item in range(0,len(my_list)):
> > if largest < my_list[item]:
> > largest = my_list[item]
> > return largest
> > else:
> > 
> > return(my_list[-1])
> > 
> > def prime_number(integer):
> > if integer%2==0 and 2!=integer:
> > return False
> > else:
> > return True
> > 
> > get_algorithm_result([1, 78, 34, 12, 10, 3]) 
> > get_algorithm_result(["apples", "oranges", "mangoes", "banana", "zoo"]) 
> > prime_number(1) 
> > prime_number(78) 
> > prime_number(11) 
> > for the question above, there is a unittes which reads
> > 
> > import unittest
> > 
> > class AlgorithmTestCases(unittest.TestCase):
> >   def test_maximum_number_one(self):
> > result = get_algorithm_result([1, 78, 34, 12, 10, 3])
> > self.assertEqual(result, 78, msg="Incorrect number")
> > 
> >   def test_maximum_number_two(self):
> > result = get_algorithm_result(["apples", "oranges", "mangoes", 
> > "banana", "zoo"])
> > self.assertEqual(result, "zoo", msg="Incorrect number")
> > 
> >   def test_prime_number_one(self):
> > result = prime_number(1)
> > self.assertEqual(result, True, msg="Result is invalid")
> > 
> >   def test_prime_number_two(self):
> > result = prime_number(78)
> > self.assertEqual(result, False, msg="Result is invalid")
> > 
> >   def test_prime_number_three(self):
> > result = prime_number(11)
> > self.assertEqual(result, True, msg="Result is invalid")
> > but once i run my code ,it returns error saying Test Spec Failed
> > 
> > Your solution failed to pass all the tests
> > what is actually wrong with my code?
> 
> I had to use a hack to bypass it, worked and I moved on to next quiz

> could you please share how you bypassed it?

On Friday, 8 January 2016 17:38:11 UTC+1, acushl...@gmail.com  wrote:
> On Wednesday, 30 December 2015 19:21:32 UTC+1, Won Chang  wrote:
> > i have these task which i believe i have done well to some level
> > 
> > Create a function get_algorithm_result to implement the algorithm below
> > 
> > 1- Get a list of numbers L1, L2, L3LN as argument 2- Assume L1 is the 
> > largest, Largest = L1 3- Take next number Li from the list and do the 
> > following 4- If Largest is less than Li 5- Largest = Li 6- If Li is last 
> > number from the list then 7- return Largest and come out 8- Else repeat 
> > same process starting from step 3
> > 
> > Create a function prime_number that does the following Takes as parameter 
> > an integer and Returns boolean value true if the value is prime or Returns 
> > boolean value false if the value is not prime
> > 
> > so i came up with this code below
> > 
> > def get_algorithm_result(my_list):
> > if not any(not type(y) is int for y in my_list):
> > largest = 0
> > for item in range(0,len(my_list)):
> > if largest < my_list[item]:
> > largest = my_list[item]
> > return largest
> > else:
> > 
> > return(my_list[-1])
> > 
> > def prime_number(integer):
> > if integer%2==0 and 2!=integer:
> > return False
> > else:
> > return True
> > 
> > get_algorithm_result([1, 78, 34, 12, 10, 3]) 
> > get_algorithm_result(["apples", "oranges", "mangoes", "banana", "zoo"]) 
> > prime_number(1) 
> > prime_number(78) 
> > prime_number(11) 
> > for the question above, there is a unittes which reads
> > 
> > import unittest
> > 
> > class AlgorithmTestCases(unittest.TestCase):
> >   def test_maximum_number_one(self):
> > result = get_algorithm_result([1, 78, 34, 12, 10, 3])
> > self.assertEqual(result, 78, msg="Incorrect number")
> > 
> >   def test_maximum_number_two(self):
> > result = get_algorithm_result(["apples", "oranges", "mangoes", 
> > "banana", "zoo"])
> > self.assertEqual(result, "zoo", msg="Incorrect number")
> > 
> >   def test_prime_number_one(self):
> > result = prime_number(1)
> > self.assertEqual(result, True, msg="Result is invalid")
> > 
> >   def test_prime_number_two(self):
> > result = prime_number(78)
> > 

PyCA/cryptography 1.2 released

2016-01-09 Thread Paul Kehrer
On behalf of all our contributors I am pleased to announce the release of 
PyCA/cryptography (https://github.com/pyca/cryptography) version 1.2. 
cryptography is a package which provides cryptographic recipes and primitives 
to Python developers. Our goal is for it to be your "cryptographic standard 
library". We support Python 2.6-2.7, Python 3.3+, and PyPy.

Changelog (https://cryptography.io/en/latest/changelog/):
 
* BACKWARDS INCOMPATIBLE: RevokedCertificate extensions now uses extension 
classes rather than returning raw values inside the Extension value.
* Deprecated support for OpenSSL 0.9.8 and 1.0.0. At this time there is no time 
table for actually dropping support, however we strongly encourage all users to 
upgrade as those versions no longer receive support from the OpenSSL project.
* The Certificate class now has signature and tbs_certificate_bytes attributes.
* The CertificateSigningRequest class now has signature and 
tbs_certrequest_bytes attributes.
* The CertificateRevocationList class now has signature and tbs_certlist_bytes 
attributes.
* NameConstraints are now supported in the CertificateBuilder and 
CertificateSigningRequestBuilder.
* Support serialization of certificate revocation lists using the 
public_bytes() method of CertificateRevocationList.
* Add support for parsing CertificateRevocationList extensions() in the OpenSSL 
backend.
* Added CertificateRevocationListBuilder and RevokedCertificateBuilder to allow 
creation of CRLs.
* Unrecognized non-critical X.509 extensions are now parsed into an 
UnrecognizedExtension object.

...and various other improvements. Please see the website changelog for 
documentation and additional details.

-Paul Kehrer (reaperhulk)
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


ANN: Bokeh 0.11 released

2016-01-09 Thread Bryan Van de Ven
Hi all,

On behalf of the Bokeh team, I am excited to announce the release of version
0.11 of Bokeh.

Bokeh Version 0.11 is a large release with *many* new improvements. The
major focus of this release was to introduce a new Bokeh server, based on
Tornado and websockets that is more stable, has higher performance, and simpler
to use and deploy. You can already see a small sample of hosted Bokeh
application examples at a new site located here:

http://demo.bokehplots.com

We will be adding many new examples here over the coming weeks.

There is so much exciting in this release, that we will need a few blog
posts to talk about everything. Keep an eye on our Twitter @BokehPlots or the
mailing list for upcoming blog announcements. Some of the highlights from this
release are:

* New Bokeh Server based on Tornado and websockets
  - highly expanded documentation, with examples and guidance for usage
* User-Defined Models allowing anyone to extend Bokeh
* Significant GIS features and improvements
  - Support for Stamen, OpenStreetMap, and other tile sources
  - GeoJSON data source
  - Patches with holes
* WebGL support for rendering lines
* Python -> JS compilation for CustomJS callbacks (Py3 only for now)
* New general push_notebook() based on Jupyter comms
* Updates to charts, charts examples, and charts docs
* UX improvements
  - configurable and "auto" range bounds
  - wheel zoom scroll capture turned off by default
  - easily set visual styling for highlighting hovered points
  - responsive improvements, maintain plot aspect and auto-resize

Nearly 400 issues and PRs were closed for the release! See the CHANGELOG for 
full
details, and the release notes for known issues and any migration notes.

The next big feature we plan is to dramatically improve our layout options
using PhosporJS, which is also the foundation of the new Jupyter Workbench
project. We also plan to have several, more frequent point releases with
smaller incremental improvements and fixes.

I'd also like to take the opportunity to thank all the Bokeh contributors,
and especially new people who have helped greatly with this release: Havoc
Pennington, Greg Nordin, and Christian Tremblay.

If you are using Anaconda/miniconda, you can install it with conda:

conda install bokeh

Alternatively, you can also install it with pip:

pip install bokeh

Issues, enhancement requests, and pull requests can be made on the Bokeh
Github page: https://github.com/bokeh/bokeh

Full documentation is available at http://bokeh.pydata.org/en/0.11.0

Questions can be directed to the Bokeh mailing list: bo...@continuum.io

Thanks,

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

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


Re: Problem with 'print'

2016-01-09 Thread Chris Angelico
On Sat, Jan 9, 2016 at 10:40 PM, pablo gormi  wrote:
> Hello, recently I downloaded python, but when I try to execute one file
> with the command 'print' it shows me a error. The error is:
>
> Missing parentheses in call to 'print'

The error is telling you what you need to do. Put parentheses around
the call to the print() function. :)

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


Re: Problem with 'print'

2016-01-09 Thread Peter Otten
pablo gormi wrote:

> Hello, recently I downloaded python, but when I try to execute one file
> with the command 'print' it shows me a error. The error is:
> 
> Missing parentheses in call to 'print'
> 
> Please help mThank you.

You have downloaded Python 3 and are using Python 2 syntax. 

Learning Python 3 from a book or tutorial that uses Python 2 is no fun; I 
recommend that you use another book that covers Python 3. 

If the book is mandated by your school download Python 2.7 from python.org 
and work through the examples with that interpreter. 

Both Python 2.7 and 3.x can be installed in parallel on the same machine, 
and you can pick up the differences later.

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


[issue26041] Update deprecation messages of platform.dist() and platform.linux_distribution()

2016-01-09 Thread Kumaripaba Miyurusara Athukorala

Kumaripaba Miyurusara Athukorala added the comment:

Fixed the remaining errors.

--
Added file: http://bugs.python.org/file41551/issue26041.diff

___
Python tracker 

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



[issue18911] minidom does not encode correctly when calling Document.writexml

2016-01-09 Thread Ezio Melotti

Ezio Melotti added the comment:

> On Python 3 you should not only open file in text mode with specified
> encoding, but also specify the "xmlcharrefreplace" error handler.

Isn't this only required in case there are non encodable characters?
If the encoding is utf-8, this shouldn't be necessary (unless there are lone 
surrogates).  Specifying xmlcharrefreplace might be useful while using ascii or 
latin1 though.

The docs of writexml don't seem to specify if the file should be opened in text 
or binary mode but istm that only text mode is supported.  The advice of using 
xmlcharrefreplace could be added in a note.

--
nosy: +ezio.melotti
versions:  -Python 3.4

___
Python tracker 

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



[issue25730] invisible sidebar content with code snippets

2016-01-09 Thread Ezio Melotti

Changes by Ezio Melotti :


--
resolution:  -> duplicate
stage: test needed -> 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



[issue25730] invisible sidebar content with code snippets

2016-01-09 Thread Ezio Melotti

Ezio Melotti added the comment:

This is a duplicate of #24918, which also has a couple of patches that seem to 
fix the problem.

--
superseder:  -> Docs layout bug

___
Python tracker 

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



[issue11440] fix_callable should be dropped from lib2to3 / changed

2016-01-09 Thread SilentGhost

Changes by SilentGhost :


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



[issue26030] Use PEP8 in documentation examples

2016-01-09 Thread Ezio Melotti

Ezio Melotti added the comment:

Without a list of places that don't follow the PEP8, I'm going to close this.

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

___
Python tracker 

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



Re: How to remove item from heap efficiently?

2016-01-09 Thread Sven R. Kunze

Thanks for your reply.

On 08.01.2016 14:26, Peter Otten wrote:

Sven R. Kunze wrote:


Hi everybody,

suppose, I need items sorted by two criteria (say timestamp and
priority). For that purpose, I use two heaps (heapq module):

heapA # items sorted by timestamp
heapB # items sorted by priority

Now my actual problem. When popping an item of heapA (that's the oldest
item), I need to remove the very same item from heapB, regardlessly
where it is in heapB. And vice versa.

Is there a datastructure or a simple trick to achieve that in an
efficient matter?

The heapq docs mention marking as deleted as an alternative to removing.
That is how I do it for now. However, the heap continues to grow which 
needs a periodic clean up.

Another option is to try sorted lists and bisect.

The docs tell me that insertion is not really fast then. :/


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


Problem with 'print'

2016-01-09 Thread pablo gormi
Hello, recently I downloaded python, but when I try to execute one file
with the command 'print' it shows me a error. The error is:

Missing parentheses in call to 'print'

Please help mThank you.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26060] Class __dict__ iteration order changing due to type instance key-sharing

2016-01-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +Mark.Shannon, benjamin.peterson, pingebretson, rhettinger, 
serhiy.storchaka

___
Python tracker 

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



[issue25574] 2.7 incorrectly documents objects hash as equal to id

2016-01-09 Thread Elena Oat

Elena Oat added the comment:

Updated the documentation. Now it says that the hash is derived from id, as it 
says already in Python 3 docs.

--
nosy: +Elena.Oat
Added file: http://bugs.python.org/file41552/issue25574.diff

___
Python tracker 

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



[issue26063] Update copyright in the devguide

2016-01-09 Thread Ezio Melotti

New submission from Ezio Melotti:

The copyright in the devguide needs to be updated for 2016.

--
components: Devguide
messages: 257834
nosy: ezio.melotti, willingc
priority: normal
severity: normal
stage: needs patch
status: open
title: Update copyright in the devguide
type: enhancement

___
Python tracker 

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



[issue26063] Update copyright in the devguide

2016-01-09 Thread Chris Gonzalez

Changes by Chris Gonzalez :


--
keywords: +patch
Added file: http://bugs.python.org/file41555/copyright.diff

___
Python tracker 

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



[issue26060] Class __dict__ iteration order changing due to type instance key-sharing

2016-01-09 Thread Nick Coghlan

New submission from Nick Coghlan:

Dave Beazley found some odd behaviour in Python 3.4.1+, where the order of the 
keys in a class dictionary can be changed by assigning a new value to an 
existing key: https://gist.github.com/dabeaz/617a5b0542d57e003433

Dave's original reproducer showed a case where iterating over class attributes 
replacing some of them with new values worked correctly as a class decorator on 
a normal instance of type, but was unreliable when the same operation was 
called from a metaclass __new__ or __init__ method.

Further investigation showed that it wasn't the timing of the assignment that 
mattered, but rather the use of a subclass of type rather than type itself as 
the metaclass.

Checking between 3.4.0 and 3.4.1 with hg bisect using the simpler attached 
script as the reproducer identified the enabling of key sharing with subclass 
instances in #20637 as the apparent culprit.

My current theory is that from 3.3.0 to 3.4.0, keys weren't being shared 
between instances of type and instances of type subclasses at all, and changing 
that in 3.4.1 broke a subtle assumption somewhere in type_new.

--
files: ns_reordering_bug.py
messages: 257824
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Class __dict__ iteration order changing due to type instance key-sharing
Added file: http://bugs.python.org/file41550/ns_reordering_bug.py

___
Python tracker 

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



[no subject]

2016-01-09 Thread tommy roberts
It will not allow my to run python 3.5.1


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


Re: How to remove item from heap efficiently?

2016-01-09 Thread Sven R. Kunze

Thanks for your suggestion.

On 08.01.2016 14:21, srinivas devaki wrote:

You can create a single heap with primary key as timestamp and
secondary key as priority, i.e by creating a tuple
insert the elements into the heap as
(timestamp, priority)

I think I cannot use that because I need the list sorted by both criteria.

If there is any underlying meaning for creating 2 heaps. please mention.


I use two heaps because I need to insert arbitrary items fast and remove 
the ones fast which are too old (timestamp) or are next in order (priority).


Basically a task scheduler where tasks can be thrown away once they are 
too long in the queue.



On Fri, Jan 8, 2016 at 4:22 AM, Sven R. Kunze  wrote:

Hi everybody,

suppose, I need items sorted by two criteria (say timestamp and priority).
For that purpose, I use two heaps (heapq module):

heapA # items sorted by timestamp
heapB # items sorted by priority

Now my actual problem. When popping an item of heapA (that's the oldest
item), I need to remove the very same item from heapB, regardlessly where it
is in heapB. And vice versa.

Is there a datastructure or a simple trick to achieve that in an efficient
matter?

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


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


[issue24789] ctypes doc string

2016-01-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1753a28acad4 by Ezio Melotti in branch '3.5':
#24789: fix docstring of ctypes.create_string_buffer.  Patch by Matheus Vieira 
Portela.
https://hg.python.org/cpython/rev/1753a28acad4

New changeset 57964ca3ce0f by Ezio Melotti in branch 'default':
#24789: merge with 3.5.
https://hg.python.org/cpython/rev/57964ca3ce0f

--
nosy: +python-dev

___
Python tracker 

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



[issue24786] Changes in the devguide repository are not published online in HTML

2016-01-09 Thread Ezio Melotti

Ezio Melotti added the comment:

This seem to be already fixed, however the copyright needs to be updated again 
(see #26063).

--
nosy: +ezio.melotti
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



Re: graphs

2016-01-09 Thread Sven R. Kunze

Hi Saski,

Python's dataset processing machine is *pandas*.

Have a look at this cookbook entry here:

http://nbviewer.ipython.org/github/jvns/pandas-cookbook/blob/v0.1/cookbook/Chapter%204%20-%20Find%20out%20on%20which%20weekday%20people%20bike%20the%20most%20with%20groupby%20and%20aggregate.ipynb

Best,
Sven


On 07.01.2016 16:36, Saini, Sakshi wrote:

I  have a complex dataset and I wish to write a code to create different graphs 
from it. I was wondering if it is possible for Python/ matplotlib/ seaborn to 
return a cumulative or mean distribution bar graph based on values in your 
dataset?
E.g. I have a certain volume in m3 for each rainfall event in mm, and I wish to 
plot the total volume OR average volume for different rainfall depths; somewhat 
like the following:
[cid:image002.jpg@01D14937.476CB2F0]

Any tips please?



Sakshi Saini, BASc, EIT
Water Resources Project Coordinator | Credit Valley Conservation

The information contained in this Credit Valley Conservation electronic message 
is directed in confidence solely to the person(s) named above and may not be 
otherwise distributed, copied or disclosed including attachments.  The message 
may contain information that is privileged, confidential and exempt from 
disclosure under the Municipal Freedom of Information and Protection and 
Privacy Act and by the Personal Information Protection Electronic Documents 
Act. The use of such personal information except in compliance with the Acts, 
is strictly prohibited. If you have received this message in error, please 
notify the sender immediately advising of the error and delete the message 
without making a copy. Thank you.


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


PyCA cryptography 1.2.1 released

2016-01-09 Thread Paul Kehrer
If one birthday release is good, two is surely better? To test that theory PyCA 
cryptography 1.2.1 has been released. This version, in addition to all the 
changes outlined in the 1.2 release, contains a fix for an issue that caused 
pyOpenSSL to raise an exception in many situations 
(https://cryptography.io/en/latest/changelog/).

-Paul Kehrer (reaperhulk)
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


[issue18911] minidom does not encode correctly when calling Document.writexml

2016-01-09 Thread R. David Murray

Changes by R. David Murray :


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



[issue25677] Syntax error caret confused by indentation

2016-01-09 Thread R. David Murray

Changes by R. David Murray :


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



[issue25730] invisible sidebar content with code snippets

2016-01-09 Thread R. David Murray

Changes by R. David Murray :


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



[issue26067] test_shutil fails when gid name is missing

2016-01-09 Thread Dinesh Wijekoon

Dinesh Wijekoon added the comment:

This reported bug occurred in Mac OS.

--

___
Python tracker 

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



[issue25677] Syntax error caret confused by indentation

2016-01-09 Thread Martin Panter

Martin Panter added the comment:

+script = textwrap.dedent("1 + 1 = 2\n")
You don’t need that first textwrap.dedent() call. It is only useful if the 
string has extra indentation at the start, as in the second multiline one.

--

___
Python tracker 

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



[issue26068] re.compile() repr end quote truncated

2016-01-09 Thread ThiefMaster

ThiefMaster added the comment:

Not eval'ing it, just wondered why the repr looks so weird when printing an 
object containing a compiled regex ;)

--

___
Python tracker 

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



[issue26068] re.compile() repr end quote truncated

2016-01-09 Thread Emanuel Barry

Emanuel Barry added the comment:

Truncating at 200 characters is actually a common occurrence in the C code, 
just barely anyone notice this, as it's not common to need more than 200 
characters for most expressions.

I don't think this needs to be changed at all; the rare case should not affect 
the common ones. If eval()'ing your repr fails, you can always access the full 
regex from `exp.pattern` - which doesn't truncate at 200 characters :)

--
nosy: +ebarry

___
Python tracker 

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



[issue26068] re.compile() repr end quote truncated

2016-01-09 Thread ThiefMaster

ThiefMaster added the comment:

Would it be possible to preserve the quotes even in case of truncation?

--

___
Python tracker 

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



[issue26068] re.compile() repr end quote truncated

2016-01-09 Thread Guido van Rossum

Guido van Rossum added the comment:

Yes, the C code pretty much always uses %., in order to
protect itself from buffer overflows. Pulling off an unabbreviated str()
here would be a major piece of work.

--

___
Python tracker 

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



[issue26030] Use PEP8 in documentation examples

2016-01-09 Thread Berker Peksag

Changes by Berker Peksag :


--
stage: needs patch -> resolved

___
Python tracker 

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



[issue26060] Class __dict__ iteration order changing due to type instance key-sharing

2016-01-09 Thread Yury Selivanov

Changes by Yury Selivanov :


--
nosy: +yselivanov

___
Python tracker 

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



Python 3.4.4 Install

2016-01-09 Thread Colin J. Williams
The reponse is not understood.

*** Python 3.4.4rc1 (v3.4.4rc1:04f3f725896c, Dec  6 2015, 17:06:10) [MSC v.1600 
64 bit (AMD64)] on win32. ***
>>>   File "C:\Users\Adm\AppData\Roaming\PyScripter\python_init.py", line 1
Öü:Vt‡Ö{ZðN)’ƒ2%hóýL"®ÁwÇ,”¿ƾJ
 ^
SyntaxError: invalid syntax
  File "C:\Users\Adm\AppData\Roaming\PyScripter\pyscripter_init.py", line 1
Öü:Vt‡Ö{ZðN)’t—œ2¢í.Tûôø«ÄØ´Õ7l‰ˆ(°¢äßÅ
 ^
SyntaxError: invalid syntax

Help!

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


Re: Python launcher options

2016-01-09 Thread Tim Golden

On 06/01/2016 00:48, Edward Diener wrote:

The Python launcher in Windows is a neat tool for running multiple
versions of Python 2 and Python 3 at different times. It allows as
options the ability to specify the latest version of either Python 2 or
Python 3 defaulting to the 64-bit version if both exist, or a specific
32-bit or 64-bit version of Python 2 or Python 3. What is missing is the
ability to specify the latest 32-bit version of Python 2 or Python 3.
The equivalent syntax would be '-2-32' or '-3-32'. Is there some reason
why this option has been disallowed ?


As far as I can remember, it's not so much a question of "disallowed" as 
just "not thought of by anyone". If you wanted this to go anywhere, 
could I suggest you create an issue on the Python issue tracker:


  http://bugs.python.org

and mark it as "Windows" in the [Components] field (that makes sure that 
some relevant people get to see it). It's got a much better chance of 
achieving traction if you can actually provide a code patch to implement 
the behaviour. Failing that, at least make a good case which might 
convince one of the developers that it would it be worth their while 
implementing the change.


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


[issue25486] Resurrect inspect.getargspec() in 3.6

2016-01-09 Thread Berker Peksag

Berker Peksag added the comment:

Perhaps we can also add it back in 3.5.2 since 3.5 is in early stages of its 
maintenance period?

--
nosy: +berker.peksag

___
Python tracker 

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



[issue25486] Resurrect inspect.getargspec() in 3.6

2016-01-09 Thread Stefan Krah

Stefan Krah added the comment:

+1 for adding it to 3.5.2.

--

___
Python tracker 

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



[issue26062] IPython4 bash magic ! with {} does not work with Python 3.5.1

2016-01-09 Thread SilentGhost

SilentGhost added the comment:

> It seems to me, that this change in python is not nessesary.

> I don't, know how to find the commit, message who has changed this and why.

It was done in issue 13598. It's a bit puzzling that IPython decided to depend 
on behaviour of a private method. I'd suggest you take it up with them.

--
nosy: +SilentGhost

___
Python tracker 

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



[issue26065] python embedded 3.5 amd64 crash when using venv

2016-01-09 Thread Laurent Dufrechou

New submission from Laurent Dufrechou:

Install python-3.5.1-embed-amd64 to c:\dev\python-3.5.1-embed-amd64
Open terminal window:
cd c:\dev\python-3.5.1-embed-amd64
python -m venv c:\dev\myenv

-> crash
Error: Command '['C:\\dev\\myenv\\Scripts\\python.exe', '-Im', 'ensurepip', 
'--upgrade', '--default-pip']' returned non-zero exit status 3221226505

Using debugger (VS2015) shows error:
Exception non gérée à 0x7FFDA1D05A4E (ucrtbase.dll) dans python.exe 
And stopping debugger leave this log:
C:\dev\python-3.5.1-embed-amd64>python -m venv C:\dev\python35_x64_rtquickreport
Traceback (most recent call last):
  File "runpy.py", line 170, in _run_module_as_main
  File "runpy.py", line 85, in _run_code
  File "venv\__main__.py", line 6, in 
  File "venv\__init__.py", line 442, in main
  File "venv\__init__.py", line 85, in create
  File "venv\__init__.py", line 257, in _setup_pip
  File "subprocess.py", line 629, in check_output
  File "subprocess.py", line 698, in run
  File "subprocess.py", line 1055, in communicate
KeyboardInterrupt

--
components: Windows
messages: 257855
nosy: Laurent Dufrechou, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: python embedded 3.5 amd64 crash when using venv
type: crash
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



[issue26068] re.compile() repr end quote truncated

2016-01-09 Thread Guido van Rossum

Guido van Rossum added the comment:

It's simply the effect of the "%.200R" format here:
https://hg.python.org/cpython/file/default/Modules/_sre.c#l1417

I recommend not bothering to fix this: it would just be more code, and to what 
end?

--
nosy: +gvanrossum

___
Python tracker 

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



[issue24823] ctypes.create_string_buffer does not add NUL if len(init) == size

2016-01-09 Thread Krista Paasonen

Krista Paasonen added the comment:

Patch containing checking for buffer size, so that NULL value is the last byte 
as C standard specifies. Raises ValueError exception if initial value does not 
fit into to the buffer with NULL char.

This should decrease the possibility of creating security issues.

--
keywords: +patch
nosy: +krista
Added file: http://bugs.python.org/file41558/create_string_buffer.patch

___
Python tracker 

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



[issue25677] Syntax error caret confused by indentation

2016-01-09 Thread Michael Layzell

Michael Layzell added the comment:

Oops. Should be fixed now.

--
Added file: http://bugs.python.org/file41559/cpython25677.patch

___
Python tracker 

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



[issue26068] re.compile() repr end quote truncated

2016-01-09 Thread Guido van Rossum

Guido van Rossum added the comment:

That would be an interesting exercise. You'd have to patch
PyUnicode_FromFormat(). It would be nice to have this. It should probably
also insert some dots (the universal sign to indicate that something was
truncated).

--

___
Python tracker 

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



Re: licenses

2016-01-09 Thread Ben Finney
"Martinez, Jorge Alberto (GE Aviation)" 
writes:

> We develop applications here with Python and I want to know if there's
> issues by using. We use NumPy, PyDaqMx, Py Visa

Those are all free software: meaning, every recipient has freedom to
execute, modify, and/or redistribute the work. So long as the code base
you derive from them is also free software, you will not need to take
special care.

If you intend to make a proprietary work (restricting the freedom of
recipients further), you should consult your lawyer about how to go
about that legally.

> How can we cover this licensing?

The simplest way – no need to get lawyers involved – to comply is to
grant a free-software license (e.g. GNU GPL) to all recipients of your
work.

When you want to derive from an existing work but restrict freedom of
your recipients, that's when you need to pay a lawyer for advice. So I
advise you don't make such a restrictive work.

-- 
 \  “The way to build large Python applications is to componentize |
  `\ and loosely-couple the hell out of everything.” —Aahz |
_o__)  |
Ben Finney

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


[issue26063] Update copyright in the devguide

2016-01-09 Thread Berker Peksag

Berker Peksag added the comment:

I'd prefer a more general solution similar to the one has been used in 
Doc/conf.py

copyright = u'1990-%s, Python Software Foundation' % time.strftime('%Y')

--
nosy: +berker.peksag

___
Python tracker 

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



Re: Understanding how to quote XML string in order to serialize using Python's ElementTree

2016-01-09 Thread Karim



On 09/01/2016 21:54, kbtyo wrote:

My specs:

Python 3.4.3
Windows 7
IDE is Jupyter Notebooks

What I have referenced:

1) 
http://stackoverflow.com/questions/1546717/python-escaping-strings-for-use-in-xml

2)
http://stackoverflow.com/questions/7802418/how-to-properly-escape-single-and-double-quotes

3)http://stackoverflow.com/questions/4972210/escaping-characters-in-a-xml-file-with-python


Here is the data (in CSV format) and script, respectively, (I have tried 
variations on serializing Column 'E' using both Sax and ElementTree):

i)

A,B,C,D,E,F,G,H,I,J
"3","8","1","2312285SChecking10","',0001,0070,","1967-12-25 22:18:13.471000","2005-12-25 22:18:13.768000","2","70","0"

ii)

#!/usr/bin/python
# -*-  coding: utf-8 -*-
import os.path
import sys
import csv
from io import StringIO
import xml.etree.cElementTree as ElementTree
from xml.etree.ElementTree import XMLParser
import xml
import xml.sax
from xml.sax import ContentHandler

class MyHandler(xml.sax.handler.ContentHandler):
 def __init__(self):
 self._charBuffer = []
 self._result = []

 def _getCharacterData(self):
 data = ''.join(self._charBuffer).strip()
 self._charBuffer = []
 return data.strip() #remove strip() if whitespace is important

 def parse(self, f):
 xml.sax.parse(f, self)
 return self._result
 


 def characters(self, data):
 self._charBuffer.append(data)

 def startElement(self, name, attrs):
 if name == 'Response':
 self._result.append({})

 def endElement(self, name):
 if not name == 'Response': self._result[-1][name] = 
self._getCharacterData()

def read_data(path):
 with open(path, 'rU', encoding='utf-8') as data:
 reader = csv.DictReader(data, delimiter =',', quotechar="'", 
skipinitialspace=True)
 for row in reader:
 yield row

if __name__ == "__main__":
 empty = ''
 Response = 'sample.csv'
 for idx, row in enumerate(read_data(Response)):
 if idx > 10: break
 data = row['E']
 print(data) # The before
 data = data[1:-1]
 data = ""'{}'"".format(data)
 print(data) # Sanity check
# data = '',0001,0070,'
 try:
 root = ElementTree.XML(data)
# print(root)
 except StopIteration:
 raise
 pass
# xmlstring = StringIO(data)
# print(xmlstring)
# Handler = MyHandler().parse(xmlstring)


Specifically, due to the quoting in the CSV file (which is beyond my control), 
I have had to resort to slicing the string (line 51) and then formatting it 
(line 52).

However the print out from the above attempt is as follows:

"'


   File "", line unknown
ParseError: no element found: line 1, column 69
Interestingly - if I assign the variable "data" (as in line 54) I receive this:

   File "", line 56
data = '',0001,0070,'
  ^
SyntaxError: invalid token

I seek feedback and information on how to address utilizing the most Pythonic 
means to do so. Ideally, is there a method that can leverage ElementTree. Thank 
you, in advance, for your feedback and guidance.


In  fact to get rid of double quote simply create your csv reader like that:

reader = csv.DictReader(data, dialect='excel', skipinitialspace=True)

You should then don't need to slice data variable and reformat it.

Karim


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


[issue26065] python embedded 3.5 amd64 crash when using venv

2016-01-09 Thread Steve Dower

Steve Dower added the comment:

I can't read those error messages, but I suspect this is because some of the 
bundled files are omitted from the embeddable package.

Using it to run venv isn't really part of the intended use cases - it's 
expected you'll manually install packages alongside it with your own installer. 
If that doesn't sound suitable for what you're trying to do, you should use the 
installers to install Python.

--

___
Python tracker 

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



[issue26060] Class __dict__ iteration order changing due to type instance key-sharing

2016-01-09 Thread Ionel Cristian Mărieș

Changes by Ionel Cristian Mărieș :


--
nosy: +ionelmc

___
Python tracker 

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



[issue17633] zipimport's handling of namespace packages is incorrect

2016-01-09 Thread Mike Romberg

Mike Romberg added the comment:

This patch modifies issue17633-hg.diff by adding changes suggested by the 
reviewers.

  Note.  I did cleanup the use of __import__ outside of the area involved with 
issue17633 as it seemed low risk.  The tests for issue17633 (and the refactored 
doTest/makeZip now use addCleanup().  However there are still tests in the 
module that use the old try/finally way of cleanup.  I did not modify these in 
order to keep this from being a rewrite of test_zipimport.

  But if more changes are desired, I'll add them.

--
Added file: http://bugs.python.org/file41557/issue17633-hg-2.patch

___
Python tracker 

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



[issue25170] 3.5.0 documentation archives missing

2016-01-09 Thread R. David Murray

Changes by R. David Murray :


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



[issue26066] Language on the "Cryptographic Services" is out of date

2016-01-09 Thread Alex Gaynor

New submission from Alex Gaynor:

https://docs.python.org/2/library/crypto.html
https://docs.python.org/3/library/crypto.html

This language has a number of issues:
- Crypto isn't just for "Hardcore cypherpunks" anymore, it's a necessary 
component of a great many software projects
- PyCrypto isn't maintained by A.M. Kuchling any longer
- (IMO) it's no longer the recommended library for cryptography in Python
- The page should probably also point people towards the ssl module.

--
assignee: docs@python
components: Documentation
messages: 257857
nosy: alex, docs@python
priority: normal
severity: normal
status: open
title: Language on the "Cryptographic Services" is out of date
versions: Python 2.7, 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



[issue26066] Language on the "Cryptographic Services" documentation page is out of date

2016-01-09 Thread Alex Gaynor

Changes by Alex Gaynor :


--
title: Language on the "Cryptographic Services" is out of date -> Language on 
the "Cryptographic Services" documentation page is out of date

___
Python tracker 

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



Understanding how to quote XML string in order to serialize using Python's ElementTree

2016-01-09 Thread kbtyo
My specs:

Python 3.4.3
Windows 7
IDE is Jupyter Notebooks

What I have referenced:

1) 
http://stackoverflow.com/questions/1546717/python-escaping-strings-for-use-in-xml

2)
http://stackoverflow.com/questions/7802418/how-to-properly-escape-single-and-double-quotes

3)http://stackoverflow.com/questions/4972210/escaping-characters-in-a-xml-file-with-python


Here is the data (in CSV format) and script, respectively, (I have tried 
variations on serializing Column 'E' using both Sax and ElementTree):

i)

A,B,C,D,E,F,G,H,I,J
"3","8","1","2312285SChecking10","',0001,0070,","1967-12-25
 22:18:13.471000","2005-12-25 22:18:13.768000","2","70","0"

ii)

#!/usr/bin/python
# -*-  coding: utf-8 -*-
import os.path
import sys
import csv
from io import StringIO 
import xml.etree.cElementTree as ElementTree
from xml.etree.ElementTree import XMLParser
import xml
import xml.sax
from xml.sax import ContentHandler

class MyHandler(xml.sax.handler.ContentHandler):
def __init__(self):
self._charBuffer = []
self._result = []

def _getCharacterData(self):
data = ''.join(self._charBuffer).strip()
self._charBuffer = []
return data.strip() #remove strip() if whitespace is important

def parse(self, f):
xml.sax.parse(f, self)
return self._result


def characters(self, data):
self._charBuffer.append(data)

def startElement(self, name, attrs):
if name == 'Response':
self._result.append({})

def endElement(self, name):
if not name == 'Response': self._result[-1][name] = 
self._getCharacterData()

def read_data(path):
with open(path, 'rU', encoding='utf-8') as data:
reader = csv.DictReader(data, delimiter =',', quotechar="'", 
skipinitialspace=True)
for row in reader:
yield row

if __name__ == "__main__":
empty = ''
Response = 'sample.csv'
for idx, row in enumerate(read_data(Response)):
if idx > 10: break
data = row['E']
print(data) # The before
data = data[1:-1]
data = ""'{}'"".format(data)
print(data) # Sanity check 
# data = '',0001,0070,'
try:
root = ElementTree.XML(data)
# print(root)
except StopIteration:
raise
pass
# xmlstring = StringIO(data)
# print(xmlstring)
# Handler = MyHandler().parse(xmlstring)


Specifically, due to the quoting in the CSV file (which is beyond my control), 
I have had to resort to slicing the string (line 51) and then formatting it 
(line 52).

However the print out from the above attempt is as follows:

"'


  File "", line unknown
ParseError: no element found: line 1, column 69
Interestingly - if I assign the variable "data" (as in line 54) I receive this:

  File "", line 56
data = '',0001,0070,'
 ^
SyntaxError: invalid token

I seek feedback and information on how to address utilizing the most Pythonic 
means to do so. Ideally, is there a method that can leverage ElementTree. Thank 
you, in advance, for your feedback and guidance.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26067] test_shutil fails when gid name is missing

2016-01-09 Thread Dinesh Wijekoon

New submission from Dinesh Wijekoon:

./python.exe -m test -j3 -v test_shutil

The above test fails when id name is missing. The fail message is 
group = grp.getgrgid(gid)[0]
KeyError: 'getgrgid(): gid not found: 203135016'

Following is the results from console "id" command, when the failure happens. 

uid=1336551206(athukora) gid=203135016 
groups=203135016,402(com.apple.sharepoint.group.2),12(everyone),62(netaccounts),80(admin),401(com.apple.sharepoint.group.1),33(_appstore),98(_lpadmin),100(_lpoperator),204(_developer),398(com.apple.access_screensharing),399(com.apple.access_ssh)

And again when I change user to sudo the "id" command returns the following and 
test get passed.
uid=0(root) gid=0(wheel) 
groups=0(wheel),1(daemon),2(kmem),3(sys),4(tty),5(operator),8(procview),9(procmod),12(everyone),20(staff),29(certusers),61(localaccounts),80(admin),401(com.apple.sharepoint.group.1),402(com.apple.sharepoint.group.2),33(_appstore),98(_lpadmin),100(_lpoperator),204(_developer),398(com.apple.access_screensharing),399(com.apple.access_ssh)

PS:

We tried to debug this a bit and found the bug is possibly in 
Modules/grpmodule.c, may be at method grp_getgrall_impl. Adding 
"PyString_AsString(v);" before if command " PyList_Append(d, v) != 0" will fix 
the issue in test. But we have no idea how its working with this change.

--
components: Extension Modules
messages: 257858
nosy: Dinesh Wijekoon, ezio.melotti
priority: normal
severity: normal
status: open
title: test_shutil fails when gid name is missing
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



[issue26068] re.compile() repr end quote truncated

2016-01-09 Thread ThiefMaster

New submission from ThiefMaster:

```
Python 3.4.3 (default, Jan  5 2016, 23:13:10)
[GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> for n in range(198, 201):
... print(re.compile('x' * n))
...
re.compile('xx')
re.compile('xxx)
re.compile('xxx)
```

The closing quote in the repr goes away once the regex exceeds a certain 
length. This smells like an off-by-one somewhere that results in the last 
character to be lost. In any case, it's pretty ugly since the repr clearly 
pretends to be executable Python code, which is not the case anymore with this 
quote missing.

--
components: Regular Expressions
messages: 257860
nosy: ThiefMaster, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: re.compile() repr end quote truncated
versions: Python 3.4

___
Python tracker 

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



[issue26068] re.compile() repr end quote truncated

2016-01-09 Thread ThiefMaster

ThiefMaster added the comment:

I think it's pretty ugly to have a repr that is valid python code in most cases 
and suddenly stops being so.

The repr of a string is not truncated, so why truncate it in a pattern object?

With the truncation, why not use a repr style that's clearly not executable to 
recreate the original object, e.g. ``

--

___
Python tracker 

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



[issue26068] re.compile() repr end quote truncated

2016-01-09 Thread Matthew Barnett

Matthew Barnett added the comment:

I'm going to have to agree with ThiefMaster. String literals don't truncate 
like that, nor do lists, nor tuples.

Are there any similar cases of truncation elsewhere in the standard library?

--

___
Python tracker 

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



Re: Understanding how to quote XML string in order to serialize using Python's ElementTree

2016-01-09 Thread Karim



On 09/01/2016 21:54, kbtyo wrote:

My specs:

Python 3.4.3
Windows 7
IDE is Jupyter Notebooks

What I have referenced:

1) 
http://stackoverflow.com/questions/1546717/python-escaping-strings-for-use-in-xml

2)
http://stackoverflow.com/questions/7802418/how-to-properly-escape-single-and-double-quotes

3)http://stackoverflow.com/questions/4972210/escaping-characters-in-a-xml-file-with-python


Here is the data (in CSV format) and script, respectively, (I have tried 
variations on serializing Column 'E' using both Sax and ElementTree):

i)

A,B,C,D,E,F,G,H,I,J
"3","8","1","2312285SChecking10","',0001,0070,","1967-12-25 22:18:13.471000","2005-12-25 22:18:13.768000","2","70","0"

ii)

#!/usr/bin/python
# -*-  coding: utf-8 -*-
import os.path
import sys
import csv
from io import StringIO
import xml.etree.cElementTree as ElementTree
from xml.etree.ElementTree import XMLParser
import xml
import xml.sax
from xml.sax import ContentHandler

class MyHandler(xml.sax.handler.ContentHandler):
 def __init__(self):
 self._charBuffer = []
 self._result = []

 def _getCharacterData(self):
 data = ''.join(self._charBuffer).strip()
 self._charBuffer = []
 return data.strip() #remove strip() if whitespace is important

 def parse(self, f):
 xml.sax.parse(f, self)
 return self._result
 


 def characters(self, data):
 self._charBuffer.append(data)

 def startElement(self, name, attrs):
 if name == 'Response':
 self._result.append({})

 def endElement(self, name):
 if not name == 'Response': self._result[-1][name] = 
self._getCharacterData()

def read_data(path):
 with open(path, 'rU', encoding='utf-8') as data:
 reader = csv.DictReader(data, delimiter =',', quotechar="'", 
skipinitialspace=True)
 for row in reader:
 yield row

if __name__ == "__main__":
 empty = ''
 Response = 'sample.csv'
 for idx, row in enumerate(read_data(Response)):
 if idx > 10: break
 data = row['E']
 print(data) # The before
 data = data[1:-1]
 data = ""'{}'"".format(data)
 print(data) # Sanity check
# data = '',0001,0070,'
 try:
 root = ElementTree.XML(data)
# print(root)
 except StopIteration:
 raise
 pass
# xmlstring = StringIO(data)
# print(xmlstring)
# Handler = MyHandler().parse(xmlstring)


Specifically, due to the quoting in the CSV file (which is beyond my control), 
I have had to resort to slicing the string (line 51) and then formatting it 
(line 52).

However the print out from the above attempt is as follows:

"'


   File "", line unknown
ParseError: no element found: line 1, column 69
Interestingly - if I assign the variable "data" (as in line 54) I receive this:

   File "", line 56
data = '',0001,0070,'
  ^
SyntaxError: invalid token

I seek feedback and information on how to address utilizing the most Pythonic 
means to do so. Ideally, is there a method that can leverage ElementTree. Thank 
you, in advance, for your feedback and guidance.


I don't understand because this line 54 gives:

>>> import xml.etree.cElementTree as ElementTree
>>> data = 'RequestType="HoldInquiry">',0001,0070,'

  File "", line 1
data = 'RequestType="HoldInquiry">',0001,0070,'

^
SyntaxError: invalid syntax


BUT IF you correct the string and remove the inner quote after  
everything's fine:
>>> data = 'RequestType="HoldInquiry">,0001,0070, 
'

>>> root = ElementTree.XML(data)
>>> root

Karim

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


[issue26063] Update copyright in the devguide

2016-01-09 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

+1

--
nosy: +matrixise

___
Python tracker 

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



[issue26062] IPython4 bash magic ! with {} does not work with Python 3.5.1

2016-01-09 Thread Emanuel Barry

Emanuel Barry added the comment:

The choice of IPython to depend on a private, undocumented method means that 
they are subject to such bugs. A quick Google search tells me you should 
probably report the issue here: https://github.com/ipython/ipython/issues

--
nosy: +ebarry
status: open -> closed

___
Python tracker 

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



[issue26062] IPython4 bash magic ! with {} does not work with Python 3.5.1

2016-01-09 Thread Christoph Böddeker

Christoph Böddeker added the comment:

ok, thanks, I have opend there an issue 
https://github.com/ipython/ipython/issues/9120

--

___
Python tracker 

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



[issue25486] Resurrect inspect.getargspec() in 3.6

2016-01-09 Thread Stefan Krah

Stefan Krah added the comment:

Could this be done soon? I ran into this just now:

Traceback (most recent call last):
  File "", line 1, in 
  File 
"/home/stefan/usr/lib/python3.6/site-packages/datashape-0.4.7-py3.6.egg/datashape/__init__.py",
 line 7, in 
from .user import *
  File 
"/home/stefan/usr/lib/python3.6/site-packages/datashape-0.4.7-py3.6.egg/datashape/user.py",
 line 16, in 
@dispatch(np.dtype, basetypes)
  File 
"/home/stefan/usr/lib/python3.6/site-packages/multipledispatch-0.4.8-py3.6.egg/multipledispatch/core.py",
 line 60, in _
if ismethod(func):
  File 
"/home/stefan/usr/lib/python3.6/site-packages/multipledispatch-0.4.8-py3.6.egg/multipledispatch/core.py",
 line 79, in ismethod
spec = inspect.getargspec(func)
AttributeError: module 'inspect' has no attribute 'getargspec'

--
nosy: +rhettinger, skrah
priority: normal -> release blocker

___
Python tracker 

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



[issue25486] Resurrect inspect.getargspec() in 3.6

2016-01-09 Thread Yury Selivanov

Yury Selivanov added the comment:

> Perhaps we can also add it back in 3.5.2 since 3.5 is in early stages of its 
> maintenance period?

> +1 for adding it to 3.5.2.

I was never removed from 3.5

Python 3.5.1 (default, Dec 13 2015, 16:05:52)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import inspect
>>> inspect.getargspec


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



[issue26060] Class __dict__ iteration order changing due to type instance key-sharing

2016-01-09 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue26060] Class __dict__ iteration order changing due to type instance key-sharing

2016-01-09 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +beazley

___
Python tracker 

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



[issue26058] Add dict.__version__ read-only property

2016-01-09 Thread Brett Cannon

Brett Cannon added the comment:

A better way to benchmark this is to run hg.python.org/benchmarks with a 
patched interpreter and see if that shows any performance impact.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue26064] directory is getting separated

2016-01-09 Thread SilentGhost

SilentGhost added the comment:

It behaves exactly as described in documentation, the only thing I could 
suggest is to re-read the following for details: 
https://docs.python.org/3/library/os.path.html#os.path.split

--
nosy: +SilentGhost
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue26030] Use PEP8 in documentation examples

2016-01-09 Thread Julien

Julien added the comment:

I opened this ticket mainly to know the opinions on those modifications, I'll 
slowly review what I see, and provide little patches from time to time, only 
when the PEP8 infringement look obvious.

I think the most obvious PEP8 infringement ARE to be fixed, typically in the 
tutorial: The documentation is where people learn, let's teach them the right 
thing to do :-)

Thanks to naoki I just learnt that no spaces around binary operators are OK  
when it enhance the readability 
(https://www.python.org/dev/peps/pep-0008/#other-recommendations) like 2*2 + 
3*2.

I close this ticket, I'll just mention if I propose a patch in a new one.

Bests.

--
status: pending -> closed

___
Python tracker 

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



Re: How to remove item from heap efficiently?

2016-01-09 Thread Paul Rubin
"Sven R. Kunze"  writes:
> Basically a task scheduler where tasks can be thrown away once they
> are too long in the queue.

I don't think there's a real nice way to do this with heapq.  The
computer-sciencey way would involve separate balanced tree structures
for the two sorting keys (think of a database table with indexes on two
different columns).

You could look up "timing wheels" for a simpler practical approach that
the Linux kernel scheduler used to use (I think it changed a few years
ago).
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: licenses

2016-01-09 Thread Tim Golden

On 08/01/2016 19:41, Martinez, Jorge Alberto (GE Aviation) wrote:

Hello
We develop applications here with Python and I want to know if there's issues 
by using.
We use NumPy, PyDaqMx, Py Visa

How can we cover this licensing?


[copying the answer I've just given over at webmaster@]

I'm not sure we're best placed to answer that, Jorge.

You can see current details for the Python licensing here:

https://docs.python.org/3.6/license.html

The other packages you mention are third-party and you'll have to 
consult their websites / source code for licence details.


TJG

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


[issue26029] Broken sentence in extending documentation

2016-01-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3f9b9244488d by Terry Jan Reedy in branch '3.5':
Issue #26029: Finish correction.
https://hg.python.org/cpython/rev/3f9b9244488d

--

___
Python tracker 

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



[issue26062] IPython4 bash magic ! with {} does not work with Python 3.5.1

2016-01-09 Thread Brett Cannon

Brett Cannon added the comment:

Python itself has nothing to do with IPython's shell commands (i.e., !). It 
would be best to report this bug to IPython to have them fix it on their end.

--
nosy: +brett.cannon
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



Re: [issue26045] Improve error message for http.client when posting unicode string

2016-01-09 Thread Random832
Guido van Rossum  writes:
> UnicodeEncodeError: 'ascii' codec can't encode character '\u1234' in
^  ^
>   position 3: Header ('ሴ') is not valid Latin-1. Use
^ ^^^
>   header.encode('utf-8') if you want to send it encoded in UTF-8.

Er...

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



[issue26064] directory is getting separated

2016-01-09 Thread Sagar Kar

New submission from Sagar Kar:

In [108]: os.mkdir('newdir') # make new dir
In [140]: p = os.path.abspath('newdir')

In [141]: p
Out[141]: 
'/media/sagarkar10/sdrive/programing/python/SciPy/scipy-notebook/newdir'

## here 'newdir' is also a directory with a file inside

In [143]: os.path.dirname(p)
Out[143]: '/media/sagarkar10/sdrive/programing/python/SciPy/scipy-notebook'

## but os.path.dirname() dont show it under directory it treats as if its a 
file and till the last '/' is the directory
and also 

In [145]: os.path.basename(p)
Out[145]: 'newdir'

## basename shows it

--
components: Extension Modules
messages: 257849
nosy: sagarkar10
priority: normal
severity: normal
status: open
title: directory is getting separated
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue26062] IPython4 bash magic ! with {} does not work with Python 3.5.1

2016-01-09 Thread Christoph Böddeker

Christoph Böddeker added the comment:

That's true. Now I have finde the reason.

Someone has changed a function in lib/python3.5/string.py : _vformat.
This function returns now a tuple (befor it was only one return value).

IPython inherits from this object in 
lib/python3.5/site-packages/IPython/utils/text.py
Because of this change the IPython code is not working.

It seems to me, that this change in python is not nessesary.

I don't, know how to find the commit, message who has changed this and why.



Python 3.5.0:
def _vformat( ..., auto_arg_index=0):
...
format_spec = self._vformat( ..., auto_arg_index=auto_arg_index)
...
return ''.join(result)

Python 3.5.1:
def _vformat( ..., auto_arg_index=0):
...
format_spec, auto_arg_index = self._vformat( ..., 
auto_arg_index=auto_arg_index)
...
return ''.join(result), auto_arg_index

--
status: closed -> open

___
Python tracker 

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



[issue26058] Add dict.__version__ read-only property

2016-01-09 Thread STINNER Victor

STINNER Victor added the comment:

Brett:
> A better way to benchmark this is to run hg.python.org/benchmarks with a 
> patched interpreter and see if that shows any performance impact.

Ok. Here is the output. Can you please explain me the result? :-) Especially 
the "significant" value.


$ ./python.orig ../benchmarks/perf.py ./python.orig ./python.patched

INFO:root:Automatically selected timer: perf_counter
INFO:root:Running `./python.patched ../benchmarks/lib3/2to3/2to3 -f all 
../benchmarks/lib/2to3`
INFO:root:Running `./python.patched ../benchmarks/lib3/2to3/2to3 -f all 
../benchmarks/lib/2to3` 1 time
INFO:root:Running `./python.orig ../benchmarks/lib3/2to3/2to3 -f all 
../benchmarks/lib/2to3`
INFO:root:Running `./python.orig ../benchmarks/lib3/2to3/2to3 -f all 
../benchmarks/lib/2to3` 1 time
INFO:root:Running `./python.patched 
../benchmarks/performance/bm_chameleon_v2.py -n 50 --timer perf_counter`
INFO:root:Running `./python.orig ../benchmarks/performance/bm_chameleon_v2.py 
-n 50 --timer perf_counter`
INFO:root:Running `./python.patched ../benchmarks/performance/bm_django_v3.py 
-n 50 --timer perf_counter`
INFO:root:Running `./python.orig ../benchmarks/performance/bm_django_v3.py -n 
50 --timer perf_counter`
INFO:root:Running `./python.patched ../benchmarks/performance/bm_pickle.py -n 
50 --timer perf_counter --use_cpickle pickle`
INFO:root:Running `./python.orig ../benchmarks/performance/bm_pickle.py -n 50 
--timer perf_counter --use_cpickle pickle`
INFO:root:Running `./python.patched ../benchmarks/performance/bm_pickle.py -n 
50 --timer perf_counter --use_cpickle unpickle`
INFO:root:Running `./python.orig ../benchmarks/performance/bm_pickle.py -n 50 
--timer perf_counter --use_cpickle unpickle`
INFO:root:Running `./python.patched ../benchmarks/performance/bm_json_v2.py -n 
50 --timer perf_counter`
INFO:root:Running `./python.orig ../benchmarks/performance/bm_json_v2.py -n 50 
--timer perf_counter`
INFO:root:Running `./python.patched ../benchmarks/performance/bm_json.py -n 50 
--timer perf_counter json_load`
INFO:root:Running `./python.orig ../benchmarks/performance/bm_json.py -n 50 
--timer perf_counter json_load`
INFO:root:Running `./python.patched ../benchmarks/performance/bm_nbody.py -n 50 
--timer perf_counter`
INFO:root:Running `./python.orig ../benchmarks/performance/bm_nbody.py -n 50 
--timer perf_counter`
INFO:root:Running `./python.patched ../benchmarks/performance/bm_regex_v8.py -n 
50 --timer perf_counter`
INFO:root:Running `./python.orig ../benchmarks/performance/bm_regex_v8.py -n 50 
--timer perf_counter`
INFO:root:Running `./python.patched 
../benchmarks/performance/bm_tornado_http.py -n 100 --timer perf_counter`
INFO:root:Running `./python.orig ../benchmarks/performance/bm_tornado_http.py 
-n 100 --timer perf_counter`
[ 1/10] 2to3...
[ 2/10] chameleon_v2...
[ 3/10] django_v3...
[ 4/10] fastpickle...
[ 5/10] fastunpickle...
[ 6/10] json_dump_v2...
[ 7/10] json_load...
[ 8/10] nbody...
[ 9/10] regex_v8...
[10/10] tornado_http...

Report on Linux smithers 4.2.8-300.fc23.x86_64 #1 SMP Tue Dec 15 16:49:06 UTC 
2015 x86_64 x86_64
Total CPU cores: 8

### 2to3 ###
6.825440 -> 6.996616: 1.03x slower

### fastpickle ###
Min: 0.449710 -> 0.458054: 1.02x slower
Avg: 0.451589 -> 0.583100: 1.29x slower
Significant (t=-8.04)
Stddev: 0.00076 -> 0.11568: 152.3886x larger

### fastunpickle ###
Min: 0.549672 -> 0.545734: 1.01x faster
Avg: 0.551284 -> 0.696920: 1.26x slower
Significant (t=-6.65)
Stddev: 0.00118 -> 0.15493: 130.9694x larger

### json_load ###
Min: 0.432500 -> 0.466602: 1.08x slower
Avg: 0.433771 -> 0.471205: 1.09x slower
Significant (t=-10.63)
Stddev: 0.00495 -> 0.02440: 4.9303x larger

### nbody ###
Min: 0.230055 -> 0.234925: 1.02x slower
Avg: 0.230985 -> 0.236441: 1.02x slower
Significant (t=-7.56)
Stddev: 0.00048 -> 0.00508: 10.5095x larger

The following not significant results are hidden, use -v to show them:
chameleon_v2, django_v3, json_dump_v2, regex_v8, tornado_http.

--
versions: +Python 2.7 -Python 3.6

___
Python tracker 

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



Re: Python 3.4.4 Install

2016-01-09 Thread Terry Reedy

On 1/9/2016 5:25 PM, Colin J. Williams wrote:

The reponse is not understood.


What part of 'SyntaxError: invalid syntax' do you not understand?


*** Python 3.4.4rc1 (v3.4.4rc1:04f3f725896c, Dec  6 2015, 17:06:10) [MSC v.1600 
64 bit (AMD64)] on win32. ***


Consider replacing with 3.4.4, though not essential.


File "C:\Users\Adm\AppData\Roaming\PyScripter\python_init.py", line 1


This issue seems to be about PyScriptor, not 3.4.


 Öü:Vt‡Ö{ZðN)’ƒ2%hóýL"®ÁwÇ,”¿ƾJ
  ^


This is obviously gibberish as interpreted.  Perhaps you should 
re-install PyScriptor.  Make sure you have a version meant to run with 
3.x rather than 2.x.



SyntaxError: invalid syntax


'ab:' will give the same error in the same place. A colon cannot follow 
an identifier at the beginning of a line.


--
Terry Jan Reedy


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


Re:

2016-01-09 Thread paul.hermeneutic
On Jan 9, 2016 7:56 AM, "tommy roberts"  wrote:
>
> It will not allow my to run python 3.5.1

Python 3.4 is the last version that will run on Windows XP.

If this is not your problem, please provide more information.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24823] ctypes.create_string_buffer does not add NUL if len(init) == size

2016-01-09 Thread Eryk Sun

Eryk Sun added the comment:

I didn't want to change the function in lieu of breaking someone's code. If 
this change is accepted, then it at least needs a documentation note to 
indicate the new behavior.

--
versions: +Python 3.6 -Python 3.4

___
Python tracker 

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



[issue26071] bdist_wininst created binaries fail to start and find 32bit Pythons

2016-01-09 Thread Mark Hammond

New submission from Mark Hammond:

Binaries created by bdist_wininst fail on 3.5+ for 2 reasons:

* The built binary links against the DLL version of the CRT. This means the 
binary will typically fail to start as the CRT DLL isn't found.

* When looking for 32bit Python versions, it fails to take the recent "-32" 
change for the registry key, so it tells you no Python is installed.

This patch:
* Uses the static CRT, which IIRC, was the case in previous Python versions.
* Changes directory to the directory with pythonxx.dll before attempting to 
loadlibrary it - this allows the loadlibrary to succeed as the CRT DLL in that 
directory is found.
* Appends "-32" to registry keys on 32bit builds.

With these patches I can successfully get a pywin32 build working and 
installing.

Steve (or anyone), what do you think?

(Note that the attached patch does *not* include a newly built wininst-14.exe, 
but that would obviously need to be updated before checking in.)

--
components: Windows
files: bdist.patch
keywords: patch
messages: 257879
nosy: mhammond, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: bdist_wininst created binaries fail to start and find 32bit Pythons
type: behavior
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41561/bdist.patch

___
Python tracker 

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



Re: Understanding how to quote XML string in order to serialize using Python's ElementTree

2016-01-09 Thread Saran Ahluwalia
As mentioned previously, I assigned the variable *data *to the string
''',0001,0070,". When any utility that
attempts to parse this string (this is one example of millions found in my
actual data source) you receive that error. You would need to comment out
the following:

data = row['E']
print(data) # The before
data = data[1:-1]
data = ""'{}'"".format(data)
print(data) # Sanity check

to achieve the readout.

Unfortunately, I am wondering if there is a scalable solution to the above
issue (perhaps using some form of escape character or regex?). I have ideas
and have tried many but to no avail. There always seems to be an edge case
that escapes me. Thanks.

On Sat, Jan 9, 2016 at 5:08 PM, Karim  wrote:

>
>
> On 09/01/2016 21:54, kbtyo wrote:
>
>> My specs:
>>
>> Python 3.4.3
>> Windows 7
>> IDE is Jupyter Notebooks
>>
>> What I have referenced:
>>
>> 1)
>> http://stackoverflow.com/questions/1546717/python-escaping-strings-for-use-in-xml
>>
>> 2)
>>
>> http://stackoverflow.com/questions/7802418/how-to-properly-escape-single-and-double-quotes
>>
>> 3)
>> http://stackoverflow.com/questions/4972210/escaping-characters-in-a-xml-file-with-python
>>
>>
>> Here is the data (in CSV format) and script, respectively, (I have tried
>> variations on serializing Column 'E' using both Sax and ElementTree):
>>
>> i)
>>
>> A,B,C,D,E,F,G,H,I,J
>> "3","8","1","> />2312> />285SChecking10","> TransactionID="2"
>> RequestType="HoldInquiry">',0001,0070,","1967-12-25
>> 22:18:13.471000","2005-12-25 22:18:13.768000","2","70","0"
>>
>> ii)
>>
>> #!/usr/bin/python
>> # -*-  coding: utf-8 -*-
>> import os.path
>> import sys
>> import csv
>> from io import StringIO
>> import xml.etree.cElementTree as ElementTree
>> from xml.etree.ElementTree import XMLParser
>> import xml
>> import xml.sax
>> from xml.sax import ContentHandler
>>
>> class MyHandler(xml.sax.handler.ContentHandler):
>>  def __init__(self):
>>  self._charBuffer = []
>>  self._result = []
>>
>>  def _getCharacterData(self):
>>  data = ''.join(self._charBuffer).strip()
>>  self._charBuffer = []
>>  return data.strip() #remove strip() if whitespace is important
>>
>>  def parse(self, f):
>>  xml.sax.parse(f, self)
>>  return self._result
>>
>>  def characters(self, data):
>>  self._charBuffer.append(data)
>>
>>  def startElement(self, name, attrs):
>>  if name == 'Response':
>>  self._result.append({})
>>
>>  def endElement(self, name):
>>  if not name == 'Response': self._result[-1][name] =
>> self._getCharacterData()
>>
>> def read_data(path):
>>  with open(path, 'rU', encoding='utf-8') as data:
>>  reader = csv.DictReader(data, delimiter =',', quotechar="'",
>> skipinitialspace=True)
>>  for row in reader:
>>  yield row
>>
>> if __name__ == "__main__":
>>  empty = ''
>>  Response = 'sample.csv'
>>  for idx, row in enumerate(read_data(Response)):
>>  if idx > 10: break
>>  data = row['E']
>>  print(data) # The before
>>  data = data[1:-1]
>>  data = ""'{}'"".format(data)
>>  print(data) # Sanity check
>> # data = '> RequestType="HoldInquiry">',0001,0070,'
>>  try:
>>  root = ElementTree.XML(data)
>> # print(root)
>>  except StopIteration:
>>  raise
>>  pass
>> # xmlstring = StringIO(data)
>> # print(xmlstring)
>> # Handler = MyHandler().parse(xmlstring)
>>
>>
>> Specifically, due to the quoting in the CSV file (which is beyond my
>> control), I have had to resort to slicing the string (line 51) and then
>> formatting it (line 52).
>>
>> However the print out from the above attempt is as follows:
>>
>> "'
>> 
>>
>>File "", line unknown
>> ParseError: no element found: line 1, column 69
>> Interestingly - if I assign the variable "data" (as in line 54) I receive
>> this:
>>
>>File "", line 56
>> data = '> RequestType="HoldInquiry">',0001,0070,'
>>   ^
>> SyntaxError: invalid token
>>
>> I seek feedback and information on how to address utilizing the most
>> Pythonic means to do so. Ideally, is there a method that can leverage
>> ElementTree. Thank you, in advance, for your feedback and guidance.
>>
>
> I don't understand because this line 54 gives:
>
> >>> import xml.etree.cElementTree as ElementTree
> >>> data = ' RequestType="HoldInquiry">',0001,0070,'
>   File "", line 1
> data = ' RequestType="HoldInquiry">',0001,0070,'
> ^
> SyntaxError: invalid syntax
>
>
> BUT IF you correct the string and remove the inner quote after 
> everything's fine:
> >>> data = ' RequestType="HoldInquiry">,0001,0070,
> '
> >>> root = ElementTree.XML(data)
> >>> root
> 
> Karim
>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Understanding how to quote XML string in order to serialize using Python's ElementTree

2016-01-09 Thread Saran Ahluwalia
Thank you for the feedback on this. I believe that the excel dialect
includes just that:

class excel(Dialect):
delimiter = ','
quotechar = '"'
doublequote = True
skipinitialspace = False
lineterminator = '\r\n'
quoting = QUOTE_MINIMAL


On Sat, Jan 9, 2016 at 5:23 PM, Karim  wrote:

>
>
> On 09/01/2016 21:54, kbtyo wrote:
>
>> My specs:
>>
>> Python 3.4.3
>> Windows 7
>> IDE is Jupyter Notebooks
>>
>> What I have referenced:
>>
>> 1)
>> http://stackoverflow.com/questions/1546717/python-escaping-strings-for-use-in-xml
>>
>> 2)
>>
>> http://stackoverflow.com/questions/7802418/how-to-properly-escape-single-and-double-quotes
>>
>> 3)
>> http://stackoverflow.com/questions/4972210/escaping-characters-in-a-xml-file-with-python
>>
>>
>> Here is the data (in CSV format) and script, respectively, (I have tried
>> variations on serializing Column 'E' using both Sax and ElementTree):
>>
>> i)
>>
>> A,B,C,D,E,F,G,H,I,J
>> "3","8","1","> />2312> />285SChecking10","> TransactionID="2"
>> RequestType="HoldInquiry">',0001,0070,","1967-12-25
>> 22:18:13.471000","2005-12-25 22:18:13.768000","2","70","0"
>>
>> ii)
>>
>> #!/usr/bin/python
>> # -*-  coding: utf-8 -*-
>> import os.path
>> import sys
>> import csv
>> from io import StringIO
>> import xml.etree.cElementTree as ElementTree
>> from xml.etree.ElementTree import XMLParser
>> import xml
>> import xml.sax
>> from xml.sax import ContentHandler
>>
>> class MyHandler(xml.sax.handler.ContentHandler):
>>  def __init__(self):
>>  self._charBuffer = []
>>  self._result = []
>>
>>  def _getCharacterData(self):
>>  data = ''.join(self._charBuffer).strip()
>>  self._charBuffer = []
>>  return data.strip() #remove strip() if whitespace is important
>>
>>  def parse(self, f):
>>  xml.sax.parse(f, self)
>>  return self._result
>>
>>  def characters(self, data):
>>  self._charBuffer.append(data)
>>
>>  def startElement(self, name, attrs):
>>  if name == 'Response':
>>  self._result.append({})
>>
>>  def endElement(self, name):
>>  if not name == 'Response': self._result[-1][name] =
>> self._getCharacterData()
>>
>> def read_data(path):
>>  with open(path, 'rU', encoding='utf-8') as data:
>>  reader = csv.DictReader(data, delimiter =',', quotechar="'",
>> skipinitialspace=True)
>>  for row in reader:
>>  yield row
>>
>> if __name__ == "__main__":
>>  empty = ''
>>  Response = 'sample.csv'
>>  for idx, row in enumerate(read_data(Response)):
>>  if idx > 10: break
>>  data = row['E']
>>  print(data) # The before
>>  data = data[1:-1]
>>  data = ""'{}'"".format(data)
>>  print(data) # Sanity check
>> # data = '> RequestType="HoldInquiry">',0001,0070,'
>>  try:
>>  root = ElementTree.XML(data)
>> # print(root)
>>  except StopIteration:
>>  raise
>>  pass
>> # xmlstring = StringIO(data)
>> # print(xmlstring)
>> # Handler = MyHandler().parse(xmlstring)
>>
>>
>> Specifically, due to the quoting in the CSV file (which is beyond my
>> control), I have had to resort to slicing the string (line 51) and then
>> formatting it (line 52).
>>
>> However the print out from the above attempt is as follows:
>>
>> "'
>> 
>>
>>File "", line unknown
>> ParseError: no element found: line 1, column 69
>> Interestingly - if I assign the variable "data" (as in line 54) I receive
>> this:
>>
>>File "", line 56
>> data = '> RequestType="HoldInquiry">',0001,0070,'
>>   ^
>> SyntaxError: invalid token
>>
>> I seek feedback and information on how to address utilizing the most
>> Pythonic means to do so. Ideally, is there a method that can leverage
>> ElementTree. Thank you, in advance, for your feedback and guidance.
>>
>
> In  fact to get rid of double quote simply create your csv reader like
> that:
>
> reader = csv.DictReader(data, dialect='excel', skipinitialspace=True)
>
> You should then don't need to slice data variable and reformat it.
>
> Karim
>
>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24823] ctypes.create_string_buffer does not add NUL if len(init) == size

2016-01-09 Thread Eryk Sun

Changes by Eryk Sun :


--
components: +Documentation, Library (Lib)

___
Python tracker 

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



[issue26069] Remove the Deprecated API in trace module

2016-01-09 Thread Senthil Kumaran

New submission from Senthil Kumaran:

A number of old methods in trace module were deprecated in issue10371. They 
should be removed in 3.6 release.

--
components: Library (Lib)
messages: 257877
nosy: belopolsky, orsenthil
priority: normal
severity: normal
stage: needs patch
status: open
title: Remove the Deprecated API in trace module
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



[issue26060] Class __dict__ iteration order changing due to type instance key-sharing

2016-01-09 Thread Emanuel Barry

Changes by Emanuel Barry :


--
nosy: +ebarry

___
Python tracker 

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



  1   2   >