[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 

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


--
status: open -> closed

___
Python tracker 

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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



[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 

___
___
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 
f("hello", keyword=True)
TypeError: f() takes 0 positional arguments but 1 was given

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

___
Python tracker 

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

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