[issue25935] OrderedDict prevents garbage collection if a circulary referenced class is used as key

2015-12-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

An OrderedDict owns two references to every key (as a dict and from a linked 
list). Therefore it should visit it twice in tp_traverse.

Proposed patch fixes garbage collection for OrderedDict. It also rewrites 
OrderedDict clearing in more reentrant form (a linked list is detached from an 
OrderedDict before deallocating its nodes that can trigger executing user code).

--
keywords: +patch
stage:  -> patch review
versions: +Python 3.6
Added file: http://bugs.python.org/file41441/odict_traverse.patch

___
Python tracker 

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



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2015-12-28 Thread Ezio Melotti

Ezio Melotti added the comment:

Applied to default in 1472c08d9c23.
Thanks Navneet for the patch!

--
assignee: pitrou -> ezio.melotti
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type: behavior -> enhancement
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue18543] urllib.parse.urlopen shouldn't ignore installed opener when called with any ca* argument

2015-12-28 Thread David Ford (FirefighterBlu3)

David Ford (FirefighterBlu3) added the comment:

can we get a review on this please? i'd love to move forward and get the fixes 
in place.

--
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



[issue19511] lib2to3 Grammar file is no longer a Python 3 superset

2015-12-28 Thread Ezio Melotti

Ezio Melotti added the comment:

I created #25967 to keep track of the devguide issue, so I'm going to close 
this.

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



[issue25968] Cannot import modules out of zip file with extended-length path on windows

2015-12-28 Thread Chris Moore

New submission from Chris Moore:

To reproduce, put a python module in a zip file (I have been using wheels but I 
assume any module in a zip file will have the same error?) , add the absolute 
extended-length path to sys.path (add '?\\' to the front of the normal 
absolute path, so '?\\c:\\Users\\cc\\test.zip' instead of 
'c:\\Users\\cc\\test.zip'), then attempt to import a module that is contained 
in the zip file.

I have seen this issue so far on 3.4.3 and 3.5.1.  I have not tested 3.4.4 yet.

Adding directories that are extended-length paths to sys.path does allow 
importing modules contained in those directories, and of course using a non 
extended-length path to a zip file works as long as that path contains less 
than 260 characters.

--
components: Interpreter Core, Windows
messages: 257136
nosy: Chris Moore, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Cannot import modules out of zip file with extended-length path on 
windows
type: behavior
versions: Python 3.4, Python 3.5

___
Python tracker 

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



[issue25958] Implicit ABCs have no means of "anti-registration"

2015-12-28 Thread Andrew Barnert

Andrew Barnert added the comment:

Hashable and Awaitable already treat None (actually any falsey value) as not 
implementing the special method, and blocking any superclass implementation, in 
their __subclasshook__. (This only blocks implicit subclassing--anything that 
actually directly or indirectly inherits from or registers with Hashable is 
still Hashable even if it sets __hash__ = None.)

Coroutine, AsyncIterable, AsyncIterator, Iterable, Iterator, Generator, Sized, 
Container, and Callable treat None as an implementation.

http://bugs.python.org/file41440/cpython-iter-patch.diff for #25864 changes 
Iterable to work like Hashable, but doesn't touch any of the other types.

To fix this in general, just apply the same change to the other implicit ABCs 
(and probably factor out the logic instead of repeating it that many more 
times).

But I'm not sure a general fix is needed here. The special methods for those 
other types don't have a base class and/or fallback implementation to block the 
way __hash__, __iter__, and __reversed__ do (except for __call__ on 
metaclasses, but I can't imagine why you'd want a metaclass that isn't 
callable), so there's no need to set them to None to block that, so the problem 
should never come up.

--

___
Python tracker 

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



[issue25447] TypeError invoking deepcopy on lru_cache

2015-12-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
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



[issue25928] Add Decimal.as_integer_ratio()

2015-12-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f3b09c269af0 by Stefan Krah in branch 'default':
Issue #25928: Add Decimal.as_integer_ratio(). Python parts and docs by
https://hg.python.org/cpython/rev/f3b09c269af0

--
nosy: +python-dev

___
Python tracker 

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



[issue24071] Python 2.7.8, 2.7.9 re.MULTILINE failure

2015-12-28 Thread Ezio Melotti

Ezio Melotti added the comment:

See #11957.

--

___
Python tracker 

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



[issue25928] Add Decimal.as_integer_ratio()

2015-12-28 Thread Stefan Krah

Stefan Krah added the comment:

Hopefully I wasn't moving too fast, but I won't have time in the next
days/weeks.

Serhiy and Alexander (#8947) would prefer more homogeneous error
messages and docstrings between float/pydecimal/cdecimal.

I wouldn't mind a patch in another issue (no argument clinic!),
provided that we agree on something and have input from the
native English speakers.


Thanks for the review!

--

___
Python tracker 

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



[issue25863] ISO-2022 seeking forgets state

2015-12-28 Thread Ezio Melotti

Ezio Melotti added the comment:

I confirmed the problem on default (3.6) and verified that it works as expected 
using utf-8 instead of iso-2022-jp.
The code in the above message should be converted into a unittest, and related 
codecs should be checked as well.
The problem is probably in Modules/cjkcodecs/_codecs_iso2022.c

--
components: +Extension Modules
stage: needs patch -> test needed

___
Python tracker 

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



[issue25940] SSL tests failed due to expired svn.python.org SSL certificate

2015-12-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9d0c15425b59 by Stefan Krah in branch 'default':
Issue #25940: Make buildbots usable again until a solution is found.
https://hg.python.org/cpython/rev/9d0c15425b59

--
nosy: +python-dev

___
Python tracker 

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



[issue24725] test_socket testFDPassEmpty fails on OS X 10.11 DP with "Cannot allocate memory"

2015-12-28 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for  the patch, Jeff!

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



[issue24725] test_socket testFDPassEmpty fails on OS X 10.11 DP with "Cannot allocate memory"

2015-12-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b4c6631737b3 by Brett Cannon in branch 'default':
Issue #24725: Skip the test_socket.testFDPassEmpty on OS X.
https://hg.python.org/cpython/rev/b4c6631737b3

--
nosy: +python-dev

___
Python tracker 

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



[issue25234] test_eintr.test_os_open hangs under Xcode 7

2015-12-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7fc1296d1acf by Brett Cannon in branch 'default':
Issue #25234: Skip test_eintr.test_os_open under OS X.
https://hg.python.org/cpython/rev/7fc1296d1acf

--
nosy: +python-dev

___
Python tracker 

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



[issue25234] test_eintr.test_os_open hangs under Xcode 7

2015-12-28 Thread Brett Cannon

Changes by Brett Cannon :


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



[issue25930] Document that os.remove is semantically identical to os.unlink

2015-12-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 81c7b26f5b4e by Brett Cannon in branch 'default':
Issue #25930: Document that os.unlink and os.remove are *semantically* 
identical.
https://hg.python.org/cpython/rev/81c7b26f5b4e

--
nosy: +python-dev

___
Python tracker 

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



[issue25930] Document that os.remove is semantically identical to os.unlink

2015-12-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9f13322eba8e by Brett Cannon in branch '3.5':
Backport of fix for issue #25930
https://hg.python.org/cpython/rev/9f13322eba8e

New changeset e082519bc2c8 by Brett Cannon in branch 'default':
Merge for backport  of fix for issue #25930
https://hg.python.org/cpython/rev/e082519bc2c8

--

___
Python tracker 

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



[issue25930] Document that os.remove is semantically identical to os.unlink

2015-12-28 Thread Brett Cannon

Brett Cannon added the comment:

I tweaked Swati's patch as there was another spot where the "identical" line 
was used. Thanks to everyone who helped out with this!

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



[issue25802] Finish deprecating load_module()

2015-12-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ab0e60a36368 by Brett Cannon in branch 'default':
Issue #25802: Deprecate load_module() on importlib.machinery.SourceFileLoader 
and SourcelessFileLoader.
https://hg.python.org/cpython/rev/ab0e60a36368

--
nosy: +python-dev

___
Python tracker 

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



[issue25802] Finish deprecating load_module()

2015-12-28 Thread Brett Cannon

Brett Cannon added the comment:

I'm leaving this issue open until I add an Examples section to the importlib 
docs. I will use the imp module as a guide of what to document.

--
resolution:  -> fixed
stage: test needed -> resolved

___
Python tracker 

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



[issue25972] All Windows buildbots fail compile/clean

2015-12-28 Thread Stefan Krah

New submission from Stefan Krah:

Not sure what is happening, but all Windows buildbots fail compile/clean.

--
messages: 257161
nosy: skrah, zach.ware
priority: normal
severity: normal
status: open
title: All Windows buildbots fail compile/clean

___
Python tracker 

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



[issue25972] All Windows buildbots fail compile/clean

2015-12-28 Thread Stefan Krah

Stefan Krah added the comment:

Serhiy, could you take a look if it's related to

  
http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/7107
 ?

This seems to be the first failure.

--

___
Python tracker 

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



[issue25972] All Windows buildbots fail compile/clean

2015-12-28 Thread Stefan Krah

Changes by Stefan Krah :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



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

2015-12-28 Thread lee
I'm still stuck on this, any Rescuer?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25963] strptime not parsing some timezones

2015-12-28 Thread Utkonos

New submission from Utkonos:

I get a ValueError when running the following through strptime:

datetime.datetime.strptime('(CST)', '(%Z)')

But the following works:
datetime.datetime.strptime('(EST)', '(%Z)')

PST and MST also trigger the same exception.

--
messages: 257108
nosy: belopolsky, brett.cannon, utkonos
priority: normal
severity: normal
status: open
title: strptime not parsing some timezones
type: behavior
versions: Python 3.5

___
Python tracker 

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



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

2015-12-28 Thread Prince Udoka
bu i have come up with a solution, that will work but encounter a problem in 
the set, giving set not manipulated correctly:
def manipulate_data(kind, data): 
if kind == 'list': 
return list(data)[::-1] 
elif kind == 'set':
return set(data)
elif kind == 'dictionary': 
return dict.keys(data) 
manipulate_data("list", range(1,6)) 
manipulate_data("set", {"a", "b", "c", "d", "e", "ANDELA", "TIA", "AFRICA"}) 
manipulate_data("dictionary", {"apples": 23, "oranges": 15, "mangoes": 3, 
"grapes": 45})

the thing now is the function to use in adding "ANDELA", "TIA", "AFRICA"
pls 4give my use of language
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2015-12-28 Thread lee
On Monday, December 28, 2015 at 10:38:47 AM UTC+1, Ben Finney wrote:
> lee writes:
> 
> > I'm still stuck on this, any Rescuer?
> 
> You appear to be yet another different person asking about this homework
> assignment.
> 
> Please:
> 
> * This forum is not suitable for the kind of close attention to very
>   basic learning. Take this discussion to the 'tutor' forum
>   , which is much
>   better focussed on close collaborative mentoring of beginners.
> 
> * Choose a single spokesperson, and have that person provide continuity
>   in the discussion by responding consistently from the same email
>   address.
> 
> * Learn proper email etiquette (plain text messages, quoted material,
>   give sufficient context, etc.) to help the community understand what
>   each message is about.
> 
> -- 
>  \"Holy uncanny photographic mental processes, Batman!" --Robin |
>   `\   |
> _o__)  |
> Ben Finney


if you have followed this thread from the beginning , you should have  been 
aware that different people have contributed in asking/answering on this same 
discussion and nobody has any problem with that, so please if someone ( same or 
different) needs help on a single problem , allow them contribute, they could 
be the source of getting the problem solved. thanks prince( botic) , will try 
you suggestion
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25965] decimal.py: issues reprted by pychecker

2015-12-28 Thread Martin Mokrejs

New submission from Martin Mokrejs:

I use pychecker to check my code. It complains about decimal.py from 
python-2.7.10 itself:

[system path]/decimal.py:1345: INTERNAL ERROR -- STOPPED PROCESSING FUNCTION --
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/pychecker/warn.py", line 
242, in _checkFunction
_checkCode(code, codeSource)
  File "/usr/lib64/python2.7/site-packages/pychecker/warn.py", line 
155, in _checkCode
raise NotImplementedError('No DISPATCH member for op %r' % op)
NotImplementedError: No DISPATCH member for op 28

[system path]/decimal.py:1546: Invalid arguments to (__floordiv__), got 3, 
expected 2
[system path]/decimal.py:1574: Invalid arguments to (__rfloordiv__), got 3, 
expected 2
[system path]/decimal.py:1997: INTERNAL ERROR -- STOPPED PROCESSING FUNCTION --
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/pychecker/warn.py", line 
242, in _checkFunction
_checkCode(code, codeSource)
  File "/usr/lib64/python2.7/site-packages/pychecker/warn.py", line 
155, in _checkCode
raise NotImplementedError('No DISPATCH member for op %r' % op)
NotImplementedError: No DISPATCH member for op 28

[system path]/decimal.py:2173: Invalid arguments to (__pow__), got 4, expected 3
[system path]/decimal.py:2389: Invalid arguments to (__rpow__), got 3, expected 
2
[system path]/decimal.py:2692: INTERNAL ERROR -- STOPPED PROCESSING FUNCTION --
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/pychecker/warn.py", line 
242, in _checkFunction
_checkCode(code, codeSource)
  File "/usr/lib64/python2.7/site-packages/pychecker/warn.py", line 
155, in _checkCode
raise NotImplementedError('No DISPATCH member for op %r' % op)
NotImplementedError: No DISPATCH member for op 28

--
components: Library (Lib)
messages: 257111
nosy: mmokrejs
priority: normal
severity: normal
status: open
title: decimal.py: issues reprted by pychecker
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



[issue25965] decimal.py: issues reported by pychecker

2015-12-28 Thread Martin Mokrejs

Changes by Martin Mokrejs :


--
title: decimal.py: issues reprted by pychecker -> decimal.py: issues reported 
by pychecker

___
Python tracker 

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



[issue20607] multiprocessing cx_Freeze windows GUI bug (& easy fixes)

2015-12-28 Thread Mark Summerfield

Mark Summerfield added the comment:

Thanks Davin. I have indeed moved to 3.4 which does not seem to have the bug. 
(I can't move to 3.5 because I can't install 32- and 64-bit versions as I can 
with 3.4 due to the new installers -- or rather I can, but this confuses the 
pywin32 and apsw installers both of which I need.)

--

___
Python tracker 

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



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

2015-12-28 Thread Prince Udoka
wow thats true the code did not work
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2015-12-28 Thread Ben Finney
lee  writes:

> I'm still stuck on this, any Rescuer?

You appear to be yet another different person asking about this homework
assignment.

Please:

* This forum is not suitable for the kind of close attention to very
  basic learning. Take this discussion to the ‘tutor’ forum
  , which is much
  better focussed on close collaborative mentoring of beginners.

* Choose a single spokesperson, and have that person provide continuity
  in the discussion by responding consistently from the same email
  address.

* Learn proper email etiquette (plain text messages, quoted material,
  give sufficient context, etc.) to help the community understand what
  each message is about.

-- 
 \“Holy uncanny photographic mental processes, Batman!” —Robin |
  `\   |
_o__)  |
Ben Finney

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


[issue25964] optparse.py:1668: (file) shadows builtin

2015-12-28 Thread Martin Mokrejs

Martin Mokrejs added the comment:

But couldn't somebody just rename the variable for example to _file? I see 
optparse also in python-3.5 so I did not think it could be Deprecated.

--

___
Python tracker 

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



[issue25964] optparse.py:1668: (file) shadows builtin

2015-12-28 Thread SilentGhost

SilentGhost added the comment:

None of this warnings highlights a real issue. Furthermore, optparse module is 
deprecated and you'd be better off using argparse instead.

--
components: +Library (Lib)
nosy: +SilentGhost
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: enhancement -> behavior

___
Python tracker 

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



[issue23551] IDLE to provide menu link to PIP gui.

2015-12-28 Thread Aivar Annamaa

Aivar Annamaa added the comment:

In case "Open system shell" happens someday, here's my take on this: 
https://bitbucket.org/plas/thonny/src/master/thonny/plugins/system_shell/

It's a plugin for my beginners' IDE Thonny (http://thonny.cs.ut.ee). It creates 
a menu item which opens system terminal with current interpreter's binary 
folder(s) prepended to the path. As there may be several Python commands on 
path (eg. python and python3 in /usr/bin) and short pip command may be on path 
only for another version, a script gets automatically executed in this new 
terminal, which detects and tells user the commands to use (see attached 
screenshot)

--
Added file: http://bugs.python.org/file41437/SystemShellForPython35.png

___
Python tracker 

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



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

2015-12-28 Thread Prince Udoka
def manipulate_data(kind, data): 
if kind == 'list': 
return list(data)[::-1] 
elif kind == 'set':
return set(data)
elif kind == 'dictionary': 
return dict.keys(data) 
manipulate_data("list", range(1,6)) 
manipulate_data("set", {"a", "b", "c", "d", "e",}) 
manipulate_data("dictionary", {"apples": 23, "oranges": 15, "mangoes": 3, 
"grapes": 45})
just use a function to add "ANDELA", "TIA", "AFRICA" to the set, the u are don
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25964] optparse.py:1668: (file) shadows builtin

2015-12-28 Thread SilentGhost

SilentGhost added the comment:

The deprecation warning is clearly displayed at the top of the module 
documentation: https://docs.python.org/3/library/optparse.html 

Regarding variable names: it is not an issue and pychecker is simply mistaken 
here.

--

___
Python tracker 

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



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

2015-12-28 Thread Ben Finney
Prince Udoka  writes:

> pls 4give my use of language

Your messages are becoming quite disruptive and inconsiderate of your
readers.

Please take more care with each message, don't bombard us with a series
of poorly-thought-out, hyper-abbreviated messages.

Please take extreme-beginner discussions to the ‘tutor’
 forum.

-- 
 \   “All progress has resulted from people who took unpopular |
  `\  positions.” —Adlai Stevenson |
_o__)  |
Ben Finney

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


[issue25964] optparse.py:1668: (file) shadows builtin

2015-12-28 Thread Martin Mokrejs

New submission from Martin Mokrejs:

I use pychecker for checking my python code. Seems optparse.py distributed with 
python-2.7 could be improved as well:

[system path]/optparse.py:1191: Function (__init__) has too many arguments (11)
[system path]/optparse.py:1206: Local variable (version) shadows global defined 
on line 10 in file my-test-code.py
[system path]/optparse.py:1400: Local variable (stop) not used
[system path]/optparse.py:1668: (file) shadows builtin


Interestingly, my version variable is overridden by one from optparse.py. But 
more worrisome is the 'file' variable name.

--
messages: 257110
nosy: mmokrejs
priority: normal
severity: normal
status: open
title: optparse.py:1668: (file) shadows builtin
type: enhancement
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



[issue25939] _ssl.enum_certificates() fails with ERROR_ACCESS_DENIED if python.exe run with low integrity level

2015-12-28 Thread Eryk Sun

Eryk Sun added the comment:

Testing based on integrity level doesn't require creating a child process. I'm 
attaching a ctypes-based example that defines a context manager that 
temporarily sets the integrity level of the current thread's impersonation 
token. 

To get the impersonation token, I initially tried using ImpersonateSelf / 
RevertToSelf, but I was unhappy with how it fails for nested contexts since 
RevertToSelf always switches back to the process token. I opted to instead call 
OpenThreadToken / OpenProcessToken, DuplicateTokenEx, and SetThreadToken. 

I chose to use the WELL_KNOWN_SID_TYPE enum values to get the label SIDs via 
CreateWellKnownSid. Note that I omitted the GetLengthSid call when passing the 
size of the TOKEN_MANDATORY_LABEL to SetTokenInformation. It only needs the 
size of the primary buffer. The SID it points at is a sized structure (i.e. 
SubAuthorityCount). 

Example:

import winreg

HKLM = winreg.HKEY_LOCAL_MACHINE
subkey = r'SOFTWARE\Microsoft\SystemCertificates\CA'
access = winreg.KEY_ALL_ACCESS

>>> key = winreg.OpenKey(HKLM, subkey, 0, access)
>>> print(key)

>>> key.Close()

Repeat with low integrity level:

>>> with token_integrity_level('low'):
...  winreg.OpenKey(HKLM, subkey, 0, access)
...
Traceback (most recent call last):
  File "", line 2, in 
PermissionError: [WinError 5] Access is denied 

A context manager like this could be added to the test helper module that was 
proposed in issue 22080. It could also add the ability to impersonate with a 
restricted copy of the process token -- like what UAC creates. psexec -l does 
this by calling CreateRestrictedToken followed by SetInformationToken for the 
TokenIntegrityLevel and TokenDefaultDacl.

--
Added file: http://bugs.python.org/file41439/integrity_level.py

___
Python tracker 

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



[issue25935] OrderedDict prevents garbage collection if a circulary referenced class is used as key

2015-12-28 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +eric.snow, serhiy.storchaka

___
Python tracker 

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



[issue25928] Add Decimal.as_integer_ratio()

2015-12-28 Thread Stefan Krah

Stefan Krah added the comment:

Here's a patch. The Python and doc parts are from Mark (#8947).

I did not optimize the normalization yet, in C the code is
less clean and there were some corner cases where the gcd is
actually faster.

--
keywords: +patch
Added file: http://bugs.python.org/file41438/issue25928.diff

___
Python tracker 

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



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

2015-12-28 Thread Mark Lawrence

On 28/12/2015 09:25, lee wrote:

I'm still stuck on this, any Rescuer?



Try running your code at an interactive prompt, or in a debugger, or use 
paper and pencil to trace what the code is actually doing as opposed to 
what you are required to get it to do.


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


[issue25935] OrderedDict prevents garbage collection if a circulary referenced class is used as key

2015-12-28 Thread Tim Graham

Changes by Tim Graham :


--
nosy: +Tim.Graham

___
Python tracker 

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



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

2015-12-28 Thread Joel Goldstick
On Mon, Dec 28, 2015 at 4:53 AM, lee  wrote:

> On Monday, December 28, 2015 at 10:38:47 AM UTC+1, Ben Finney wrote:
> > lee writes:
> >
> > > I'm still stuck on this, any Rescuer?
> >
> > You appear to be yet another different person asking about this homework
> > assignment.
> >
> > Please:
> >
> > * This forum is not suitable for the kind of close attention to very
> >   basic learning. Take this discussion to the 'tutor' forum
> >   , which is much
> >   better focussed on close collaborative mentoring of beginners.
> >
> > * Choose a single spokesperson, and have that person provide continuity
> >   in the discussion by responding consistently from the same email
> >   address.
> >
> > * Learn proper email etiquette (plain text messages, quoted material,
> >   give sufficient context, etc.) to help the community understand what
> >   each message is about.
> >
> > --
> >  \"Holy uncanny photographic mental processes, Batman!" --Robin |
> >   `\   |
> > _o__)  |
> > Ben Finney
>
>
> if you have followed this thread from the beginning , you should have
> been aware that different people have contributed in asking/answering on
> this same discussion and nobody has any problem with that, so please if
> someone ( same or different) needs help on a single problem , allow them
> contribute, they could be the source of getting the problem solved. thanks
> prince( botic) , will try you suggestion
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Joel Goldstick
http://joelgoldstick.com/stats/birthdays
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25966] Bug in asyncio.corotuines._format_coroutine

2015-12-28 Thread Brett Rosen

New submission from Brett Rosen:

When running some test cases via py.test and using a coroutine created inside 
of cythonized code, I get the following:

   def _format_coroutine(coro):
assert iscoroutine(coro)
coro_name = getattr(coro, '__qualname__', coro.__name__)

filename = coro.gi_code.co_filename
if (isinstance(coro, CoroWrapper)
and not inspect.isgeneratorfunction(coro.func)):
>   filename, lineno = events._get_function_source(coro.func)
E   TypeError: 'NoneType' object is not iterable


This appears to be because this line:

https://github.com/python/asyncio/blob/2a19f9329f4ee710fef7728b316aa4fe1d07dbef/asyncio/coroutines.py#L289

Is expecting to get back two values, but because of:

https://github.com/python/asyncio/blob/master/asyncio/events.py#L35

This it only gets back None.


> /usr/local/lib/python3.4/asyncio/events.py(25)_get_function_source()
-> if _PY34:
(Pdb) func


--
components: asyncio
messages: 257119
nosy: Brett Rosen, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: Bug in  asyncio.corotuines._format_coroutine
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



Re: Converting py files to .exe and .dmg

2015-12-28 Thread Denis McMahon
On Mon, 28 Dec 2015 07:35:18 -0800, Brian Simms wrote:

> I have done a lot of looking around online to find out how to convert
> Python files to .exe and .dmg files, but I am confused. Could someone
> provide pointers/advice as to how I can turn a Python file into a
> Windows .exe and Mac .dmg file.

Python files are scripts, they need to be run by an interpreter.

If you want an executable file, you need to compile them. I don't know if 
this is possible.

Otherwise, if you want to distribute the .py files, then the people you 
distribute them to will need to install a python interpreter on the 
machine they wish to execute them on.

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


[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2015-12-28 Thread Ezio Melotti

Ezio Melotti added the comment:

As far as I understand the two functions exist only for readability (i.e. the 
intention is to check for relative and absolute resolution respectively), but 
since they share the same implementation, the patch defines a single function 
and uses it for both instead of duplicating the code.

--
assignee: pitrou -> ezio.melotti
stage: patch review -> commit review
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue25965] decimal.py: issues reported by pychecker

2015-12-28 Thread R. David Murray

R. David Murray added the comment:

That INTERNAL ERROR would be a bug in pychecker.

--
nosy: +r.david.murray
resolution:  -> third party
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



Converting py files to .exe and .dmg

2015-12-28 Thread Brian Simms
Hi there,

I have done a lot of looking around online to find out how to convert Python 
files to .exe and .dmg files, but I am confused. Could someone provide 
pointers/advice as to how I can turn a Python file into a Windows .exe and Mac 
.dmg file.

Thanks for any help.

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


Re: Converting py files to .exe and .dmg

2015-12-28 Thread Adam M
On Monday, December 28, 2015 at 10:35:41 AM UTC-5, Brian Simms wrote:
> Hi there,
> 
> I have done a lot of looking around online to find out how to convert Python 
> files to .exe and .dmg files, but I am confused. Could someone provide 
> pointers/advice as to how I can turn a Python file into a Windows .exe and 
> Mac .dmg file.
> 
> Thanks for any help.

Please check this website:
http://www.pyinstaller.org/
It should solve your problem.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25957] sockaddr_l2 lacks CID, address type (AF_BLUETOOTH sockets)

2015-12-28 Thread Mike Ryan

Mike Ryan added the comment:

AF_BLUETOOTH also lacks support for hci_channel in sockaddr_hci for BTPROTO_HCI 
sockets:

https://git.kernel.org/cgit/bluetooth/bluez.git/tree/lib/hci.h?h=5.37#n2340

This feature has been present in BlueZ since 2010:

https://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=12d02e7f

(Note that the latest BlueZ release includes a total of five different channels 
that should be supported)

--

___
Python tracker 

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



[issue25941] Add 'How to Review a Patch' section to devguide

2015-12-28 Thread Ezio Melotti

Ezio Melotti added the comment:

+1 to the above message.

There are also a couple of things that should be corrected:
* bugtracker -> bug tracker
* If the patch makes codechanges to C codebase -> If the patch affects any C 
file

This could also be condensed a bit and merged with 
https://docs.python.org/devguide/patch.html#reviewing instead of creating a new 
page.

--
stage:  -> patch review
type:  -> enhancement

___
Python tracker 

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



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2015-12-28 Thread R. David Murray

R. David Murray added the comment:

Maybe add a comment as to why this is done?  (I'm not sure I understand why.)

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



[issue25928] Add Decimal.as_integer_ratio()

2015-12-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage: test needed -> patch review

___
Python tracker 

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



[issue25942] subprocess.call SIGKILLs too liberally

2015-12-28 Thread SilentGhost

SilentGhost added the comment:

The code was introduced to solve issue 12494, so I'm adding Victor to weigh in.

--
nosy: +SilentGhost, haypo
versions: +Python 3.5, Python 3.6 -Python 3.3

___
Python tracker 

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



[issue25447] TypeError invoking deepcopy on lru_cache

2015-12-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 33b428ef34b9 by Serhiy Storchaka in branch '3.5':
Issue #25447: Copying the lru_cache() wrapper object now always works,
https://hg.python.org/cpython/rev/33b428ef34b9

New changeset a0f9a8bee85f by Serhiy Storchaka in branch 'default':
Issue #25447: Copying the lru_cache() wrapper object now always works,
https://hg.python.org/cpython/rev/a0f9a8bee85f

--

___
Python tracker 

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



[issue25967] Devguide: add 2to3 to the "Changing CPython's Grammar" checklist

2015-12-28 Thread Ezio Melotti

New submission from Ezio Melotti:

If Python grammar is changed, lib2to3 should be updated accordingly.
This is currently missing from 
https://docs.python.org/devguide/grammar.html#checklist

See also #19511.

--
components: Devguide
keywords: easy
messages: 257134
nosy: ezio.melotti, willingc
priority: normal
severity: normal
stage: needs patch
status: open
title: Devguide: add 2to3 to the "Changing CPython's Grammar" checklist
type: enhancement

___
Python tracker 

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



[issue25969] Update lib2to3 grammar to include missing unpacking generalizations.

2015-12-28 Thread Ezio Melotti

New submission from Ezio Melotti:

The new unpacking generalizations added in #2292 should be added to the lib2to3 
grammar (see msg248019 and msg248025).

See also #25967.

--
components: Library (Lib)
messages: 257138
nosy: benjamin.peterson, ezio.melotti, yselivanov
priority: normal
severity: normal
stage: needs patch
status: open
title: Update lib2to3 grammar to include missing unpacking generalizations.
type: behavior
versions: Python 3.5, Python 3.6

___
Python tracker 

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



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

2015-12-28 Thread botic
lee, i will give u the answer just inbox me princeud...@yahoo.com, so that i 
can drop it privately
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue2292] Missing *-unpacking generalizations

2015-12-28 Thread Ezio Melotti

Ezio Melotti added the comment:

I created #25969 to track the lib2to3 update.

--

___
Python tracker 

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



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

2015-12-28 Thread Cameron Simpson

On 28Dec2015 01:34, Prince Udoka  wrote:

bu i have come up with a solution, that will work but encounter a problem in 
the set, giving set not manipulated correctly:

def manipulate_data(kind, data):
   if kind == 'list':
   return list(data)[::-1]
   elif kind == 'set':
   return set(data)
   elif kind == 'dictionary':
   return dict.keys(data)
manipulate_data("list", range(1,6))
manipulate_data("set", {"a", "b", "c", "d", "e", "ANDELA", "TIA", "AFRICA"})
manipulate_data("dictionary", {"apples": 23, "oranges": 15, "mangoes": 3, 
"grapes": 45})

the thing now is the function to use in adding "ANDELA", "TIA", "AFRICA"
pls 4give my use of language


You are very close. Let me remind you of the original task text:

 add items `"ANDELA"`, `"TIA"` and `"AFRICA"` to the set and return the 
 resulting set


Your previous attempt (with hardwired values inside the function) actually had 
code to do it.


While you have pulled out all the hardwired values from the function (good) and 
put them in the external calls, note that the task explicitly says "add items 
`"ANDELA"`, `"TIA"` and `"AFRICA"` to the set". So _those_ values _are_ 
supposed to be hardwired inside the function - they are a fixed part of the 
task. So move them back in, as in your previous attempt.


There is some ambiguity in that part of the question: should you return a _new_ 
set consistint of the original set plus the three new values, or simply add the 
three values to the original set? Your prior code modified the original set, 
which may fit the task specification.


However, it is a common design objective that functions do not, _normally_, 
modify their arguments. So, consider this code:


 set1 = {"a", "b", "c", "d", "e"}
 set2 = manipulate_data("set", set1)

After running this, set2 should look like this:

 {"a", "b", "c", "d", "e", "ANDELA", "TIA", "AFRICA"}

(in some order -- sets are not ordered). However, what about set1? In your 
current code, set1 is modified, so it will be the same. But you can imagine 
that it would be more useful for the caller if set1 were unchanged.


In python, the convention is usually that if a function returns the new value 
then it should not modify the original. So you should probably construct a copy 
of the original set and modify that:


 data = set(data)
 ... add the new values ...
 return data

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


[issue25970] py_compile.compile fails if existing bytecode file is unwritable

2015-12-28 Thread Robert Byrnes

New submission from Robert Byrnes:

In Python/import.c, open_exclusive unlinks any existing bytecode file before 
opening to create a new one.

However, py_compile.compile doesn't unlink before opening, and therefore fails 
if an existing bytecode file is unwritable.  It would be nice to unlink first 
in this case too.

--
components: Library (Lib)
messages: 257142
nosy: byrnes
priority: normal
severity: normal
status: open
title: py_compile.compile fails if existing bytecode file is unwritable
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



Message Box

2015-12-28 Thread Malik Brahimi
Hey Guys,

I have an event driven script that prompts users as the events are
triggered with a message box. Is there anyway with any GUI toolkit to
create these dialogs simultaneously in the event that they coincide? I have
been trying everything, but I can't seem to get it right.

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


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

2015-12-28 Thread Prince Udoka
thanks everyone, though it was very tough, but i thank GOD

On Mon, Dec 28, 2015 at 11:29 PM, Cameron Simpson  wrote:

> On 28Dec2015 01:34, Prince Udoka  wrote:
>
>> bu i have come up with a solution, that will work but encounter a problem
>> in the set, giving set not manipulated correctly:
>>
>> def manipulate_data(kind, data):
>>if kind == 'list':
>>return list(data)[::-1]
>>elif kind == 'set':
>>return set(data)
>>elif kind == 'dictionary':
>>return dict.keys(data)
>> manipulate_data("list", range(1,6))
>> manipulate_data("set", {"a", "b", "c", "d", "e", "ANDELA", "TIA",
>> "AFRICA"})
>> manipulate_data("dictionary", {"apples": 23, "oranges": 15, "mangoes": 3,
>> "grapes": 45})
>>
>> the thing now is the function to use in adding "ANDELA", "TIA", "AFRICA"
>> pls 4give my use of language
>>
>
> You are very close. Let me remind you of the original task text:
>
>  add items `"ANDELA"`, `"TIA"` and `"AFRICA"` to the set and return the
> resulting set
>
> Your previous attempt (with hardwired values inside the function) actually
> had code to do it.
>
> While you have pulled out all the hardwired values from the function
> (good) and put them in the external calls, note that the task explicitly
> says "add items `"ANDELA"`, `"TIA"` and `"AFRICA"` to the set". So _those_
> values _are_ supposed to be hardwired inside the function - they are a
> fixed part of the task. So move them back in, as in your previous attempt.
>
> There is some ambiguity in that part of the question: should you return a
> _new_ set consistint of the original set plus the three new values, or
> simply add the three values to the original set? Your prior code modified
> the original set, which may fit the task specification.
>
> However, it is a common design objective that functions do not,
> _normally_, modify their arguments. So, consider this code:
>
>  set1 = {"a", "b", "c", "d", "e"}
>  set2 = manipulate_data("set", set1)
>
> After running this, set2 should look like this:
>
>  {"a", "b", "c", "d", "e", "ANDELA", "TIA", "AFRICA"}
>
> (in some order -- sets are not ordered). However, what about set1? In your
> current code, set1 is modified, so it will be the same. But you can imagine
> that it would be more useful for the caller if set1 were unchanged.
>
> In python, the convention is usually that if a function returns the new
> value then it should not modify the original. So you should probably
> construct a copy of the original set and modify that:
>
>  data = set(data)
>  ... add the new values ...
>  return data
>
> Cheers,
> Cameron Simpson 
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.*

2015-12-28 Thread Марк Коренберг

Марк Коренберг added the comment:

Yes, can I do it on, say, github ?

--

___
Python tracker 

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



[issue25928] Add Decimal.as_integer_ratio()

2015-12-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 510ff609cb4f by Stefan Krah in branch 'default':
Issue #25928: Temporarily disable some tests in test_statistics in order
https://hg.python.org/cpython/rev/510ff609cb4f

--

___
Python tracker 

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



[issue25971] Optimize converting float and Decimal to Fraction

2015-12-28 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch makes following things:

1. Rewrite error messages in float.as_integer_ratio() and Python implementation 
of Decimal.as_integer_ratio() in more general form, not mentioning 
as_integer_ratio(), as in C implementation of Decimal.as_integer_ratio().

2. Use Decimal.as_integer_ratio() to convert Decimal to Fraction.

3. Get rid of additional checks in Fraction constructor that raise errors with 
appropriate messages, since new error messages from as_integer_ratio() are 
appropriate enough.

This speeds up creating a Fraction from float and Decimal 2 to 3 times.

--
components: Interpreter Core, Library (Lib)
files: fraction_from_floating.patch
keywords: patch
messages: 257145
nosy: facundobatista, mark.dickinson, rhettinger, serhiy.storchaka, skrah
priority: normal
severity: normal
stage: patch review
status: open
title: Optimize converting float and Decimal to Fraction
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file41442/fraction_from_floating.patch

___
Python tracker 

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



[issue25894] unittest subTest failure causes result to be omitted from listing

2015-12-28 Thread Ezio Melotti

Ezio Melotti added the comment:

> My gut feeling is that any subtest failure should be counted as the
> whole test failing. I’m not sure how the failure vs error cases should
> be handled. Maybe error should trump failure.

I think the priority should be error > failure > skip > pass.
IOW, pass should never be reported if any of the other 3 happen, skip should be 
reported only if there are no errors/failures, and errors should trump failures.

--

___
Python tracker 

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



[issue25928] Add Decimal.as_integer_ratio()

2015-12-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Hopefully I wasn't moving too fast, but I won't have time in the next
days/weeks.

No, the patch is pretty clear. Thanks.

> Serhiy and Alexander (#8947) would prefer more homogeneous error
messages and docstrings between float/pydecimal/cdecimal.

This would help to optimize creating a Fraction. Opened issue25971 for this.

--

___
Python tracker 

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



[issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.*

2015-12-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See a guide: https://docs.python.org/devguide/.

--

___
Python tracker 

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



[issue25928] Add Decimal.as_integer_ratio()

2015-12-28 Thread Stefan Krah

Stefan Krah added the comment:

Steven, could you have a look at the failures in test_statistics?
Some tests fail because they assume non-normalized fractions, I
still have to look at the other assumptions.

--

___
Python tracker 

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



[issue25436] argparse.ArgumentError missing error message in __repr__

2015-12-28 Thread Daniel Fortunov

Daniel Fortunov added the comment:

Paul,

Thanks for your comprehensive reply. I agree with everything you've said and 
the reason I've taken so long to reply is that I've been racking my brains to 
remember exactly how I came across this scenario.

I did at some point see an ArgumentError but I've forgotten the exact scenario. 
Since I can't see any of our internal codebase explicitly raising an 
ArgumentError, then I can only assume this must have just been a frustration I 
encountered when debugging into argparse code.

So I'll reformulate the question: Do you think it's worthwhile to make 
ArgumentError's repr() more useful for the purposes of interactive debugging 
alone?

Regards,
Dani

PS: I agree with your suggestion that you could achieve the same effect by 
defining a `__repr__` method for `ArgumentError`. I just thought that calling 
`super()` was more idiomatic.

--

___
Python tracker 

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



[issue16731] xxlimited/xxmodule docstrings ambiguous

2015-12-28 Thread Camilla Montonen

Camilla Montonen added the comment:

Hi Daniel, 
just about to review this patch and noticed that the typo in xxlimited.c 
docstring is still there. Do you mind if I tweak your patch to fix this?

--
nosy: +Winterflower

___
Python tracker 

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



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2015-12-28 Thread R. David Murray

R. David Murray added the comment:

So maybe "# we can use the same method to check for both absolute and relative 
resolution"?

--
assignee: ezio.melotti -> pitrou
stage: commit review -> patch review
versions: +Python 3.5 -Python 3.6

___
Python tracker 

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



[issue25864] collections.abc.Mapping should include a __reversed__ that raises TypeError

2015-12-28 Thread Andrew Barnert

Andrew Barnert added the comment:

The attached patch does the following:

* collections.abc.Mapping.__reversed__ = None.

* collections.abc.Iterable.__subclasshook__ checks for None the same way 
Hashable does:

  * This tests for any falsey value, not just None. I'm not sure this is ideal, 
but it's consistent with Hashable, and it's unlikely to ever matter.

  * The test will only block implicit subclassing. If a class, e.g., inherits 
from tuple (which is explicitly registered with Sequence, which inherits from 
Iterable), it's Iterable, even if it sets __iter__ = None. I think this is the 
right behavior, and it's consistent with Hashable.

* iter and reversed add checks for None, which raise a TypeError with the 
appropriate message (instead of "'NoneType' is not callable").

* datamodel.rst section "Special method names" includes a paragraph on setting 
special methods to None.

* Tests for changes to reversed (in test_enumerate.py), iter (in test_iter.py), 
Iterable (in test_collections.py), and Mapping (in collections.py).

--
keywords: +patch
Added file: http://bugs.python.org/file41440/cpython-iter-patch.diff

___
Python tracker 

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



[issue5501] Update multiprocessing docs re: freeze_support

2015-12-28 Thread Camilla Montonen

Camilla Montonen added the comment:

Patch review:

3.X patch:
Applied to docs locally in the default branch(3.6). Docs build passes, doc 
layout has not been broken. 

Applied to branch 3.5. Docs build passes, doc layout has not been broken.

2.X patch:
Applied to docs locally in the 2.7 branch. Docs build passes, doc layout has 
not been broken. 


Comments on the contents of the patch:

if the module is being run normally by the Python interpreter on Windows (the 
program has not been frozen)

For a newbie Python user it might not be entirely clear what 'run normally by 
the Python interpreter' means. Perhaps it would be nice to add a clarifying 
clause 

if the module is being run normally by the Python interpreter ( for example, by 
running python  from the command prompt) on Windows (the program 
has not been frozen)

or something similar.

--

___
Python tracker 

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



[issue25972] All Windows buildbots fail compile/clean

2015-12-28 Thread Zachary Ware

Zachary Ware added the comment:

Just some missing parentheses, so I fixed it:

http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/7116

--
components: +Build
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> compile error
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



[issue25637] Move non-collections-related ABCs out of collections.abc

2015-12-28 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue25609] Add a ContextManager ABC and type

2015-12-28 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue25942] subprocess.call SIGKILLs too liberally

2015-12-28 Thread Mike Pomraning

Mike Pomraning added the comment:

If I understand correctly, the _try_wait mechanics (or 3.5's syscall behavior) 
already handle EINTR the way we way:  ignore it and try wait()ing again.

So, this patch would kill only on a timeout, and never on another error like 
Ctrl-C, a UserDefinedTimeoutException from a signal handler, etc.

That's probably the lesser of two evils, the other being a SIGKILL against an 
arbitrary child process.  Better to document that a non-timeout-parameter 
interruption to subprocess.call will separate the parent from its child, than 
to hard kill arbitrary programs when a polite SIGINT was intended.

--

___
Python tracker 

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



[issue20440] Use the Py_SETREF macro

2015-12-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e04cd497aa41 by Zachary Ware in branch 'default':
Issue #25972, #20440: Fix compilation on Windows
https://hg.python.org/cpython/rev/e04cd497aa41

--

___
Python tracker 

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



[issue25972] All Windows buildbots fail compile/clean

2015-12-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e04cd497aa41 by Zachary Ware in branch 'default':
Issue #25972, #20440: Fix compilation on Windows
https://hg.python.org/cpython/rev/e04cd497aa41

--
nosy: +python-dev

___
Python tracker 

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



[issue25972] All Windows buildbots fail compile/clean

2015-12-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, thank you Zachary.

--

___
Python tracker 

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



Re: Message Box

2015-12-28 Thread Terry Reedy

On 12/28/2015 4:43 PM, Malik Brahimi wrote:


I have an event driven script


What does that mean, more specifically?


that prompts users as the events are
triggered with a message box. Is there anyway with any GUI toolkit to
create these dialogs simultaneously in the event that they coincide?


Yes, in tkinter, though the events must be tk events.
(By simultaneously, I presume you mean in the event handler.)


--
Terry Jan Reedy

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


[issue25928] Add Decimal.as_integer_ratio()

2015-12-28 Thread Stefan Krah

Stefan Krah added the comment:

Ah yes, the test_statistics failures look like #18841 again.

--

___
Python tracker 

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



[issue25856] The __module__ attribute of non-heap classes is not interned

2015-12-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Interning the __module__ string causes small performance hit:

$ ./python -m timeit -s "from itertools import chain" -- "chain.__module__; 
chain.__module__; chain.__module__; chain.__module__; chain.__module__; 
chain.__module__; chain.__module__; chain.__module__; chain.__module__; 
chain.__module__"

Unpatched:  1.93 usec per loop
Patched:4.09 usec per loop

This can be avoided if cache created string in type's __dict__. Following patch 
makes __module__ retrieving for non-heap types as fast as for heap types:

Patched2:   0.871 usec per loop

--
type: performance -> enhancement
Added file: http://bugs.python.org/file41443/intern_and_cache___module__.patch

___
Python tracker 

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



[issue25956] Unambiguous representation of recursive objects

2015-12-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Rejected by Guido.

http://permalink.gmane.org/gmane.comp.python.ideas/37562

--
resolution:  -> rejected
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



[issue25923] More const char

2015-12-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Excuse my troubling.

--
resolution:  -> fixed
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



EOFError: marshal data too short -- causes?

2015-12-28 Thread Glenn Linderman

Here's a sanatized stack trace off my web server:

  File ".../cgihelpers.py", line 10, in
import cgitb
  File ".../py34/lib/python3.4/cgitb.py", line 24, in
import inspect
  File ".../py34/lib/python3.4/inspect.py", line 54, in
from dis import COMPILER_FLAG_NAMES as _flag_names
  File "", line 2237, in _find_and_load
  File "", line 2226, in _find_and_load_unlocked
  File "", line 1200, in _load_unlocked
  File "", line 1129, in _exec
  File "", line 1467, in exec_module
  File "", line 1570, in get_code
  File "", line 656, in _compile_bytecode
EOFError: marshal data too short


It worked this morning, and does this now.  I hadn't changed anything.

The only reference I find on Google seems to be related to 
out-of-disk-space, so I cleaned up some files, but I'm not sure of how 
the web server mounts things; df didn't show particularly high usage in 
any of the disks it reported on.


The files I cleaned up are ever-growing log files that I need to clean 
up now and then manually, but cleaning them up didn't help... and df 
wasn't complaining anyway. So maybe out-of-disk-space is a red herring, 
or only one cause of this symptom.


When I log in to the web server with Putty, I can run Python at the 
command prompt, and "import dis" suffices to reproduce the problem.


Are there other causes of this symptom than out-of-disk-space?  If it is 
out-of-disk-space, how could one determine which disk?


Maybe if not really out of space, it is a bad permission, disallowing 
creation of a temporary file?  But how could one determine which 
temporary file, and where it would be written?



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


[issue25956] Unambiguous representation of recursive objects

2015-12-28 Thread leewz

leewz added the comment:

Hey, I brought this up last month in the #python channel. I suggested `[ . . . 
]`.

I agree that there's no great need, though.

--
nosy: +leewz

___
Python tracker 

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



Re: EOFError: marshal data too short -- causes?

2015-12-28 Thread Terry Reedy

On 12/29/2015 1:50 AM, Glenn Linderman wrote:

Here's a sanatized stack trace off my web server:

   File ".../cgihelpers.py", line 10, in
 import cgitb
   File ".../py34/lib/python3.4/cgitb.py", line 24, in
 import inspect
   File ".../py34/lib/python3.4/inspect.py", line 54, in
 from dis import COMPILER_FLAG_NAMES as _flag_names
   File "", line 2237, in _find_and_load
   File "", line 2226, in _find_and_load_unlocked
   File "", line 1200, in _load_unlocked
   File "", line 1129, in _exec
   File "", line 1467, in exec_module
   File "", line 1570, in get_code
   File "", line 656, in _compile_bytecode
EOFError: marshal data too short


It worked this morning, and does this now.  I hadn't changed anything.


Since it crashes trying to unmarshal compiled dis bytecode, I would 
assume that the .pyc file is corrupted and remove it. Based on the 
above, it should be in

.../py34/lib/python3.4/__pycache__/dis.*.pyc
Python will then recompile dis and write a new .pyc file.

--
Terry Jan Reedy

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