mds-utils 2.1.0 released

2014-09-28 Thread Michele De Stefano
I am pleased to announce the release of mds-utils 2.1.0
http://www.micheledestefano.joomlafree.it/en/mds-utils.html.

Features summary
---

MDS-UTILS provides:

   1. a tool for detecting machine endianity.
   2. utilities for the Boost uBLAS library. Amongst them, some type traits
   for detecting different uBLAS matrix types.
   3. some useful classes that allow to treat the old C FILE pointer as a
   C++ stream.
   4. C++ wrappers of the main Python objects, independent of those in
   Boost Python. Wrappers are provided also for NumPy arrays.
   5. C++ classes that help on treating Python file objects as C++ streams.
   6. a review and refactor of the indexing support in Python extensions.
   Now access in write mode is supported too.
   7. new C++ *to-Python* and *from-Python* converters for some *Boost
   uBlas* objects and for standard Python objects. These converters do not
   depend on Boost Python.
   8. a new sequence iterator that is able to wrap Python sequences and
   allows also to modify them. This feature does not depend on Boost.Python.
   9. the NDArrayIterator class, that wraps the Numpy C-API iterator and
   allows easy management of conversions to/from Numpy arrays.
   10. some SWIG interface files, for easy integration with SWIG extensions
   for Python.

Each class is a well-documented, small, easy to use and it should never be
too difficult to learn to use it.
A large percentage of this library makes a heavy usage of the Boost C++
libraries http://www.boost.org/: so, they must be installed on the
system. It is assumed that the user is familiar with them.


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

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


Re: Leap year

2014-09-28 Thread Steven D'Aprano
Seymore4Head wrote:

 Still practicing.  Since this is listed as a Pseudocode, I assume this
 is a good way to explain something.  That means I can also assume my
 logic is fading with age.
 http://en.wikipedia.org/wiki/Leap_year#Algorithm
 
 Me trying to look at the algorithm, it would lead me to try something
 like:
 if year % 4 !=0:
   return False
 elif year % 100 !=0:
   return True
 elif year % 400 !=0:
   return False

You can only have the return statement inside a function, not in top-level
code, and that looks like top-level code. So you need to start with
something like:

def is_leapyear(year):
if year % 4 != 0:
return False
...


    Since it is a practice problem I have the answer:
 def is_leap_year(year):
 return ((year % 4) == 0 and ((year % 100) != 0 or (year % 400) == 0))

Or in English:

- years which are divisible by 4 are leap years, *unless* they are also
divisible by 100, in which case they aren't leap years, *except* that years
divisible by 400 are leap years.

Converting to Python code:

def is_leap_year(year):
return (
# Years which are divisible by 4
(year % 4 == 0)
# and not divisible by 100
and (year % 100 != 0)
# unless divisible by 400
or (year % 400 == 0)
)


 I didn't have any problem when I did this:
 
 if year % 400 == 0:
   print (Not leap year)
 elif year % 100 == 0:
   print (Leap year)
 elif year % 4 == 0:
   print (Leap year)
 else:
   print (Not leap year)

You might not have had any problems, but neither did you get the right
answers. According to your code, 2000 is not a leap year (since 2000 % 400
equals 0) but in reality it is. On the other hand, your code says 1900 was
a leap year, which it was not.

The lesson here is, code isn't working until you've actually tested it, and
to test it sufficiently you need to check the corner cases, not just the
obvious ones.



-- 
Steven

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


Re: Want to win a 500 tablet?

2014-09-28 Thread Michael Torrie
On 09/26/2014 05:03 PM, Seymore4Head wrote:
 On Fri, 26 Sep 2014 18:55:54 -0400, Seymore4Head
 Seymore4Head@Hotmail.invalid wrote:
 
 I am taking An Introduction to Interactive Programming in Python at
 coursera.org.  From their announcments page:

 Week one of the video contest is open

 For those of you that are interested in helping your peers, the
 student video tutorial competition is an excellent opportunity. The
 week one submission thread is up in the student video tutorial
 forum. Feel free to browse the current tutorials or make your own.
 The deadline for submission of this week's videos is 23:00 UTC on
 Thursday. The overall winner of this competition will receive a $500
 tablet computer so give it a try if you are interested!
 
 BTW this was the most informative tutorial I found.
 https://www.youtube.com/watch?v=LpTzLnryDq8

I personally find that video tutorials don't work for me at all.  Give
me a web page any day that I can read and re-read at my own pace (fast
or slow).

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


Re: tkinter and gtk problem

2014-09-28 Thread Michael Torrie
On 09/26/2014 12:15 PM, Paula Estrella wrote:
 Hello, we are working on ubuntu 12.04 LTS; we use gtk to take screenshots
 and we added a simple interface to select a file using tkFileDialog but it
 doesn't work; is it possible that tkinter and gtk are incompatible? a test
 script to open a file with tkFileDialog works fine but if we import gtk
 even if we don't use it, the dialog box doesn't respond to mouse events
 anymore; if we comment the import gtk it does work 
 
 Anyone knows what might be going on or how to solve that?

Just use the Gtk to show a file dialog box.  As dieter says, you can't
mix event loops easily across multiple platforms.  You might be able to
set up a gtk timer or idle event to pump the tkinter event loop
manually, but that's probably overly complicated and prone to failure.

PyGtk isn't that much harder to learn and work with than tkinter.


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


Re: Question about uninstallation.

2014-09-28 Thread Fabien

On 28.09.2014 03:07, Gregory Johannes-Kinsbourg wrote:

  both Python 2  3 (I’m on OS X 10.10 btw) and first of all was curious to 
know if they will clash


I am also quite new to the python business, and had the same kind of 
questions (how to install/uninstall a package, will different versions 
clash, should I use pip install or pip3 install, etc). And then I 
discovered virtualenv and virtualenvwrapper and everything was much 
easier. Here is a resource that helped me:


http://simononsoftware.com/virtualenv-tutorial-part-2/

I don't know about mac but on linux it works like a charm

Fabien

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


Re: Storage Cost Calculation

2014-09-28 Thread Duncan Booth
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:

 The Model B supported more graphics modes, had a six-pin DIN connector
 for a monitor (both the A and B had UHF output for connecting to a
 television, but only the B supported a dedicated monitor), had support
 for an optional floppy disk controller and even an optional hard drive
 controller. It also had RS-232 and Centronics parallel interfaces, a
 20-pin user port for I/O, and even support for a second CPU! The
 Model A didn't support any of those.

I won't disagree with most of those, but the graphics modes were simply a 
function of the available memory as RAM was shared between programs and 
graphics. The model A couldn't do the higher resolution graphics modes as 
they took too much out of the main memory (up to 20k which would have been 
tricky with 16k total RAM).

 At the time, the BBC Micro memory was (I think) expandable: the Model
 B could be upgraded to 128K of memory, double what Bill Gates
 allegedly said was the most anyone would ever need. (He probably
 didn't say that.) So what we need is to find out what an upgrade would
 have cost. 

The memory expansion in the original BBC Micro was mostly ROM. The total 
addressable space was 64k, but 16k of that was the Acorn operating system 
and another 16k was paged ROM: by default you got BBC Basic but you could 
install up to 4 16k ROMs for languages such as BCPL or Logo or to drive 
external processor cards. That isn't to say of course that you couldn't 
expand the RAM: a company I worked for in the 80s that wrote the BCPL and 
Logo ROMs also manufactured a 1MB RAM card with battery backup. 

Later on the B+ had 64k of RAM and the B+128 had 128k of RAM and in each 
case the additional RAM was paged in as necessary but I don't think the RAM 
in the B was ever expandable.

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


Re: Question about uninstallation.

2014-09-28 Thread Ned Deily
In article 
captjjmonhfm1mr+2ssiy8r6ntvduzxqsxxjraxmi6deqh9h...@mail.gmail.com,
 Chris Angelico ros...@gmail.com wrote:
 On Sun, Sep 28, 2014 at 11:07 AM, Gregory Johannes-Kinsbourg
 harmonoisemu...@gmail.com wrote:
  Anyway, I’ve basically ended up installing both Python 2  3 (I’m on OS X 
  10.10 btw) and first of all was curious to know if they will clash with 
  each when being used in terminal and how do i safely remove 3 (figure i’ll 
  learn 2 first, then re-install 3). According to the manual I should remove 
  the files from the application folder (fair enough) but also the framework 
  (surely I should leave that for python 2?)
 They shouldn't clash. You'll invoke one as python2 and the other as
 python3. However, as Yosemite hasn't been released yet, you may find
 that you have problems that nobody's run into yet. To get a better
 understanding of Python, separately from any OS X issues, you may want
 to make yourself a Linux computer to test on - it's usually not hard
 to install a virtualization system and create a Linux machine inside
 your Mac (or just get an actual physical machine). There have been
 some issues with OS X and Python, in various versions; not being a Mac
 person myself, I can't say what the least problematic version is.

That's odd advice. There's no need to install Linux to run Python on OS 
X; it works perfectly fine there and is fully supported there.  Python 2 
and Python 3 co-exist just fine on OS X, actually, with Python framework 
builds as is provided by python.org installers, even better than on 
Linux as scripts are installed to separate bin directories for Py2 and 
Py3.  And, while OS X 10.10 Yosemite is still a few weeks away from its 
expected official release data, you can be sure that the current 
releases of Python have been tested with the public beta and with 
developer previews.  The most recent release of Python 2 (2.7.8) and the 
upcoming release of Python 3.4.2 (3.4.2rc1 is now available for testing) 
should fully support Yosemite.  There are some minor issues with older 
binary versions centering around building extension modules if you need 
full universal support; most people don't.  There are somewhat more 
serious issues if you try to build older versions of Python from source.  
For more details, see http://bugs.python.org/issue21811.  I know that 
MacPorts has backported these fixes to their older versions of Python, 
if you need them; no idea about other third-party distributors.

-- 
 Ned Deily,
 n...@acm.org

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


Re: Question about uninstallation.

2014-09-28 Thread Chris Angelico
On Mon, Sep 29, 2014 at 9:17 AM, Ned Deily n...@acm.org wrote:
 That's odd advice.
 ... And, while OS X 10.10 Yosemite is still a few weeks away from its
 expected official release data, you can be sure that the current
 releases of Python have been tested with the public beta and with
 developer previews.

It's due to the issues there've been in the past. How can someone who
doesn't know Python be sure of whether an issue is due to the mess
that can happen when two Pythons are installed from different places
(the system Python and homebrew, as is often the case), or is actually
an attribute of Python?

Also, I didn't know Yosemite was that close, so I thought it was still
more in flux. So maybe my concerns were a little ... well,
overcautious.

If someone's willing to state with some degree of confidence that
Python X.Y.Z will work perfectly on OS X 10.10, then there's no
problem.

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


Re: Question about uninstallation.

2014-09-28 Thread Ned Deily
In article 
CAPTjJmq-55xV2nbsVgc6UFz8Xkw_wnh_S9RejduwZteU=2o...@mail.gmail.com,
 Chris Angelico ros...@gmail.com wrote:
 On Mon, Sep 29, 2014 at 9:17 AM, Ned Deily n...@acm.org wrote:
  That's odd advice.
  ... And, while OS X 10.10 Yosemite is still a few weeks away from its
  expected official release data, you can be sure that the current
  releases of Python have been tested with the public beta and with
  developer previews.
 It's due to the issues there've been in the past. How can someone who
 doesn't know Python be sure of whether an issue is due to the mess
 that can happen when two Pythons are installed from different places
 (the system Python and homebrew, as is often the case), or is actually
 an attribute of Python?

It's pretty easy to avoid such issues: pick one Python instance of each 
version (2 and 3) and stick with it, be it one of the system-supplied 
Pythons, a python.org Python, or a third-party Python like from 
MacPorts, homebrew, Anaconda, et al.  In that respect, OS X is no 
different than any Linux distribution.
 
 Also, I didn't know Yosemite was that close, so I thought it was still
 more in flux. So maybe my concerns were a little ... well,
 overcautious.

It's good to be cautious but better to be informed cautious.  Public 
betas have been available since July; developer previews before that.  
And, while Apple has not announced an official release date yet, they 
have said Fall 2014 and, given the history of recent OS X releases and 
the current rumor mill, one would be advised to not bet against an 
October release date.
 
 If someone's willing to state with some degree of confidence that
 Python X.Y.Z will work perfectly on OS X 10.10, then there's no
 problem.

Let's just say that I will personally be *very* sad if 2.7.8 and 3.4.2 
don't work as well or better on 10.10 as they do on 10.9.x and earlier 
supported OS X releases.

-- 
 Ned Deily,
 n...@acm.org

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


trouble building data structure

2014-09-28 Thread David Alban
greetings,

i'm writing a program to scan a data file.  from each line of the data file
i'd like to add something like below to a dictionary.  my perl background
makes me want python to autovivify, but when i do:

  file_data = {}

  [... as i loop through lines in the file ...]

  file_data[ md5sum ][ inode ] = { 'path' : path, 'size' : size, }

i get:

Traceback (most recent call last):
  File foo.py, line 45, in module
file_data[ md5sum ][ inode ] = { 'path' : path, 'size' : size, }
KeyError: '91b152ce64af8af91dfe275575a20489'

what is the pythonic way to build my file_data data structure above that
has the above structure?

on http://en.wikipedia.org/wiki/Autovivification there is a section on how
to do autovivification in python, but i want to learn how a python
programmer would normally build a data structure like this.

here is the code so far:

#!/usr/bin/python

import argparse
import os

ASCII_NUL = chr(0)

HOSTNAME = 0
MD5SUM   = 1
FSDEV= 2
INODE= 3
NLINKS   = 4
SIZE = 5
PATH = 6

file_data = {}

if __name__ == __main__:
  parser = argparse.ArgumentParser(description='scan files in a tree and
print a line of information about each regular file')
  parser.add_argument('--file', '-f', required=True, help='File from which
to read data')
  parser.add_argument('--field-separator', '-s', default=ASCII_NUL,
help='Specify the string to use as a field separator in output.  The
default is the ascii nul character.')
  args = parser.parse_args()

  file = args.file
  field_separator = args.field_separator

  with open( file, 'rb' ) as f:
for line in f:
  line = line.rstrip('\n')
  if line == 'None': continue
  fields = line.split( ASCII_NUL )

  hostname = fields[ HOSTNAME ]
  md5sum   = fields[ MD5SUM ]
  fsdev= fields[ FSDEV ]
  inode= fields[ INODE ]
  nlinks   = int( fields[ NLINKS ] )
  size = int( fields[ SIZE ] )
  path = fields[ PATH ]

  if size  ( 100 * 1024 * 1024 ): continue

  ### print '%s' '%s' '%s' '%s' '%s' '%s' '%s' % ( hostname, md5sum,
fsdev, inode, nlinks, size, path, )

  file_data[ md5sum ][ inode ] = { 'path' : path, 'size' : size, }

thanks,
david
-- 
Our decisions are the most important things in our lives.
***
Live in a world of your own, but always welcome visitors.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: trouble building data structure

2014-09-28 Thread Chris Angelico
On Mon, Sep 29, 2014 at 10:04 AM, David Alban exta...@extasia.org wrote:
   file_data = {}

   [... as i loop through lines in the file ...]

   file_data[ md5sum ][ inode ] = { 'path' : path, 'size' : size, }

 what is the pythonic way to build my file_data data structure above that
 has the above structure?

The easiest way would be with a defaultdict. It's a subclass of
dictionary that does what you're looking for. You'd use it something
like this:

from collections import defaultdict
file_data = defaultdict(dict)
# then continue with the program as normal
# including the loop and assignments that you have above

Any time it's asked to look up an MD5 that doesn't exist yet, it'll
create a new dictionary by calling dict(), and that sets up the next
level for you.

Docs are here:
https://docs.python.org/2/library/collections.html#collections.defaultdict
https://docs.python.org/3/library/collections.html#collections.defaultdict

You can also use the setdefault() method of the regular dictionary,
which makes sense if you have just a few places where you need this
behaviour.

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


Re: trouble building data structure

2014-09-28 Thread Ned Batchelder

On 9/28/14 8:04 PM, David Alban wrote:

i'm writing a program to scan a data file.  from each line of the data
file i'd like to add something like below to a dictionary.  my perl
background makes me want python to autovivify, but when i do:

   file_data = {}

   [... as i loop through lines in the file ...]

   file_data[ md5sum ][ inode ] = { 'path' : path, 'size' : size, }

i get:

Traceback (most recent call last):
   File foo.py, line 45, in module
 file_data[ md5sum ][ inode ] = { 'path' : path, 'size' : size, }
KeyError: '91b152ce64af8af91dfe275575a20489'

what is the pythonic way to build my file_data data structure above
that has the above structure?



If you want file_data to be a dictionary of dictionaries, use a defaultdict:

file_data = collections.defaultdict(dict)

This is Python's version of autovivification.  When you access a key 
that doesn't exist, the defaultdict will use the callable you gave it 
(in this case, dict) to create the new value as needed.


--
Ned Batchelder, http://nedbatchelder.com

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


[issue22139] python windows 2.7.8 64-bit did not install

2014-09-28 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Reopening for somebody to look at; I'm not interested in Python 2.7 anymore.

--
status: closed - open

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



[issue16537] Python’s setup.py raises a ValueError when self.extensions is empty

2014-09-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You can use the default parameter of max() in 3.4+.

--
nosy: +serhiy.storchaka

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



[issue1772673] Replacing char* with const char*

2014-09-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 599a957038fa by Serhiy Storchaka in branch 'default':
Removed redundant casts to `char *`.
https://hg.python.org/cpython/rev/599a957038fa

--

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



[issue22503] Signal stack overflow in faulthandler_user

2014-09-28 Thread STINNER Victor

STINNER Victor added the comment:

_PyFaulthandler_Init() uses sigaltstack() with a stack of SIGSTKSZ bytes. On my 
Linux/x86_64, SIGSTKSZ is 8 KB.

What is the value of SIGSTKSZ on aarch64? Is there a C define (#ifdef) to use a 
different size on this architecture? Does the test pass if you modify 
faulthandler.c to use SIGSTKSZ * 2?

--

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



[issue15363] Idle/tkinter ~x.py 'save as' fails. closes idle

2014-09-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Agree with Martin. And I think we should check for starting tilde not base 
name, but full name.

--
nosy: +serhiy.storchaka
stage: patch review - needs patch
versions: +Python 3.5 -Python 3.3

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



[issue22503] Signal stack overflow in faulthandler_user

2014-09-28 Thread Andreas Schwab

Andreas Schwab added the comment:

There is an open bug about MINSIGSTKSZ being too small on aarch64 
https://sourceware.org/bugzilla/show_bug.cgi?id=16850.
How much SIGSTKSZ can guarantee about nested signals is unclear.  POSIX does 
not appear give any guidance.  On aarch64 SIGSTKSZ is defined to 8192, which is 
the default for architectures not overriding it (both in glibc and the kernel 
headers).

--

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



[issue22505] Expose an Enum object's serial number

2014-09-28 Thread Eli Bendersky

Eli Bendersky added the comment:

 I could continue the discussion about databases, but it feels like a waste 
 of time to me. The main principle is: If something has an important property 
 (in this case an enum object's numerical value), it should be publicly 
 exposed. Period. No need to spend hours discussing if and how that property 
 will be used. They always end up getting used somehow-- The only question is 
 whether the people using them need to obtain them through private variables 
 for years until the developers finally understand that the property needs to 
 be exposed publicly. If you want to go through that, be my guest.


This kind of attitude is not welcome in the core Python development community. 
Please keep the discussion courteous and stick to technical arguments.

FWIW I fully agree with Barry and Ethan here.

--

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



[issue22510] Faster bypass re cache when DEBUG is passed

2014-09-28 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Here is a patch which gets rid of small performance regression introduced by 
issue20426 patch. No need to check flags before cache lookup because patterns 
with the DEBUG flag are newer cached.

$ ./python -m timeit -s import re -- re.match('', '')

Before patch: 9.08 usec per loop
After patch: 8 usec per loop

--
components: Library (Lib), Regular Expressions
files: re_debug_cache_faster.patch
keywords: patch
messages: 227758
nosy: ezio.melotti, mrabarnett, pitrou, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Faster bypass re cache when DEBUG is passed
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file36749/re_debug_cache_faster.patch

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



[issue22133] IDLE: Set correct WM_CLASS on X11

2014-09-28 Thread Saimadhav Heblikar

Saimadhav Heblikar added the comment:

I don't know how dialogs and calltip popups behave on Gnome Shell

Can you reply what behaviour you want to confirm?
If you meant, grouping  - Toplevels like ClassBrowser, PathBrowser etc are 
always grouped as single unit in the Activity Bar. But, in the popup which 
you get for Alt + Tab, they are displayed as 2 different applications - 
stress on different. For example, if I have two different windows of Google 
Chrome open, they are listed as a single application, both windows nested under 
a single logo. With IDLE, its two different applications.

tkMessageBox and tkFileDialog usage like in open_class_browser() and Save 
As change the title of in the Activity Bar and Alt+Tab menu to tkFDialog. 
I am not sure if there is a way to pass class_ argument in such a situation.

Just a suggestion, can we use sys.version_info to get Python major version to 
have uniform code?

--

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



[issue10510] distutils upload/register should use CRLF in HTTP requests

2014-09-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6375bf34fff6 by R David Murray in branch '3.4':
#10510: Fix bug in forward port of 2.7 distutils patch.
https://hg.python.org/cpython/rev/6375bf34fff6

New changeset 90b07d422bd9 by R David Murray in branch 'default':
#10510: Fix bug in forward port of 2.7 distutils patch.
https://hg.python.org/cpython/rev/90b07d422bd9

--

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



[issue22511] Assignment Operators behavior within a user-defined function and arguments being passed by reference or value

2014-09-28 Thread Mohammed Mustafa Al-Habshi

New submission from Mohammed Mustafa Al-Habshi:

hello every one,

I was trying to understand the behavior of passing arguments in a function to 
differentiate how we can pass argument by value. Though it is a technique 
matter. However, the behavior of assignment operator += 
when using it with a list is more to toward behavior to the append method of 
the list object, and not like a a normal assignment. 

This causes a confusing when teach python language concepts , especially the 
behavior of += with numerical data types is list normal assignment and the 
parameters are then passed by value.

The issue is more related to data type mutability. and I believe assignment 
operator should be synthetically more compatible with normal assignment.


 inline code example -
def pass_(x):
# x is list type
print Within the function
print  x was  , x
#x = x + [50] #  here x is passed by value
x += [50]#  here x is passed by reference.
#x.append(50)   #  here x is passed by reference.
print  x then is  , x
return

x = [12,32,12]
pass_(x)
print \n x out of the function is  , x

--
messages: 227761
nosy: alhabshi3k
priority: normal
severity: normal
status: open
title: Assignment Operators behavior within a user-defined function and 
arguments being passed by reference or value
type: behavior
versions: Python 2.7

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



[issue22511] Assignment Operators behavior within a user-defined function and arguments being passed by reference or value

2014-09-28 Thread Mark Dickinson

Mark Dickinson added the comment:

I'm afraid this bug tracker isn't really the appropriate place for this 
discussion, so I'm going to close this issue.  You could open a discussion on 
the Python mailing list, here: 
https://mail.python.org/mailman/listinfo/python-list.

--
nosy: +mark.dickinson
resolution:  - not a bug
status: open - closed

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



[issue22511] Assignment Operators behavior within a user-defined function and arguments being passed by reference or value

2014-09-28 Thread Steven D'Aprano

Steven D'Aprano added the comment:

I'm afraid that you are mistaken about Python's argument passing semantics. 
Arguments are *always* passed using the same semantics, and *never* using 
either pass-by-value or pass-by-reference.

These two pages may help you understand why Python's argument passing semantics 
are always the same:

http://import-that.dreamwidth.org/1130.html
http://effbot.org/zone/call-by-object.htm

(Unfortunately, although this is the standard argument passing semantics used 
in many modern languages, including Python, Java and Ruby, there is no standard 
name for it.)

Augmented assignment is sometimes a little tricky to understand, because it may 
use both in-place mutation and assignment at the same time. But arguments are 
still always passed the same way.

If you have a concrete suggestion for a documentation change that will help 
reduce this confusion, please tell us. Otherwise, I think this issue can be 
closed. This is not the right place to discuss Python's argument passing 
semantics, but if you would like to discuss it, I'm happy to do so in the 
comments on the first link, or on the python-l...@python.org mailing list.

--
nosy: +steven.daprano

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



[issue22511] Assignment Operators behavior within a user-defined function and arguments being passed by reference or value

2014-09-28 Thread R. David Murray

R. David Murray added the comment:

See also issue 20135.

--
nosy: +r.david.murray

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



[issue4093] add gc/memory management tests to pybench

2014-09-28 Thread Mark Lawrence

Mark Lawrence added the comment:

Antoine or Marc-Andre will either of you follow up on this as the last message 
msg74608 was nearly six years ago?

--
nosy: +BreamoreBoy

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




[issue9313] distutils error on MSVC older than 8

2014-09-28 Thread Francis MB

Francis MB added the comment:

Hi Éric,
are the changes to distutils2 applied? could the issue be closed (has 
resolution:fixed) or is something to be done?

--
nosy: +francismb

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



[issue9313] distutils error on MSVC older than 8

2014-09-28 Thread Mark Lawrence

Mark Lawrence added the comment:

Distutils2 is dead.

--
components:  -Distutils2
nosy: +BreamoreBoy, dstufft

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



[issue22379] Empty exception message of str.join

2014-09-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0ad19246d16d by Benjamin Peterson in branch '2.7':
give exception a nice message (closes #22379)
https://hg.python.org/cpython/rev/0ad19246d16d

New changeset ab1570d0132d by Benjamin Peterson in branch '3.4':
check that exception messages are not empty (#22379)
https://hg.python.org/cpython/rev/ab1570d0132d

New changeset 78727a11b5ae by Benjamin Peterson in branch 'default':
merge 3.4 (#22379)
https://hg.python.org/cpython/rev/78727a11b5ae

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

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



[issue2148] nis module not supporting group aliases

2014-09-28 Thread Mark Lawrence

Mark Lawrence added the comment:

I think this should be an enhancement request.

--
components: +Library (Lib) -None
nosy: +BreamoreBoy, jcea
type: behavior - enhancement
versions: +Python 3.5 -Python 2.7, Python 3.1, Python 3.2

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



[issue9313] distutils error on MSVC older than 8

2014-09-28 Thread Francis MB

Francis MB added the comment:

 Distutils2 is dead.
I wasn't aware of that and I'm sorry for that. In that case that issue can IMHO 
be closed.

--

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



[issue9313] distutils error on MSVC older than 8

2014-09-28 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
status: open - closed

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



[issue10007] Visual C++ cannot build _ssl and _hashlib if newer OpenSSL is placed in $(dist) directory (PCBuild)

2014-09-28 Thread Mark Lawrence

Mark Lawrence added the comment:

Has this been superseded by the many improvements made to the Windows build 
system over the last few months or even years?

--
nosy: +BreamoreBoy, steve.dower, zach.ware
type:  - behavior

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



[issue20742] 2to3 zip fixer doesn't fix for loops.

2014-09-28 Thread RobertG

RobertG added the comment:

As far as a non contrived example, see http://bugs.python.org/issue21628, which 
was marked as a duplicate of this bug.

This bug is the main thing preventing me from using 2to3, so I think it is a 
real issue.

--

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



[issue1382562] --install-base not honored on win32

2014-09-28 Thread Mark Lawrence

Mark Lawrence added the comment:

I'd try to reproduce this but with so little data to go on I don't understand 
how.  Can somebody fill the gaps?

--
components: +Windows -Distutils2
nosy: +BreamoreBoy, dstufft
versions: +Python 3.4, Python 3.5 -3rd party, Python 3.1, Python 3.2

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



[issue9643] urllib2 - Basic, Digest Proxy Auth Handlers failure will give 401 code instead of 407

2014-09-28 Thread Mark Lawrence

Mark Lawrence added the comment:

Slipped under the radar?

--
components: +Library (Lib)
nosy: +BreamoreBoy
type:  - behavior
versions: +Python 3.4, Python 3.5 -Python 3.2

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



[issue1160328] urllib2 post error when using httpproxy

2014-09-28 Thread Mark Lawrence

Mark Lawrence added the comment:

From msg60698 The first URL hangs for me, using Firefox.  Especially if
this depends on using a proxy which I do not have permission
to use, I have no idea how to reproduce this.  I certainly have no idea on how 
to reproduce this so unless someone can the only option I see is to close as 
out of date.

--
nosy: +BreamoreBoy
versions: +Python 3.4, Python 3.5 -Python 3.1, Python 3.2

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



[issue1565509] Repair or Change installation error

2014-09-28 Thread Mark Lawrence

Mark Lawrence added the comment:

I don't recall ever seeing a problem like this, but then I haven't used IE in 
years and don't intend using it now just for this.

--
components: +Windows
nosy: +BreamoreBoy, steve.dower, zach.ware
versions: +Python 3.4, Python 3.5 -Python 3.1, Python 3.2

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



[issue22512] 'test_distutils.test_bdist_rpm' causes creation of directory '.rpmdb' on home dir

2014-09-28 Thread Francis MB

New submission from Francis MB:

Running the test suite or 'test_distutils' triggers the creation of the 
directory '.rpmdb'. I noticed that because somehow that directory was bad 
formed and got errors while running the test suite:

error: db5 error(-30969) from dbenv-open: BDB0091 DB_VERSION_MISMATCH:
Database environment version mismatch
error: cannot open Packages index using db5 -  (-30969)
error: cannot open Packages database in /home/ci/.rpmdb
error: db5 error(-30969) from dbenv-open: BDB0091 DB_VERSION_MISMATCH:
Database environment version mismatch
error: cannot open Packages index using db5 -  (-30969)
error: cannot open Packages database in /home/ci/.rpmdb
After moving that directory and running the suite again the directory 
reappeared (but that time, and since then, no errors occurred). It seems that 
'test_distutils.test_bdist_rpm' triggers that behavior. This seems to be due 
'rpm' having it so configured [1]. In my case:

$ rpm -v --showrc | grep '.rpmdb'
-14: _dbpath%(bash -c 'echo ~/.rpmdb')

Here is a patch that confines the creation of this directory to the temporal 
test directory.

Regards,
francis


[1] https://bugs.launchpad.net/rpm/+bug/1069350

--
components: Distutils, Tests
files: confine_hidden_rpmdb_dir_creation.patch
keywords: patch
messages: 22
nosy: dstufft, eric.araujo, francismb
priority: normal
severity: normal
status: open
title: 'test_distutils.test_bdist_rpm' causes creation of directory '.rpmdb' on 
home dir
type: behavior
versions: Python 3.5
Added file: 
http://bugs.python.org/file36750/confine_hidden_rpmdb_dir_creation.patch

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



[issue678264] test_resource fails when file size is limited

2014-09-28 Thread Mark Lawrence

Mark Lawrence added the comment:

Can somebody take a look at this please.  See also #9917.

--

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



[issue9350] add remove_argument_group to argparse

2014-09-28 Thread paul j3

paul j3 added the comment:

If the empty argument group has a 'description' it is displayed.  For example 
with positionals group that I mentioned earlier:

 parser = argparse.ArgumentParser()
 parser._action_groups[0].description = 'test'
 parser.print_help()

produces

usage: ipython [-h]

positional arguments:
  test

optional arguments:
   -h, --help  show this help message and exit

So the user can fix this empty group display issue by setting this 
'description' value to None.

--

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



[issue20858] Enhancements/fixes to pure-python datetime module

2014-09-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5313b4c0bb6c by Alexander Belopolsky in branch 'default':
Closes issue #20858: Enhancements/fixes to pure-python datetime module
https://hg.python.org/cpython/rev/5313b4c0bb6c

--
nosy: +python-dev

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



[issue8988] import + coding = failure (3.1.2/win32)

2014-09-28 Thread Mark Lawrence

Mark Lawrence added the comment:

Works for me using 3.4.1 and 3.5.0a0.

--
nosy: +BreamoreBoy

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



[issue8747] Autoconf tests in python not portably correct

2014-09-28 Thread Mark Lawrence

Mark Lawrence added the comment:

From msg112274 if these platforms can't function with these preprocessor 
defines, the platforms need to be fixed -- not python. so I believe this can 
be closed.

--
nosy: +BreamoreBoy

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



[issue10036] compiler warnings for various modules on Linux buildslaves

2014-09-28 Thread Mark Lawrence

Mark Lawrence added the comment:

From msg119142 I suspect we don't really fix libffi compile warnings because 
... so it looks as if we wouldn't bother anyway, plus these compiler warnings 
are years old so can this be closed as out of date?

--
nosy: +BreamoreBoy

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



[issue9943] TypeError message became less helpful in Python 2.7

2014-09-28 Thread Mark Lawrence

Mark Lawrence added the comment:

3.4.1 and 3.5.0a0 give the same message as 2.6.  I don't have 2.7 to see what 
it currently does.

--
nosy: +BreamoreBoy

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



[issue22512] 'test_distutils.test_bdist_rpm' causes creation of directory '.rpmdb' on home dir

2014-09-28 Thread R. David Murray

R. David Murray added the comment:

Thanks for the report and patch.

You should use test.support.EnvironmentVarGuard to make the environment change 
temporary.

--
nosy: +r.david.murray
versions: +Python 3.4

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



[issue20858] Enhancements/fixes to pure-python datetime module

2014-09-28 Thread Benjamin Peterson

Changes by Benjamin Peterson benja...@python.org:


--
resolution:  - fixed
status: open - closed

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



[issue9943] TypeError message became less helpful in Python 2.7

2014-09-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Still TypeError: f() takes exactly 0 arguments (2 given).  I consider the 
2.6/3.x message better (more accurate).  But at this point, I could be 
persuaded to leave 2.7 alone and close this.

--

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



[issue9943] TypeError message became less helpful in Python 2.7

2014-09-28 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Yes, the argument error messages for 2.x are all not very good. Note this issue 
was fixed once and for all in Python 3:

% python3 x.py
Traceback (most recent call last):
  File x.py, line 3, in module
f(hello, keyword=True)
TypeError: f() takes 0 positional arguments but 1 was given

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

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



[issue21159] configparser.InterpolationMissingOptionError is not very intuitive

2014-09-28 Thread Łukasz Langa

Łukasz Langa added the comment:

So the diff would look like this (please find it attached). It does two things:

* changes messages on InterpolationMissingOptionError and 
InterpolationDepthError to be more helpful to the end user
* fixes rawval to actually hold the raw value of an option and not the rest 
after substitution like before

Fred, R. David, I have two questions for you:

* the reliable method of getting the arguments of both exceptions is the .args 
attribute; this didn't change but the message did. It's unlikely anybody would 
be parsing the old message string, but even if there was I'm inclined to treat 
any code doing so as broken by design. Do you agree?

* without the diff, the `rawval` argument in those exceptions holds a value 
that exposes internal implementation and is not generally useful for user code. 
It wasn't exposed directly as an attribute in those exceptions (`section`, 
`option` and `reference` are). That being said, fixing this is a change in 
logic of sorts. Do you see any danger of third-party code relying on the old 
behaviour?

Actually, I have a hypothetical third question:

* Should I make sure that those exceptions are unpicklable by older releases of 
Python 3?

I'm asking because if there's no such expectation, we could add .rawval as a 
direct attribute to InterpolationMissingOptionError, and introduce `reference` 
to InterpolationDepthError (currently the exception message can say that 
option O in section S contains an interpolation key that cannot be 
substituted but it doesn't say which interpolation key).

Anyway, the first two questions are most important because they basically 
decide whether we can change the exceptions at all at this point. I'm inclined 
to say yes, Python 3 did that with a number of exceptions both built-in and 
in the standard library.

--
keywords: +patch
nosy: +fdrake
stage: needs patch - patch review
Added file: http://bugs.python.org/file36751/issue21159.diff

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