[issue25316] distutils: broken error reporting about vcvarsall.bat

2015-10-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a2016b29762c by Steve Dower in branch '3.5':
Issue #25316: distutils raises OSError instead of DistutilsPlatformError when 
MSVC is not installed.
https://hg.python.org/cpython/rev/a2016b29762c

New changeset 07161dd8a078 by Steve Dower in branch 'default':
Issue #25316: distutils raises OSError instead of DistutilsPlatformError when 
MSVC is not installed.
https://hg.python.org/cpython/rev/07161dd8a078

--
nosy: +python-dev

___
Python tracker 

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



[issue25294] Absolute imports fail in some cases where relative imports would work

2015-10-05 Thread Brett Cannon

Brett Cannon added the comment:

You have to realize, Patrick, that the ability for `from ... import ...` to 
work in some situations that `import ...` won't is an age-old problem -- they 
are different at the bytecode level as well as how __import__ handles them -- 
and starting in Python 3.5 it got tweaked to potentially make the differences 
more pronounced by making a certain situation involving circular imports not 
trip users up as much where it was technically feasible to make the change 
without backwards-compatibility issues. It was a "practicality over purity" 
decision.

You also said that "PEP 8 prescribes a way of doing something that often won't 
work" which I disagree with. I think you're reading "absolute import" as 
synonymous with `import ...` which is not what the term means. In actuality, 
absolute imports means no leading dot in the name, e.g. `from .x import y` is a 
relative import while `from z.x import y` is an absolute one (as is `import 
z.x.y`). If you are using the term "absolute import" in the correct way then I 
still don't see how PEP 8 is suggesting any practice "that won't often work".

Circular imports are just plain hard to deal with. Due to the long-standing 
design of import being nothing more than syntactic sugar around exec() we don't 
get to know statically that a circular import is going to happen, so we can't 
error out early to tell the user that they *may* be in trouble. And not 
everyone gets themselves in a position where a circular import dependencies is 
a problem since it only causes issues when module-level code depends on each 
other in a circular way (which does include import statements which is where 
people typically trip themselves up when they get in this situation). I realize 
you're trying to do the right thing here and get the docs clarified to help 
newcomers out, but please realize it's just a difficult subject to explain 
succinctly, especially since a vast majority of people don't get themselves 
into a position where they have to deal with a circular import.

--

___
Python tracker 

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



[issue25316] distutils: broken error reporting about vcvarsall.bat

2015-10-05 Thread Steve Dower

Steve Dower added the comment:

Ah, found it in the linked thread. I'll fix for 3.5.1.

--

___
Python tracker 

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



[issue25316] distutils: broken error reporting about vcvarsall.bat

2015-10-05 Thread Steve Dower

Steve Dower added the comment:

Do you have a full stack trace for that exception? I don't see anywhere that 
should be able to raise WinError in _find_vcvarsall.

--

___
Python tracker 

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



[issue25298] Add lock and rlock weakref tests

2015-10-05 Thread Nir Soffer

Changes by Nir Soffer :


--
nosy: +pitrou

___
Python tracker 

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



[issue25175] Documentation-Tkinter Clarify module spelling change in Python 3 docs

2015-10-05 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> not a bug
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue20981] ssl doesn't build anymore with OpenSSL 0.9.7 or older: X509_check_ca

2015-10-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

For ancient OSes such as RHEL 4, I would suggest people request backports from 
the OS vendor if desired.

--

___
Python tracker 

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



[issue25319] Keep lock type when reseting internal locks

2015-10-05 Thread Nir Soffer

Changes by Nir Soffer :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue25316] distutils: broken error reporting about vcvarsall.bat

2015-10-05 Thread Steve Dower

Changes by Steve Dower :


--
assignee:  -> steve.dower
components: +Windows
keywords: +3.5regression
nosy: +eric.araujo, paul.moore, tim.golden, zach.ware

___
Python tracker 

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



[issue25316] distutils: broken error reporting about vcvarsall.bat

2015-10-05 Thread Steve Dower

Changes by Steve Dower :


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

___
Python tracker 

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



[issue25315] OrderedDict mangled private attribute is inaccessible

2015-10-05 Thread R. David Murray

R. David Murray added the comment:

Yes, that would be correct.  OrderedDict is designed to keep things in 
insertion order, so supporting changing that order is not part of its mission.  
Sorry about that, you'll have to write your own class.

Now, Raymond might find the idea of supporting other orders interesting.  If so 
I'm sure he'll comment on the issue eventually.

--

___
Python tracker 

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



[issue25315] OrderedDict mangled private attribute is inaccessible

2015-10-05 Thread Serge Matveenko

Serge Matveenko added the comment:

Ok, then the OrderedDict is useless for any advanced hacking like altering the 
order in which __setitem__ stores items.

It is just useless Python code and so much appliances missed for this class:(

Thank you all for these completely helpful answers.

--

___
Python tracker 

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



[issue24505] shutil.which wrong result on Windows

2015-10-05 Thread R. David Murray

R. David Murray added the comment:

Well, that's a newish situation for Windows, something I certainly wasn't aware 
of.  Which is trying to find the executable that would be found if typed at the 
prompt.  So, what is the correct algorithm for emulating how Windows does that 
search?  (Or some way to hook directly in to Windows search...)

--

___
Python tracker 

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



[issue25319] Keep lock type when reseting internal locks

2015-10-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 69a26f0800b3 by Benjamin Peterson in branch '2.7':
reinitialize an Event's Condition with a regular lock (closes #25319)
https://hg.python.org/cpython/rev/69a26f0800b3

New changeset 6108d30dde21 by Benjamin Peterson in branch '3.4':
reinitialize an Event's Condition with a regular lock (closes #25319)
https://hg.python.org/cpython/rev/6108d30dde21

New changeset 3719e842a7b1 by Benjamin Peterson in branch '3.5':
merge 3.4 (#25319)
https://hg.python.org/cpython/rev/3719e842a7b1

New changeset 41f29bbf520d by Benjamin Peterson in branch 'default':
merge 3.5 (#25319)
https://hg.python.org/cpython/rev/41f29bbf520d

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue25321] Null Dereference "subname" in zipimport.c

2015-10-05 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I don't think get_subname can return NULL.

--

___
Python tracker 

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



[issue25024] Allow passing "delete=False" to TemporaryDirectory

2015-10-05 Thread Mauro S. M. Rodrigues

Mauro S. M. Rodrigues added the comment:

Hi everybody!
This is my second patch on the community, although the first one is not merged, 
so any feedback is appreciated. 

I've added tests to cover this new situation and docs to let people know about 
the possibility of keeping their temporary directories for debugging purposes. 

Regarding the code itself, I've also made a 'design decision' to remove the 
directory even when created with delete=False if cleanup method is called 
explicitly, so I would like to hear your thoughts on that matter specially if 
you don't agree with it.

--
keywords: +patch
nosy: +maurosr
Added file: 
http://bugs.python.org/file40694/TemporaryDirectory_delete_false.patch

___
Python tracker 

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



[issue25321] Null Dereference "subname" in zipimport.c

2015-10-05 Thread Pankaj Sharma

New submission from Pankaj Sharma:

Hi ,
The issues reported as String NULL dereferecne at line 
Python-2.7.10/Modules/zipimport.c:266 for "subname" which assigned by
get_subname(fullname) at line 264.so there should be check "subname" for NULL 
and return error,if it is NULL.
the respective patch have been attached ,please review it.
Thanks

--
components: Library (Lib)
files: Python-2.7.10-zipimport-01.patch
keywords: patch
messages: 252377
nosy: benjamin.peterson, pankaj.s01, twouters
priority: normal
severity: normal
status: open
title: Null Dereference  "subname" in zipimport.c
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file40695/Python-2.7.10-zipimport-01.patch

___
Python tracker 

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



[issue23609] Export PyModuleObject in moduleobject.h

2015-10-05 Thread Hristo Venev

Hristo Venev added the comment:

Quote from PEP 489:
The Py_mod_create slot is used to support custom module subclasses.

There is no way to subclass PyModuleObject from C.

--
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue24505] shutil.which wrong result on Windows

2015-10-05 Thread Steve Dower

Steve Dower added the comment:

The Win32 API function linked by eryksun is the correct way to determine 
whether to include the current directory in the search - the doc specifically 
refers to matching cmd.exe's behaviour (searching ".;%PATH%" vs. just "%PATH%").

The PATHEXT behaviour should be to look for the name as provided first, 
followed be appending each extension. So looking for "python" will look for 
["python", *("python" + p for p in getenv('PATHEXT').split(';'))] in that order.

--

___
Python tracker 

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



[issue24505] shutil.which wrong result on Windows

2015-10-05 Thread eryksun

eryksun added the comment:

My suggestion is only for 3.5 / 3.6, because Windows XP is no longer supported. 
Starting with Windows Vista, both cmd.exe and CreateProcess support this 
behavior. I realize that disabling searching the current director by default is 
going beyond what cmd.exe does, which is to require opting in via the 
environment variable. But Python can choose to follow the more-modern behavior 
of PowerShell as a precedent here. 

As Steve mentioned, technically a program isn't supposed to check for the 
environment variable, but instead call NeedCurrentDirectoryForExePath. This 
would require either adding a built-in function, e.g. to the _winapi module, or 
require ctypes:

>>> kernel32.NeedCurrentDirectoryForExePathW('command')
1
>>> os.environ['NoDefaultCurrentDirectoryInExePath'] = '1'
>>> kernel32.NeedCurrentDirectoryForExePathW('command')
0

Note that it requires first normalizing the path to replace slashes with 
backslashes, which is unusual for the Windows API.

>>> kernel32.NeedCurrentDirectoryForExePathW(r'.\command')
1
>>> kernel32.NeedCurrentDirectoryForExePathW('./command')
0

--

___
Python tracker 

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



Re: Finding Blank Columns in CSV

2015-10-05 Thread Denis McMahon
On Mon, 05 Oct 2015 13:29:03 +, Jaydip Chakrabarty wrote:

> Hello,
> 
> I have a csv file like this.
> 
> Name,Surname,Age,Sex abc,def,,M ,ghi,,F jkl,mno,,
> pqr,,,F
> 
> I want to find out the blank columns, that is, fields where all the
> values are blank. Here is my python code.
> 
> fn = "tmp1.csv"
> fin = open(fn, 'rb')
> rdr = csv.DictReader(fin, delimiter=',')
> data = list(rdr)
> flds = rdr.fieldnames fin.close()
> mt = []
> flag = 0 for i in range(len(flds)):
> for row in data:
> if len(row[flds[i]]):
> flag = 0 break
> else:
> flag = 1
> if flag:
> mt.append(flds[i]) flag = 0
> print mt
> 
> I need to know if there is better way to code this.
> 
> Thanks.

Assuming all the records have the same number of fields:

I'd create a list of flags of length numfields, all set to 0

then for each record, I*d set flag[n] = 1 if field[n] has content

then I'd check if I still have any 0 flags, and if I do, process the next 
record

As soon as I have no 0 flags, I can stop processing records, as this 
means I have no empty columns.

It might be more efficient if, when checking a record, I only tested the 
fields for which flag was still 0.

Example (untested)

flags = [False for x in rdr.fieldnames]

for row in data:
blanks = False
for i in range(len(flags)):
if not flags[i]:
if len(row[i]) == 0:
flags[i] = True
else:
blanks = True
if not blanks:
break


-- 
Denis McMahon, denismfmcma...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-05 Thread Florin Papa

Florin Papa added the comment:

Hi Stefan,

When activating the "--with-mpx" flag in ./configure, a check is also performed 
to see if the compiler is GCC version 5.1 or higher in order to support MPX 
(and an appropriate error is shown, indicating that the compiler version is 
wrong). Setting the flags manually will only result in a compiler error.

Also, it might not be obvious for the user from the GCC documentation that both 
"-fcheck-pointer-bounds" and "-mmpx" flags are needed to enable MPX 
instrumentation, so adding the "--with-mpx" flag to configure will make it 
easier to use this feature.

--

___
Python tracker 

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



Re: python and ARM memory types

2015-10-05 Thread dieter
voxner@gmail.com writes:
> ...
> But how do I specify (streaming,write-combining,write-back) memory types in 
> python ? Is there a library that I can use ? I am thinking of programming 
> some fixed memory space (say 0x1000_000 - 0x2000_000) as "WC or WT or 
> streaming" using the OS and then try to use the mmap facility in python. 

Python is quite a high level programming language - i.e. lots of things
are out of direct control of the programmer - among others memory management.

I suppose you will need an approach that gives you more control over
memory use - maybe, write your algorithms partially in the "C" programming
language.


You might find "cython" helpful to easily combine Python parts
and "C" parts.

"cython" is a compiler that compiles a source (which can use
a subset of Python and a subset of "C") into a "C" source file
which is then processed like a typical "C" source.

It takes care of a lot of the difficulties at the Python-C interface
and, thus, greatly facilitates combining Python and "C" parts.


> What set of libraries can I use ? Where should I start ? Fixed memories are 
> discouraged so what kind of alternatives I can use ?

Note that modern operating systems virtualize memory. You will need a lot
of tricks to be able to use a specific range of physical memory in
"user level" processes -- but hopefully, you do not need to control
thing of the "physical memory level".

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


[issue25316] distutils: broken error reporting about vcvarsall.bat

2015-10-05 Thread Marius Gedminas

New submission from Marius Gedminas:

When you try to build a C extension on Windows without having a C compiler, 
distutils tries to raise DistutilsPlatformError("Unable to find 
vcvarsall.bat").  However, on Python 3.5, it doesn't do that -- instead it lets 
a WinError(2 "no such file or directory") from _find_vcvarsall escape.

This breaks packages such as zope.interface that ship optional C modules for 
faster execution, but would like to work on people's computers even when there 
is no C compiler.  See 
https://github.com/zopefoundation/zope.interface/issues/24 for details.

--
components: Distutils
messages: 252308
nosy: dstufft, eric.araujo, mgedmin
priority: normal
severity: normal
status: open
title: distutils: broken error reporting about vcvarsall.bat
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



[issue12486] tokenize module should have a unicode API

2015-10-05 Thread Martin Panter

Martin Panter added the comment:

I didn’t notice that this dual untokenize() behaviour already existed. Taking 
that into account weakens my argument for having separate text and bytes 
tokenize() functions.

--

___
Python tracker 

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



[issue12486] tokenize module should have a unicode API

2015-10-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Martin.

Here is rebased patch that addresses Matin's comments.

I agree that having untokenize() changes its output type depending on the 
ENCODING token is bad design and we should change this. But this is perhaps 
other issue.

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



[issue12486] tokenize module should have a unicode API

2015-10-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file40679/tokenize_str_2.diff

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-05 Thread Florin Papa

Florin Papa added the comment:

Hi Antoine,

Third party modules might need patching to work with MPX, as did the math 
module, included in this patch. Everything else worked fine in Python 2.7.10+ 
and 3.6 when running the Grand Unified Python Benchmarks suite and Openstack 
Swift ssbench benchmark (ssbench supports only 2.7.10+).

--

___
Python tracker 

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



[issue25315] OrderedDict mangled private attribute is inaccessible

2015-10-05 Thread Serge Matveenko

Serge Matveenko added the comment:

Zach, ok I got your point. But there is Python implementation in the library 
still which does not conform the one done in C. Such a behavior is tremendously 
confusing.

If there is both Python and C implementation in the library they must conform 
each other. And there is nothing with "you *really* shouldn't use this" when 
you need to especially when it is there. If it is there it must work as it 
written. Otherwise why Python does have this peace of code while it is 
completely useless as reference?

--
resolution: wont fix -> 
status: closed -> open

___
Python tracker 

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



Re: Check if a given value is out of certain range

2015-10-05 Thread Michiel Overtoom

Why not use a function?


if outside(x, 0, 10):
print("x has wrong value")
else:
print("x has good value")


where 'outside' is defined as:

def outside(value, lowerbound, upperbound):
return value < lowerbound or value > upperbound  

Greetings,

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


Re: PySide window does not resize to fit screen

2015-10-05 Thread Hedieh Ebrahimi
Hi Chris, 

Thanks for your answer. I get your point now. 
Unfortunately there are not layouts in my user interface. 
Smaller widget have been grouped using group boxes and then all these group 
boxes are put on the central widget.

I would like to recreate my user interface using one of the designer software 
that exist.

Could you recommend any free designer software that I can create my user 
interface with?

Thank you 

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


[issue20658] os.environ.clear() fails with empty keys (posix.unsetenv)

2015-10-05 Thread Peter Funk

Changes by Peter Funk :


--
nosy: +pefu

___
Python tracker 

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



[issue4926] putenv() accepts names containing '=', return value of unsetenv() not checked

2015-10-05 Thread Peter Funk

Changes by Peter Funk :


--
nosy: +pefu

___
Python tracker 

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



[issue25315] OrderedDict mangled private attribute is inaccessible

2015-10-05 Thread Serge Matveenko

Serge Matveenko added the comment:

If Python source does conform the one in C, it will be completely fine and 
understandable to have such a change and to rely on it in using version checks 
or whatever.

--

___
Python tracker 

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



ANN: bcolz 0.11.3 released!

2015-10-05 Thread Francesc Alted
===
Announcing bcolz 0.11.3
===

What's new
==

Implemented new feature (#255): bcolz.zeros() can create new ctables
too, either empty or filled with zeros. (#256 @FrancescElies
@FrancescAlted).

Also, in previous, non announced versions (0.11.1 and 0.11.2), new
dependencies were added and other fixes are there too.

For a more detailed change log, see:

https://github.com/Blosc/bcolz/blob/master/RELEASE_NOTES.rst


What it is
==

*bcolz* provides columnar and compressed data containers that can live
either on-disk or in-memory.  Column storage allows for efficiently
querying tables with a large number of columns.  It also allows for
cheap addition and removal of column.  In addition, bcolz objects are
compressed by default for reducing memory/disk I/O needs. The
compression process is carried out internally by Blosc, an
extremely fast meta-compressor that is optimized for binary data. Lastly,
high-performance iterators (like ``iter()``, ``where()``) for querying
the objects are provided.

bcolz can use numexpr internally so as to accelerate many vector and
query operations (although it can use pure NumPy for doing so too).
numexpr optimizes the memory usage and use several cores for doing the
computations, so it is blazing fast.  Moreover, since the carray/ctable
containers can be disk-based, and it is possible to use them for
seamlessly performing out-of-memory computations.

bcolz has minimal dependencies (NumPy), comes with an exhaustive test
suite and fully supports both 32-bit and 64-bit platforms.  Also, it is
typically tested on both UNIX and Windows operating systems.

Together, bcolz and the Blosc compressor, are finally fulfilling the
promise of accelerating memory I/O, at least for some real scenarios:

http://nbviewer.ipython.org/github/Blosc/movielens-bench/blob/master/querying-ep14.ipynb#Plots

Other users of bcolz are Visualfabriq (http://www.visualfabriq.com/) the
Blaze project (http://blaze.pydata.org/), Quantopian
(https://www.quantopian.com/) and Scikit-Allel
(https://github.com/cggh/scikit-allel) which you can read more about by
pointing your browser at the links below.

* Visualfabriq:

  * *bquery*, A query and aggregation framework for Bcolz:
  * https://github.com/visualfabriq/bquery

* Blaze:

  * Notebooks showing Blaze + Pandas + BColz interaction:
  *
http://nbviewer.ipython.org/url/blaze.pydata.org/notebooks/timings-csv.ipynb
  *
http://nbviewer.ipython.org/url/blaze.pydata.org/notebooks/timings-bcolz.ipynb

* Quantopian:

  * Using compressed data containers for faster backtesting at scale:
  * https://quantopian.github.io/talks/NeedForSpeed/slides.html

* Scikit-Allel

  * Provides an alternative backend to work with compressed arrays
  * https://scikit-allel.readthedocs.org/en/latest/model/bcolz.html

Installing
==

bcolz is in the PyPI repository, so installing it is easy::

$ pip install -U bcolz


Resources
=

Visit the main bcolz site repository at:
http://github.com/Blosc/bcolz

Manual:
http://bcolz.blosc.org

Home of Blosc compressor:
http://blosc.org

User's mail list:
bc...@googlegroups.com
http://groups.google.com/group/bcolz

License is the new BSD:
https://github.com/Blosc/bcolz/blob/master/LICENSES/BCOLZ.txt

Release notes can be found in the Git repository:
https://github.com/Blosc/bcolz/blob/master/RELEASE_NOTES.rst



  **Enjoy data!**

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

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


ANN: PyInstaller 3.0

2015-10-05 Thread mzibr . public
Hello everybody,

on behalf of the PyInstaller development team I'm happy to announce
PyInstaller 3.0 after two years of development.

   http://www.pyinstaller.org


=== What it is ===

PyInstaller bundles a Python application and all its dependencies into a 
single package. The user can run the packaged app without installing a Python 
interpreter or any modules.

PyInstaller reads a Python script written by you. It analyzes your code to 
discover every other module and library your script needs in order to execute. 
Then it collects copies of all those files - including the active Python 
interpreter! - and puts them with your script in a single folder, or 
optionally in a single executable file.

PyInstaller is tested against Windows, Mac OS X, and Linux. However, it is not 
a cross-compiler: to make a Windows app you run PyInstaller in Windows; to 
make a Linux app you run it in Linux, etc. PyInstaller has been used 
successfully with AIX, Solaris, and FreeBSD, but is not tested against them.


=== Changes ===

Major changes for this release are:

- Python 3 support (3.3 / 3.4 / 3.5).
- Remove support for Python 2.6 and lower.
- Full unicode support in the bootloader (#824, #1224, #1323, #1340, #1396)
- (OSX) Executables built with PyInstaller under OS X can now be digitally
  signed.
- (OSX) 32bit precompiled bootloader no longer distributed, only 64bit.
- (Windows) for 32bit bootloader enable flag LARGEADDRESSAWARE that allows
  to use 4GB of RAM.
- New hooks: amazon-product-api, appy, certifi, countrycode, cryptography, gi,
  httplib2, jsonschema, keyring, lensfunpy, mpl_toolkits.basemap, ncclient,
  netCDF4, OpenCV, osgeo, patsy, PsychoPy, pycountry, pycparser, PyExcelerate,
  PyGobject, pymssql, PyNaCl, PySiDe.QtCore, PySide.QtGui, rawpy, requests,
  scapy, scipy, six, SpeechRecognition, u1db, weasyprint, Xlib.
- Add support for automatically including data files from eggs.
- Add support for directory eggs support.
- Add support for all kind of namespace packages.
- Add support for ``pkgutil.extend_path()``.
- New option ``--key`` to obfuscate the Python bytecode.

The full changelog for this release can be found at:

   https://pypi.python.org/pypi/PyInstaller/3.0


=== License ===

PyInstaller is licensed under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.

Bootloader Exception

In addition to the permissions in the GNU General Public License, the
authors give you unlimited permission to link or embed compiled bootloader
and related files into combinations with other programs, and to distribute
those combinations without any restriction coming from the use of those
files. (The General Public License restrictions do apply in other respects;
for example, they cover modification of the files, and distribution when
not linked into a combine executable.)


=== Feedback ===

We're eager to listen to your feedback on using PyInstaller:

 Bug tracker: https://github.com/pyinstaller/pyinstaller/issues
 Mailing list: http://groups.google.com/group/PyInstaller



https://pypi.python.org/pypi/PyInstaller/3.0;>PyInstaller 3.0 
- PyInstaller bundles a Python application and all its dependencies into a 
single package. (04-Oct-15)
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


Re: Check if a given value is out of certain range

2015-10-05 Thread Mark Lawrence

On 05/10/2015 09:18, Michiel Overtoom wrote:


Why not use a function?


 if outside(x, 0, 10):
 print("x has wrong value")
 else:
 print("x has good value")


where 'outside' is defined as:

 def outside(value, lowerbound, upperbound):
 return value < lowerbound or value > upperbound

Greetings,



Please wash your mouth out with soap, burn precious clock cycles just to 
make code readable, never I say :)


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

Mark Lawrence

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


[issue25317] Convert test_

2015-10-05 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

A large part of test_tokenize is doctests. Doctests are less powerful than 
unittests, and error reporting in doctests is less informative than in 
unittests. Proposed patch converts doctests to unittests.

--
components: Tests
files: test_tokenize.patch
keywords: patch
messages: 252312
nosy: ezio.melotti, meador.inge, michael.foord, pitrou, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Convert test_
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40680/test_tokenize.patch

___
Python tracker 

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



[issue25315] OrderedDict mangled private attribute is inaccessible

2015-10-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> rhettinger
nosy: +rhettinger
priority: normal -> low

___
Python tracker 

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



[issue25317] Convert test_tokenize to unittests

2015-10-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
title: Convert test_ -> Convert test_tokenize to unittests

___
Python tracker 

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



[issue25313] IDLE: gracefully handle themes (or keysets, or ...) not present

2015-10-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Schedule update: 3.4.4 will be delayed untill after 3.5.1, which will be much 
sooner than the original minimum of 4 months after 3.5.0.  Larry promises at 
least two weeks notice before 3.5.1rc1 but will give no hint of when notice 
might be given.  So we have at least two week to do something correct.

I am against duplicating names because it is wrong in principle.  On the other 
hand, I understand the objection to a popup always and forever.  It is past 
time anyway to enable a working [Help] button, #22726.  The current popup help 
text should go there as tab-specific text.  The only automatic notice on 
selecting a new builtin theme would be 'New theme, see Help', maybe in orange 
(warning color, but not emergency red ;-) added in the empty space below.

I believe one new 'name2 = new_theme' addition to config-main would be enough 
for future additions.  We add to configHandler 'new_themes, a set, currently 
{'IDLE Dark'}.  If a selected builtin is in the set, the message is displayed 
and name2 is written.  On reading, if name2 is present but not recognized, 
revert to IDLE Classic, which is present on all systems now.

Intended result: all IDLEs keep working, new releases get a minimally intrusive 
notice pointing to a full explanation.

--

___
Python tracker 

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



[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-05 Thread Vincent Michel

Vincent Michel added the comment:

I attached a patch that should sum up all the points we discussed.

I replaced the `call_soon_threadsafe` example with:
  loop.call_soon_threadsafe(callback, *args)
cause I couldn't find a simple specific usage. Let me know if you think of a 
better example.

--
Added file: http://bugs.python.org/file40691/run_coroutine_threadsafe_2.patch

___
Python tracker 

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



[issue25294] Absolute imports fail in some cases where relative imports would work

2015-10-05 Thread Patrick Maupin

Patrick Maupin added the comment:

You are correct that I have conflated two issues, but they are not orthogonal 
-- if you choose to use relative imports, you will never encounter this issue, 
because your imports will all be of the 'from ... import' form.

(And, as you point out, the fact that you don't have this issue with absolute 
"from ... import" statements is due to some special-casing in the import logic 
that doesn't help the other kind of import statement.)

But PEP 8 denigrates relative imports, and then goes on to describe the use of 
the "import x.y.z; x.y.z.foo" form as a way to avoid name clashes.

So PEP 8 promotes absolute imports, and then it presents using "import" instead 
of "from ... import" as a solution to some problems.  It never mentions that 
the 'as' clause could also solve those problems, and also never mentions that 
"import x.y.z" can actually cause problems in some cases.

And the importlib documentation is also a bit sparse on where things can fail.

We're in agreement that it will be difficult to document properly, and maybe I 
overstated my case, but my opinion remains that the current documentation 
promotes practices that _will_ sometimes get people in trouble.

--

___
Python tracker 

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



[issue25266] mako benchmark not working in Python 3.6

2015-10-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thanks, Brett and Florin!

--

___
Python tracker 

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



threading bug in strptime

2015-10-05 Thread Larry Martell
We have been trying to figure out an intermittent problem where a
thread would fail with this:

AttributeError: 'module' object has no attribute '_strptime'

Even though we were importing datetime. After much banging our heads
against the wall, we found this:

http://code-trick.com/python-bug-attribute-error-_strptime/

The workaround suggested there, to call strptime before starting your
threads, seems to have fixed the issue.

I thought I'd mention it here in case anyone else is facing this.
-- 
https://mail.python.org/mailman/listinfo/python-list


packaging code with compiled libraries

2015-10-05 Thread Tim
I have a package I want to share but have a question about packaging.

Mostly the package is pure python code, but it also requires some binary 
libraries (*.so, *.dll, *.dylib).  I want to bundle these libs so users don't 
have to compile. The package will run on *nix/windows/mac platforms.

Currently I handle this in setup.py. In the 'build' phase, I copy the 
platform-specific libs to a subdirectory called 'libs'.  

class MyBuilder(build_py):
def run(self):
conditional logic for copying 
appropriate library files to 'libs'
etc etc.
build_py.run()

And that seems to work, but after reading more from the Python Packaging 
Authority, I wonder if that is the right way.  Should I be using wheels 
instead? 
I think my brain fried a little bit while going through the doc.

thanks,
--Tim
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pyarmor, guard your python scripts

2015-10-05 Thread sohcahtoa82
On Thursday, September 17, 2015 at 10:55:19 PM UTC-7, Jondy Zhao wrote:
> On Friday, September 18, 2015 at 11:06:25 AM UTC+8, Ben Finney wrote:
> > Jondy Zhao  writes:
> > 
> > > For example, I develop a game by python. What I want to do is that the
> > > player or the agent could not simply copy the game to others. For the
> > > player or the agent, they needn't research the game.
> > 
> > Deciding for the customer what they may not do, on their own computer,
> > is quite hostile. Please don't enable such restrictions.
> > 
> 
> This is only one possible way to distribute encrypted scripts. As I thought 
> the user of Pyarmor would be the producer of commercial software, so they 
> could bind their license file to netcard, harddisk, cpu, etc.
> 
> > -- 
> >  \   "We must find our way to a time when faith, without evidence, |
> >   `\disgraces anyone who would claim it." --Sam Harris, _The End of |
> > _o__) Faith_, 2004 |
> > Ben Finney

DRM does not prevent piracy.

End of story.

The only thing DRM does is piss off your legitimate users by forcing them to 
jump through hoops if they happen to upgrade or replace their computer.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Finding Blank Columns in CSV

2015-10-05 Thread Friedrich Rentsch



On 10/05/2015 03:29 PM, Jaydip Chakrabarty wrote:

Hello,

I have a csv file like this.

Name,Surname,Age,Sex
abc,def,,M
,ghi,,F
jkl,mno,,
pqr,,,F

I want to find out the blank columns, that is, fields where all the
values are blank. Here is my python code.

fn = "tmp1.csv"
fin = open(fn, 'rb')
rdr = csv.DictReader(fin, delimiter=',')
data = list(rdr)
flds = rdr.fieldnames
fin.close()
mt = []
flag = 0
for i in range(len(flds)):
 for row in data:
 if len(row[flds[i]]):
 flag = 0
 break
 else:
 flag = 1
 if flag:
 mt.append(flds[i])
 flag = 0
print mt

I need to know if there is better way to code this.

Thanks.

Operations on columns are often simpler, if a table is rotated 
beforehand. Columns become lists.


def find_empty_columns (table):
number_of_records = len (table)
rotated_table = zip (*table)
indices_of_empty_columns = []
for i in range (len (rotated_table)):  # Column indices
if rotated_table[i].count ('') == number_of_records:
indices_of_empty_columns.append (i)
return indices_of_empty_columns

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


Re: Pyarmor, guard your python scripts

2015-10-05 Thread Ben Finney
Josef Pktd  writes:

> related

Care to give us a summary of what that is, and describe what you think
is the relevant point?

-- 
 \  “The best way to get information on Usenet is not to ask a |
  `\   question, but to post the wrong information.” —Aahz |
_o__)  |
Ben Finney

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


Re: packaging code with compiled libraries

2015-10-05 Thread Rustom Mody
On Tuesday, October 6, 2015 at 1:14:05 AM UTC+5:30, Tim wrote:

> And that seems to work, but after reading more from the Python Packaging 
> Authority, I wonder if that is the right way.  Should I be using wheels 
> instead? 
> I think my brain fried a little bit while going through the doc.

You are not alone
https://mail.python.org/pipermail/python-list/2015-July/694818.html
[last para]

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


Re: reg multiple login python

2015-10-05 Thread harirammanohar159
On Thursday, 1 October 2015 12:35:01 UTC+5:30, hariramm...@gmail.com  wrote:
> Hi All,
> 
> Is there anyway i can login to remote servers at once and do the activity, i 
> can do one by one using for loop..
> 
> Thanks in advance.

Hi,

issue in implementing multiprocessing with pxssh, its working fine with normal 
operations but with pxssh its throwing error as below:
=
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/usr/python/3.4.3/Lib/multiprocessing/pool.py", line 119, in worker
result = (True, func(*args, **kwds))
  File "/usr/python/3.4.3/Lib/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
  File "./rmcomments.py", line 12, in xcute
s = pxssh.pxssh()
  File 
"/usr/python/3.4.3/custommodules/lib/python3.4/site-packages/pexpect/pxssh.py", 
line 91, in __init__
spawn.__init__(self, None, timeout=timeout, maxread=maxread, 
searchwindowsize=searchwindowsize, logfile=logfile, cwd=cwd, env=env)
  File 
"/usr/python/3.4.3/custommodules/lib/python3.4/site-packages/pexpect/__init__.py",
 line 493, in __init__
fd = sys.__stdin__.fileno()
ValueError: I/O operation on closed file
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./rmcomments.py", line 23, in 
output = p.map(xcute, [(srvrs) for srvrs in serverslist])
  File "/usr/python/3.4.3/Lib/multiprocessing/pool.py", line 260, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/usr/python/3.4.3/Lib/multiprocessing/pool.py", line 599, in get
raise self._value
ValueError: I/O operation on closed file
==

Below is the code:

serverslist = ['server1','server2']
username = 'user1'
password = 'password1'

def xcute(srvrs):
s = pxssh.pxssh()
s.login (srvrs, username, password)
---do stuff---
s.sendline('logout')

np = len(serverslist)
p = multiprocessing.Pool(np)
output = p.map(xcute, [(srvrs) for srvrs in serverslist])


can any one help me out!
Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pyarmor, guard your python scripts

2015-10-05 Thread Ian Kelly
On Oct 5, 2015 4:27 PM, "Ben Finney"  wrote:
>
> Josef Pktd  writes:
>
> > related
>
> Care to give us a summary of what that is, and describe what you think
> is the relevant point?

Following the link reveals it to be the video of a talk on Python exe
compilation from PyCon 2014.

If you're worried about the safety of the link, know that youtu.be is the
official URL shortener for YouTube and only leads to YouTube videos.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue1644818] Allow built-in packages and submodules as well as top-level modules

2015-10-05 Thread Nick Coghlan

Nick Coghlan added the comment:

Petr, this could be an interesting issue to take a look at from the point of 
view of the builtin and extension module import changes in Python 3.5.

Given the extent of the import system changes across 3.3/4/5, it's even 
conceivable we may have made this work somewhere along the line. In that case 
we'd still need a new regression test to ensure it keeps working - we didn't 
even have a regression test to ensure extension module imports from inside a 
package worked, so we definitely don't have one for builtin submodules.

--
nosy: +encukou

___
Python tracker 

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



[issue14373] C implementation of functools.lru_cache

2015-10-05 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> serhiy.storchaka
status: open -> pending

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-05 Thread Florin Papa

Florin Papa added the comment:

Hi all,

Thank you for your feedback on the code I submitted.

I added the MPX flags to CFLAGS, not CFLAGS_NODIST, because they also need to 
be included in LDFLAGS.

Please see the new set of patches.

Thank you,
Florin

--
Added file: http://bugs.python.org/file40681/mpx_enable_3_6_v2.patch

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-05 Thread Florin Papa

Changes by Florin Papa :


Added file: http://bugs.python.org/file40682/mpx_enable_2_7_v2.patch

___
Python tracker 

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



[issue25301] Optimize UTF-8 decoder with error handlers

2015-10-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3152e4038d97 by Victor Stinner in branch 'default':
Issue #25301: The UTF-8 decoder is now up to 15 times as fast for error
https://hg.python.org/cpython/rev/3152e4038d97

--
nosy: +python-dev

___
Python tracker 

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



[issue25301] Optimize UTF-8 decoder with error handlers

2015-10-05 Thread STINNER Victor

STINNER Victor added the comment:

I pushed my optimization. I close the issue.

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

___
Python tracker 

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



Re: reg multiple login python

2015-10-05 Thread harirammanohar159
On Thursday, 1 October 2015 12:35:01 UTC+5:30, hariramm...@gmail.com  wrote:
> Hi All,
> 
> Is there anyway i can login to remote servers at once and do the activity, i 
> can do one by one using for loop..
> 
> Thanks in advance.

Hi All,

I am able to achieve it using multiprocessing package...

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


[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This looks ok to me as long as it's disabled by default.

--
type: security -> enhancement

___
Python tracker 

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



Re: Check if a given value is out of certain range

2015-10-05 Thread Marko Rauhamaa
Jussi Piitulainen :

> Michiel Overtoom writes:
>
>> Why not use a function?
>>
>>
>> if outside(x, 0, 10):
>> print("x has wrong value")
>> else:
>> print("x has good value")
>>
>>
>> where 'outside' is defined as:
>>
>> def outside(value, lowerbound, upperbound):
>> return value < lowerbound or value > upperbound  
>
> Wouldn't that be more readable as:?
>
>  def outside(value, lowerbound, upperbound):
>  return not (lowerbound <= value <= upperbound)

Why not use a fricking class framework:

class Endpoint:
def __init__(self, value):
self.value = value

class IncludedEndpoint(Endpoint):
def above(self, x):
return x > self.value

def below(self, x):
return x < self.value

class ExcludedEndpoint(Endpoint):
def above(self, x):
return x >= self.value

def below(self, x):
return x <= self.value

class Range:
def __init__(self, lower_bound, upper_bound):
self.lower_bound = lower_bound
self.upper_bound = upper_bound

def outside(self, x):
return self.lower_bound.below(x) or self.upper_bound.above(x)

def inside(self, x):
return not self.outside(x)

Then, we could simply have:

if Range(IncludedEndpoint(0), IncludedEndpoint(10)).outside(x):
print("x has wrong value")
else:
print("x has good value")

Just for the sake of readability, I mean...


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


[issue25175] Documentation-Tkinter Clarify module spelling change in Python 3 docs

2015-10-05 Thread Bar Harel

Bar Harel added the comment:

I guess you're correct, a simple mistake one time mistake shouldn't require the 
changing of the docs.

--

___
Python tracker 

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



[issue20981] ssl doesn't build anymore with OpenSSL 0.9.7 or older: X509_check_ca

2015-10-05 Thread Mișu Moldovan

Mișu Moldovan added the comment:

For the record, this is an issue in Red Hat Enterprise Linux 4 too. For RHEL 4, 
"Extended" support ends on March 31, 2017, according to 
https://access.redhat.com/support/policy/updates/errata

--

___
Python tracker 

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



[issue25317] Convert test_tokenize to unittests

2015-10-05 Thread Eric V. Smith

Eric V. Smith added the comment:

+1

--
nosy: +eric.smith

___
Python tracker 

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



[issue25318] Add _PyBytesWriter API to optimize Unicode encoders

2015-10-05 Thread STINNER Victor

STINNER Victor added the comment:

Results of bench.py attached to issue #25227 (ASCII and Latin1 encoders): 
attached bench_ucs1_result.txt file.

+-+---
Summary | ucs1_before | ucs1_after
+-+---
ascii   | 1.69 ms (*) |1.69 ms
latin1  |  1.7 ms (*) |1.69 ms
+-+---
Total   | 3.39 ms (*) |3.39 ms
+-+---

--

___
Python tracker 

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



[issue25318] Add _PyBytesWriter API to optimize Unicode encoders

2015-10-05 Thread STINNER Victor

STINNER Victor added the comment:

Result of  bench.py attached to issue #25267: attached bench_utf8_result.txt.

--+-+---
Summary   | utf8_before | 
utf8_after
--+-+---
ignore: "\udcff" * length | 7.63 us (*) |    
7.91 us
ignore: "a" * length + "\udcff"   | 10.7 us (*) |    
10.8 us
ignore: ("a" * 99 + "\udcff" * 99) * length   | 2.17 ms (*) |    
2.16 ms
ignore: ("\udcff" * 99 + "a") * length    |  843 us (*) | 
866 us
ignore: "\udcff" + "a" * length   | 10.7 us (*) |  
11 us
replace: "\udcff" * length    | 7.87 us (*) |  8.43 us 
(+7%)
replace: "a" * length + "\udcff"  | 10.8 us (*) |    
10.9 us
replace: ("a" * 99 + "\udcff" * 99) * length  | 2.46 ms (*) |    
2.46 ms
replace: ("\udcff" * 99 + "a") * length   |  907 us (*) | 
939 us
replace: "\udcff" + "a" * length  | 10.9 us (*) |  
11 us
surrogateescape: "\udcff" * length    | 14.2 us (*) | 17.2 us 
(+21%)
surrogateescape: "a" * length + "\udcff"  | 10.6 us (*) |    
10.7 us
surrogateescape: ("a" * 99 + "\udcff" * 99) * length  | 3.19 ms (*) |   3.4 ms 
(+7%)
surrogateescape: ("\udcff" * 99 + "a") * length   | 1.64 ms (*) | 1.87 ms 
(+13%)
surrogateescape: "\udcff" + "a" * length  | 10.6 us (*) |    
10.7 us
surrogatepass: "\udcff" * length  | 23.1 us (*) |    
23.5 us
surrogatepass: "a" * length + "\udcff"    | 10.7 us (*) |    
10.8 us
surrogatepass: ("a" * 99 + "\udcff" * 99) * length    | 4.39 ms (*) |    
4.44 ms
surrogatepass: ("\udcff" * 99 + "a") * length | 2.43 ms (*) |    
2.47 ms
surrogatepass: "\udcff" + "a" * length    | 10.6 us (*) |    
10.8 us
backslashreplace: "\udcff" * length   | 65.7 us (*) |    
64.3 us
backslashreplace: "a" * length + "\udcff" | 15.7 us (*) |  
15 us
backslashreplace: ("a" * 99 + "\udcff" * 99) * length |   12 ms (*) | 15.9 ms 
(+32%)
backslashreplace: ("\udcff" * 99 + "a") * length  | 11.1 ms (*) | 13.5 ms 
(+22%)
backslashreplace: "\udcff" + "a" * length | 16.4 us (*) |  15.1 us 
(-8%)
--+-+---
Total | 41.4 ms (*) | 48.3 ms 
(+17%)
--+-+---

--
Added file: http://bugs.python.org/file40683/bench_utf8_result.txt

___
Python tracker 

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



Re: Check if a given value is out of certain range

2015-10-05 Thread Jussi Piitulainen
Michiel Overtoom writes:

> Why not use a function?
>
>
> if outside(x, 0, 10):
> print("x has wrong value")
> else:
> print("x has good value")
>
>
> where 'outside' is defined as:
>
> def outside(value, lowerbound, upperbound):
> return value < lowerbound or value > upperbound  

Wouldn't that be more readable as:?

 def outside(value, lowerbound, upperbound):
 return not (lowerbound <= value <= upperbound)

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


Re: PySide window does not resize to fit screen

2015-10-05 Thread Hedieh Ebrahimi
is this free to use for commercial use?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Check if a given value is out of certain range

2015-10-05 Thread Chris Angelico
On Mon, Oct 5, 2015 at 10:42 PM, Marko Rauhamaa  wrote:
> Why not use a fricking class framework:
>
> Then, we could simply have:
>
> if Range(IncludedEndpoint(0), IncludedEndpoint(10)).outside(x):
> print("x has wrong value")
> else:
> print("x has good value")
>
> Just for the sake of readability, I mean...

Hold on a moment! You can't seriously be contemplating instantiating
those classes directly, can you?!? You need to go through the
ThreadedRangeFactory, passing it a couple of EndpointFactory
subclasses to suggest which kinds of endpoints to employ, and finally
use operator overloading to wait for the factory thread to finish its
work. *THEN* you can use this Range object.

ChrisA
has just been reading http://thedailywtf.com/articles/eins-zwei-zuffa
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25318] Add _PyBytesWriter API to optimize Unicode encoders

2015-10-05 Thread STINNER Victor

New submission from STINNER Victor:

Attached patch is the first step to optimize Unicode encoders: it adds a 
_PyBytesWriter API. This API is responsible to use the most efficient buffer 
depending on the need:

* it's possible to use a small buffer directly allocated on the C stack
* otherwise a Python bytes object is allocated
* it's possible to overallocate the bytes objcet to reduce the number of calls 
to _PyBytes_Resize()

The patch only adds the new API, don't expect any speed up. I just added a 
small optimization: the overallocation is disabled in UCS1 encoder (ASCII and 
Latin1) for the last write.

--
components: Unicode
messages: 252322
nosy: ezio.melotti, haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Add _PyBytesWriter API to optimize Unicode encoders
type: performance
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



[issue25319] Keep lock type when reseting internal locks

2015-10-05 Thread Nir Soffer

New submission from Nir Soffer:

When Event._reset_internal_locks was called after fork, it use to
reinitialize its condition without arguments, using RLock instead of
Lock.

--
components: Library (Lib)
files: 0001-Keep-lock-type-when-reseting-internal-locks.patch
keywords: patch
messages: 252326
nosy: nirs
priority: normal
severity: normal
status: open
title: Keep lock type when reseting internal locks
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: 
http://bugs.python.org/file40686/0001-Keep-lock-type-when-reseting-internal-locks.patch

___
Python tracker 

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



[issue25318] Add _PyBytesWriter API to optimize Unicode encoders

2015-10-05 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +patch
Added file: http://bugs.python.org/file40685/bytes_writer.patch

___
Python tracker 

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



[issue25318] Add _PyBytesWriter API to optimize Unicode encoders

2015-10-05 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file40684/bench_ucs1_result.txt

___
Python tracker 

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



[issue25315] OrderedDict mangled private attribute is inaccessible

2015-10-05 Thread Emanuel Barry

Emanuel Barry added the comment:

The same is true of the decimal and datetime modules. Names starting with an 
underscore are an implementation detail, and you shouldn't rely on these in 
production code.

--
nosy: +ebarry

___
Python tracker 

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



Re: PySide window does not resize to fit screen

2015-10-05 Thread Laura Creighton
In a message of Mon, 05 Oct 2015 01:18:33 -0700, Hedieh Ebrahimi writes:
>Could you recommend any free designer software that I can create my user 
>interface with?
>
>Thank you 

Qt Designer works with PySide.
http://doc.qt.io/qt-5/designer-quick-start.html

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


[issue25301] Optimize UTF-8 decoder with error handlers

2015-10-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5b9ffea7e7c3 by Victor Stinner in branch 'default':
Issue #25301: Fix compatibility with ISO C90
https://hg.python.org/cpython/rev/5b9ffea7e7c3

--

___
Python tracker 

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



[issue25318] Add _PyBytesWriter API to optimize Unicode encoders

2015-10-05 Thread STINNER Victor

STINNER Victor added the comment:

A few months ago, I wrote a previous implementation of the _PyBytesWriter API 
which embedded the "current pointer" inside _PyBytesWriter API. The problem was 
that GCC produced less efficient code than expect for the hotspot of the 
encoder.

In the new implementation (attached patch), the "current pointer" is unchanged: 
it's still a variable local to the encoder function. Instead, the current 
pointer became a *parameter* to all _PyBytesWriter *functions*.

I expect to not touch performances of encoders for valid encoded strings (when 
the code calling error handlers is not used), which is important since we have 
very good performance here.

_PyBytesWriter is not restricted to the code to allocate the buffer.

--

bytes_writer.patch:

+char stackbuf[256];

Oh, I forgot to mention this other small optimization. I also added a small 
buffer allocated on the C stack for the UCS1 encoder (ASCII, Latin1). It may 
optimize a little bit encoding when the output string is smaller than 256 bytes 
when the error handler is used.

The optimization comes from the very efficient UTF-8 encoder.

--

___
Python tracker 

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



fades 4 beta

2015-10-05 Thread Facundo Batista
Hello all,

We're glad to announce the PRE-release of fades 4. Yes, we're releasing
fades 4 beta.

fades, a FAst DEpendencies for Scripts, is a system that automatically
handles the virtualenvs in the simple cases normally found when
writing scripts or simple programs.

It will automagically create a new virtualenv (or reuse a previous
created one), installing the necessary dependencies, and execute
your script inside that virtualenv.

You only need to execute the script with fades (instead of Python) and
also mark the required dependencies. More details here:

https://github.com/PyAr/fades/


What's new in this release?

- New option to use iPython as the interactive interpreter: --ipython
  (thanks Ariel Rossanigo)

- Now it's possible to execute a program inside the virtualenv, with -x
  (thanks Ricardo Kirkner)

  For example, it's possible to create a project in Django without having
  Django installed in your system, doing:

fades -d django -x manage startproject foo

- Can execute fades as a Python's module (thanks Javi Mansilla)

python3 -m fades <...etc...>

- Dependencies can be specified in docstrings

- If you want to fiddle with lower layers options, can send parameters
  to virtualend or pip.

- We have a logo!

- Now we run the fades tests using fades itself, no need to install
  anything previously

- Other minor bugfixes and improvements


To get it:

As this is a beta release, just get it from the repository:

https://github.com/PyAr/fades/

Once cloned, you can install it (classic "sudo python3 setup.py install")
or just use it from that directory ("bin/fades").


Help / questions:

- You can ask any question or send any recommendation or request
  to the mailing list.

http://listas.python.org.ar/mailman/listinfo/fades

- Also, you can open an issue here (please do if you find any problem!).

https://github.com/PyAr/fades/issues/new


Thanks in advance for your time!


-- 
.Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/
Twitter: @facundobatista
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


Re: Check if a given value is out of certain range

2015-10-05 Thread Marko Rauhamaa
Chris Angelico :

> On Mon, Oct 5, 2015 at 10:42 PM, Marko Rauhamaa  wrote:
>> Why not use a fricking class framework:
>>
>> Then, we could simply have:
>>
>> if Range(IncludedEndpoint(0), IncludedEndpoint(10)).outside(x):
>> print("x has wrong value")
>> else:
>> print("x has good value")
>>
>> Just for the sake of readability, I mean...
>
> Hold on a moment! You can't seriously be contemplating instantiating
> those classes directly, can you?!? You need to go through the
> ThreadedRangeFactory, passing it a couple of EndpointFactory
> subclasses to suggest which kinds of endpoints to employ, and finally
> use operator overloading to wait for the factory thread to finish its
> work. *THEN* you can use this Range object.
>
> ChrisA
> has just been reading http://thedailywtf.com/articles/eins-zwei-zuffa

Pointing out flaws in my code is totally unprofessional.


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


[issue25319] Keep lock type when reseting internal locks

2015-10-05 Thread Nir Soffer

Changes by Nir Soffer :


Added file: 
http://bugs.python.org/file40688/0001-Keep-lock-type-when-reseting-internal-locks.patch

___
Python tracker 

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



Re: Parsing HTML with xml.etree in Python 2.7?

2015-10-05 Thread Skip Montanaro
On Mon, Oct 5, 2015 at 9:14 AM, Skip Montanaro  wrote:
> I wouldn't be surprised if there were some small API changes other than the
> name change caused by the move into the xml package. Before I dive into a
> rabbit hole and start to modify elementtidy, is there some other stdlib-only
> way to parse HTML code into an xml.etree.ElementTree?

Never mind. The only change necessary turned out to be the import. /F
writes robust code. :-)

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


Re: Finding Blank Columns in CSV

2015-10-05 Thread Chris Angelico
On Tue, Oct 6, 2015 at 12:48 AM, Chris Angelico  wrote:
> fn = "tmp1.csv"
> fin = open(fn, 'rb')
> rdr = csv.DictReader(fin, delimiter=',')
> # all the same down to here
> blanks = set(rdr.fieldnames)
> for row in data:
> blanks = {col for col in blanks if not row[col]}
> mt = [col for col in rdr.fieldnames if col not in blanks]
> print mt

Oops, premature send - hadn't proofread it yet.

fn = "tmp1.csv"
fin = open(fn, 'rb')
rdr = csv.DictReader(fin, delimiter=',')
# all the same down to here
blanks = set(rdr.fieldnames)
for row in rdr:
blanks = {col for col in blanks if not row[col]}
mt = [col for col in rdr.fieldnames if col not in blanks]
print mt

Though I still haven't tested it, so there may be other bugs. Broadly
speaking, though, what it does is quite simple: start by assuming that
every column is nothing but blanks, and then any time you find a
non-blank cell, remove it from the set of blanks. At the end, all
field names not present in the set of blanks are non-blanks.

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


Re: Finding Blank Columns in CSV

2015-10-05 Thread Random832
On Mon, Oct 5, 2015, at 09:29, Jaydip Chakrabarty wrote:
> Hello,
> 
> I have a csv file like this.
> 
> Name,Surname,Age,Sex
> abc,def,,M
> ,ghi,,F
> jkl,mno,,
> pqr,,,F
> 
> I want to find out the blank columns, that is, fields where all the 
> values are blank. Here is my python code.
> 
> fn = "tmp1.csv"
> fin = open(fn, 'rb')
> rdr = csv.DictReader(fin, delimiter=',')
> data = list(rdr)
> flds = rdr.fieldnames
> fin.close()
> mt = []
> flag = 0
> for i in range(len(flds)):
> for row in data:
> if len(row[flds[i]]):
> flag = 0
> break
> else:
> flag = 1
> if flag:
> mt.append(flds[i])
> flag = 0
> print mt
> 
> I need to know if there is better way to code this.

Well, for one thing, you should just be using something like "for fld in
flds" rather than range(len(...)).

There's also an opportunity to use list/generator comprehensions instead
of explicit loops - your whole loop could be written as:
mt = [fld for fld in flds if not any(row[fld] for row in data)]

It might be more efficient to iterate over rows first than columns,
depending on your data (if you have a large number of rows, consider
that you're reading them all into memory at the start) This would be
more complex code, though, and more difficult to write as a
comprehension, so if your data isn't ideal for it it might not be worth
doing.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PySide window does not resize to fit screen

2015-10-05 Thread Chris Warrick
On 5 October 2015 at 13:20, Hedieh Ebrahimi  wrote:
> is this free to use for commercial use?
> --
> https://mail.python.org/mailman/listinfo/python-list

Yeah, you can use Qt Designer to create a nice layout and the
pyside-uic tool to generate code (that you will need to clean up
later).

-- 
Chris Warrick 
PGP: 5EAAEA16
-- 
https://mail.python.org/mailman/listinfo/python-list


Parsing HTML with xml.etree in Python 2.7?

2015-10-05 Thread Skip Montanaro
Back before Fredrik Lundh's elementtree module was sucked into the Python
stdlib as xml.etree, I used to use his elementtidy extension module to
clean up HTML source so it could be parsed into an ElementTree object.
Elementtidy hasn't be updated in about ten years, and still assumes there
is a module named "elementtree" which it can import.

I wouldn't be surprised if there were some small API changes other than the
name change caused by the move into the xml package. Before I dive into a
rabbit hole and start to modify elementtidy, is there some other
stdlib-only way to parse HTML code into an xml.etree.ElementTree?

Thx,

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


Finding Blank Columns in CSV

2015-10-05 Thread Jaydip Chakrabarty
Hello,

I have a csv file like this.

Name,Surname,Age,Sex
abc,def,,M
,ghi,,F
jkl,mno,,
pqr,,,F

I want to find out the blank columns, that is, fields where all the 
values are blank. Here is my python code.

fn = "tmp1.csv"
fin = open(fn, 'rb')
rdr = csv.DictReader(fin, delimiter=',')
data = list(rdr)
flds = rdr.fieldnames
fin.close()
mt = []
flag = 0
for i in range(len(flds)):
for row in data:
if len(row[flds[i]]):
flag = 0
break
else:
flag = 1
if flag:
mt.append(flds[i])
flag = 0
print mt

I need to know if there is better way to code this.

Thanks.

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


[issue25315] OrderedDict mangled private attribute is inaccessible

2015-10-05 Thread R. David Murray

R. David Murray added the comment:

A method that starts with an '_' is not part of the API unless documented to be 
so (as with namedtuple), and a non-special method that starts with two is 
purposefully mangled so that you cannot accidentally rely on it.  The C 
implementation is an implementation of the API and the behavior when that API 
is used (as vetted by the tests that are run against both implementations); it 
is not otherwise required to "conform" to the python implementation or vice 
versa.

--
nosy: +r.david.murray
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue25294] Absolute imports fail in some cases where relative imports would work

2015-10-05 Thread Patrick Maupin

Patrick Maupin added the comment:

concurrent/futures/__init__.py may be a better example than 2to3 for this 
issue.  It's relatively new code, it's part of the standard library, it's 
fairly small and self-contained, and it doesn't follow the promulgated standard.

If it's bad code, it should be modified.  If it's not bad code, then the docs 
shouldn't denigrate the coding style (especially not to the extent of requiring 
absolute imports in standard library code), because a lot of newbies take the 
docs to heart and spend a lot of time and energy beating up themselves and 
others about conformance.

--

___
Python tracker 

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



Re: Finding Blank Columns in CSV

2015-10-05 Thread Chris Angelico
On Tue, Oct 6, 2015 at 1:06 AM, Tim Chase  wrote:
> That way, if you determine by line 3 that your million-row CSV file
> has no blank columns, you can get away with not processing all
> million rows.

Sure, although that effectively means the entire job is moot. I kinda
assume that the OP knows that there are some blank columns (maybe lots
of them). The extra check is unnecessary unless it's actually
plausible that there'll be no blanks whatsoever.

Incidentally, you have an ordered_headers list which is the blank
columns in order; I think the OP was looking for a list of the
_non_blank columns. But that's a trivial difference, easy to tweak.

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


Re: Finding Blank Columns in CSV

2015-10-05 Thread Tim Chase
On 2015-10-06 00:51, Chris Angelico wrote:
> fn = "tmp1.csv"
> fin = open(fn, 'rb')
> rdr = csv.DictReader(fin, delimiter=',')
> # all the same down to here
> blanks = set(rdr.fieldnames)
> for row in rdr:
> blanks = {col for col in blanks if not row[col]}
> mt = [col for col in rdr.fieldnames if col not in blanks]
> print mt

My only other modification would be to add a check that, if you no
longer have any blank columns, bail early from the loop:

  from cStringIO import StringIO
  import csv

  s = StringIO("""Name,Surname,Age,Sex
  abc,def,,M
  ,ghi,,F
  jkl,mno,,
  pqr,,,F
  """)

  dr = csv.DictReader(s)
  header_set = set(dr.fieldnames)
  for row in dr:
header_set = set(h for h in header_set if not row[h])
if not header_set:
  # we no longer have any headers, bail early
  break
  ordered_headers = [h for h in dr.fieldnames if h in header_set]
  print(header_set)
  print(ordered_headers)

That way, if you determine by line 3 that your million-row CSV file
has no blank columns, you can get away with not processing all
million rows.

-tkc



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


Re: Finding Blank Columns in CSV

2015-10-05 Thread Chris Angelico
On Tue, Oct 6, 2015 at 12:29 AM, Jaydip Chakrabarty
 wrote:
> I want to find out the blank columns, that is, fields where all the
> values are blank. Here is my python code.
>
> fn = "tmp1.csv"
> fin = open(fn, 'rb')
> rdr = csv.DictReader(fin, delimiter=',')
> data = list(rdr)
> flds = rdr.fieldnames
> fin.close()
> mt = []
> flag = 0
> for i in range(len(flds)):
> for row in data:
> if len(row[flds[i]]):
> flag = 0
> break
> else:
> flag = 1
> if flag:
> mt.append(flds[i])
> flag = 0
> print mt
>
> I need to know if there is better way to code this.
>

You could do it with a single iteration, something like this:

fn = "tmp1.csv"
fin = open(fn, 'rb')
rdr = csv.DictReader(fin, delimiter=',')
# all the same down to here
blanks = set(rdr.fieldnames)
for row in data:
blanks = {col for col in blanks if not row[col]}
mt = [col for col in rdr.fieldnames if col not in blanks]
print mt
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25319] Keep lock type when reseting internal locks

2015-10-05 Thread Nir Soffer

Changes by Nir Soffer :


Added file: 
http://bugs.python.org/file40687/0001-Keep-lock-type-when-reseting-internal-locks-2.7.patch

___
Python tracker 

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



[issue24505] shutil.which wrong result on Windows

2015-10-05 Thread Bar Harel

Bar Harel added the comment:

Unfortunately that patch will not help for files like "python.exe.exe", and 
double ext which sometimes happens.
I'm on it. Should take me a day or two, more problems might arise along the 
way. Thanks Bob for alerting.

Regarding the uppercase, I believe it is better to leave the casing as it is. 
It should be up to the user to mess with it as converting case is a one way 
ticket. If someone entered an uppercase, perhaps he wants it like that. Also 
it's less prune to errors and behaves the same for Unix and Windows.

--
nosy: +bar.harel

___
Python tracker 

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



[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-05 Thread Guido van Rossum

Guido van Rossum added the comment:

loop *is* required for this function. It's just that there's an earlier, 
general comment describing it as optional for all functions in this section.

--

___
Python tracker 

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



Re: PySide window does not resize to fit screen

2015-10-05 Thread Michael Torrie
On 10/05/2015 05:20 AM, Hedieh Ebrahimi wrote:
> is this free to use for commercial use?

Yes of course.  There's also the newer Qt Creator program if you want to
use Qt 5.  The license of the Designer and Creator programs does not
apply to the output of these programs (the .ui XML files).

You'll want to read up on the documentation.  Here's a couple of links
for starters:

http://doc.qt.io/qt-4.8/designer-layouts.html
https://wiki.qt.io/QtCreator_and_PySide (works with .ui files from
Designer also)

Even if you don't use a GUI designer, you should construct your GUI with
layout managers so that your interfaces can adjust and look good on a
variety of screen sizes and DPI.  It's pretty simple once you wrap your
brain around the idea.

Another method of working with .ui files it to load them at runtime:
https://srinikom.github.io/pyside-docs/PySide/QtUiTools/QUiLoader.html


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


[issue23972] Asyncio reuseport

2015-10-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5e7e9b131904 by Guido van Rossum in branch '3.4':
Issue #23972: updates to asyncio datagram API. By Chris Laws.
https://hg.python.org/cpython/rev/5e7e9b131904

New changeset ba956289fe66 by Guido van Rossum in branch '3.5':
Issue #23972: updates to asyncio datagram API. By Chris Laws. (Merge 3.4->3.5.)
https://hg.python.org/cpython/rev/ba956289fe66

New changeset c0f1f882737c by Guido van Rossum in branch 'default':
Issue #23972: updates to asyncio datagram API. By Chris Laws. (Merge 3.5->3.6.)
https://hg.python.org/cpython/rev/c0f1f882737c

--
nosy: +python-dev

___
Python tracker 

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



[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-05 Thread Vincent Michel

Vincent Michel added the comment:

> The docs look good.

Should I add a note to explain why the loop argument has to be explicitly 
passed? (there is a note at the beginning of the `task functions` section 
stating "In the functions below, the optional loop argument ...")

> What do you need to add to the concurrency and multithreading section?

This section provides an example to schedule a coroutine from a different 
thread using `ensure_future` and `call_soon_threadsafe`. This example should be 
replaced with another usage of `call_soon_threadsafe` and another paragraph 
about `run_coroutine_threadsafe` should be added.

> I agree on the try/except

Do you think the exception should be re-raised for the logger?

> can you add that to the same diff? 

All right, should I make another PR on the asyncio github repo as well?

--

___
Python tracker 

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



Re: Pyarmor, guard your python scripts

2015-10-05 Thread Josef Pktd
related
https://youtu.be/wsczq6j3_bA?t=20m9s

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


[issue25316] distutils: broken error reporting about vcvarsall.bat

2015-10-05 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +steve.dower -eric.araujo

___
Python tracker 

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



[issue25320] unittest loader.py TypeError when code directory contains a socket

2015-10-05 Thread Victor van den Elzen

New submission from Victor van den Elzen:

Hi, when trying to run tests after upgrading from Python 3.4 to Python 3.5 I 
encountered the following exception:

Traceback (most recent call last):
  ...
  File "/usr/lib/python3.5/unittest/loader.py", line 341, in discover
tests = list(self._find_tests(start_dir, pattern))
  File "/usr/lib/python3.5/unittest/loader.py", line 398, in _find_tests
full_path, pattern, namespace)
TypeError: 'NoneType' object is not iterable

This was caused by a stray socket in my code directory, and the fact that 
_find_test_path only considers directories and regular files.

I attached a suggested fix that just skips all special files. No tests other 
than "it works on my machine".

--
components: Library (Lib)
files: unittest_socket.diff
keywords: patch
messages: 252342
nosy: Victor van den Elzen
priority: normal
severity: normal
status: open
title: unittest loader.py TypeError when code directory contains a socket
versions: Python 3.5
Added file: http://bugs.python.org/file40690/unittest_socket.diff

___
Python tracker 

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



  1   2   >