[issue23007] Unnecessary big intermediate result in Lib/bisect.py

2014-12-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What troubles?

--
nosy: +serhiy.storchaka

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



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Alexey Poryadin

New submission from Alexey Poryadin:

When is called `select`, but registered no one `fileobject` rise exception:
...
polled = self._selector.select(timeout)
  File /usr/lib/python3.4/selectors.py, line 424, in select
fd_event_list = self._epoll.poll(timeout, max_ev)
ValueError: maxevents must be greater than 0, got 0

Of course, it makes no sense to call `select` if there is nothing to watch. But 
select.epol.poll is not raises exception in the same case if `max_ev`=-1. And 
this simplifies the application code and is useful if need just sleep for a 
timeout.

So, I suggest a small fix:
-fd_event_list = self._epoll.poll(timeout, max_ev)
+fd_event_list = self._epoll.poll(timeout, max_ev or -1)

--
messages: 232300
nosy: Alexey.Poryadin
priority: normal
severity: normal
status: open
title: selectors.EpollSelector.select raises exception when nothing to select.
type: behavior
versions: Python 3.4

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



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +haypo, neologix

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



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
versions: +Python 3.5

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



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
components: +asyncio
nosy: +gvanrossum, yselivanov

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



[issue21998] asyncio: a new self-pipe should be created in the child process after fork

2014-12-08 Thread Martin Richard

Martin Richard added the comment:

Currently, this is what I do in the child after the fork:

 selector = loop._selector
 parent_class = selector.__class__.__bases__[0]
 selector.unregister = lambda fd: parent_class.unregister(selector, fd)

It replaces unregister() by _BaseSelectorImpl.unregister(), so our data 
structures are still cleaned (the dict _fd_to_key, for instance).

If a fix for this issue is desired in tulip, the first solution proposed by 
Guido (closing the selector and let the unregister call fail, see the -trivial- 
patch attached) is probably good enough.

--
keywords: +patch
Added file: 
http://bugs.python.org/file37385/close_self_pipe_after_selector.patch

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



[issue23010] unclosed file warning when defining unused logging FileHandler in dictConfig

2014-12-08 Thread Walter Doekes

New submission from Walter Doekes:

If you define a FileHandler in your logging dictConfig but fail to use it in 
the same configuration, the file handle is leaked and a ResourceWarning is 
thrown.

Versions:

$ python3 -V
Python 3.4.0
$ apt-cache show python3.4 | grep ^Version
Version: 3.4.0-2ubuntu1

Expected:

$ PYTHONWARNINGS=default,ignore::DeprecationWarning \
python3 problem.py 
imported once

Observed:

$ PYTHONWARNINGS=default,ignore::DeprecationWarning \
python3 problem.py 
.../lib/python3.4/importlib/_bootstrap.py:656:
ResourceWarning: unclosed file
  _io.FileIO name='/tmp/debug.log' mode='ab'
  code = marshal.loads(data)
imported once

To reproduce, save below as problem.py:

if __name__ == '__main__':
LOGGING = {
'version': 1,
'handlers': {
'logfile': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': '/tmp/debug.log',
},
},
}

from logging.config import dictConfig
dictConfig(LOGGING)

# using importlib on a new file triggers the warnings
import importlib, shutil, os
shutil.copy(__file__, __file__ + '.new')
os.unlink(__file__)
os.rename(__file__ + '.new', __file__)
importlib.import_module('problem')
else:
print('imported once')


Fixed by:

--- /usr/lib/python3.4/logging/config.py.orig   2014-12-08 
14:06:24.911460799 +0100
+++ /usr/lib/python3.4/logging/config.py2014-12-08 14:16:17.519460799 
+0100
@@ -637,6 +637,16 @@ class DictConfigurator(BaseConfigurator)
 except Exception as e:
 raise ValueError('Unable to configure root '
  'logger: %s' % e)
+
+# Close unused loggers
+used_handlers = set()
+for logger in logging.root.manager.loggerDict.values():
+if hasattr(logger, 'handlers') and logger.handlers:
+used_handlers.add(*logger.handlers)
+for name, handler in handlers.items():
+if handler not in used_handlers:
+if hasattr(handler, 'close'):
+handler.close()
 finally:
 logging._releaseLock()
 

The fix above might not be the best fix, but it proves where the problem is. 
Perhaps the handlers shouldn't be instantiated until the first user of such a 
handler is instantiated.

This issue was found by using Django 1.7 with Python 3.4 when enabling the 
PYTHONWARNINGS.

Cheers,
Walter Doekes
OSSO B.V.

--
components: Library (Lib)
messages: 232302
nosy: wdoekes
priority: normal
severity: normal
status: open
title: unclosed file warning when defining unused logging FileHandler in 
dictConfig
versions: Python 3.4

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



[issue23011] Duplicate Paragraph in documentation for json module

2014-12-08 Thread berndca

New submission from berndca:

There is a duplication of the first section of 18.2.2 (JSON) Encoders and 
Decoders of the python 2.7.9RC1 doc as well of the corresponding paragraph in 
19.2.2 of the Python 3 docs.

--
assignee: docs@python
components: Documentation
messages: 232303
nosy: berndca, docs@python
priority: normal
severity: normal
status: open
title: Duplicate Paragraph in documentation for json module
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5

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



[issue23011] Duplicate Paragraph in documentation for json module

2014-12-08 Thread Simeon Visser

Simeon Visser added the comment:

What paragraph are you referring to? Various documented parameters are similar 
but I don't see duplicate paragraphs.

--
nosy: +simeon.visser

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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2014-12-08 Thread Trent Nelson

Changes by Trent Nelson tr...@snakebite.org:


--
nosy: +trent

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



[issue23012] RuntimeError: settrace/setprofile function gets lost

2014-12-08 Thread Armin Rigo

New submission from Armin Rigo:

It's not possible to write a settrace() or setprofile() function that remains 
active if we're about to run out of stack. If we are, we get a RuntimeError 
when the function is called. The RuntimeError is normally propagated, but in 
case it is eaten (e.g. see example) then the program continues to run normally 
--- but the trace/profile function is disabled from now on.

--
files: test9.py
messages: 232305
nosy: arigo
priority: normal
severity: normal
status: open
title: RuntimeError: settrace/setprofile function gets lost
type: behavior
Added file: http://bugs.python.org/file37386/test9.py

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



[issue23012] RuntimeError: settrace/setprofile function gets lost

2014-12-08 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +haypo

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



[issue23010] unclosed file warning when defining unused logging FileHandler in dictConfig

2014-12-08 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +vinay.sajip

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



[issue20603] sys.path disappears at shutdown

2014-12-08 Thread Brett Cannon

Brett Cannon added the comment:

That's enough reason for me to close this as out of date. =)

--
resolution:  - out of date
status: open - closed

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



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Yury Selivanov

Yury Selivanov added the comment:

Patch attached. Tests pass on Linux.

--
keywords: +patch
Added file: http://bugs.python.org/file37387/epoll_01.patch

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



[issue21998] asyncio: a new self-pipe should be created in the child process after fork

2014-12-08 Thread STINNER Victor

STINNER Victor added the comment:

I suggest to split this issue: create a new issue focus on 
selectors.EpollSelector, it doesn't behave well with forking. If I understood 
correctly, you can workaround this specific issue by forcing the selector to 
selectors.SelectSelector for example, right?

--

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



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread STINNER Victor

STINNER Victor added the comment:

+s.select(timeout=0)

I suggest to ensure that the result is an empty list.

--

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



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


Added file: http://bugs.python.org/file37388/epoll_02.patch

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



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Yury Selivanov

Yury Selivanov added the comment:

I agree. Please see another one.

--

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



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread STINNER Victor

STINNER Victor added the comment:

It's a little bit surprising to call epoll_wait() without any FD subscribed, 
but select([], [], [], delay) is a known way to sleep 'delay' seconds, so why 
not using epoll in a similar way? :-)

epoll_02.patch looks good to me. Can you please also apply the patch to the 
Tulip project?

(By the way, test_selectors.py to Tulip is completly different, we may just 
reuse the file from CPython and drop the code from Tulip.)

--

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



[issue23013] Tweak wording for importlib.util.LazyLoader in regards to Loader.create_module()

2014-12-08 Thread Brett Cannon

New submission from Brett Cannon:

The docs for importlib.util.LazyLoader emphatically say that a loader cannot 
define importlib.abc.Loader.create_module() if it is to be subclassed. What in 
fact should say is that the subclass' create_module() will not be called; 
whether it is defined or not is of no consequence.

--
assignee: brett.cannon
components: Documentation
keywords: easy
messages: 232312
nosy: brett.cannon
priority: normal
severity: normal
stage: needs patch
status: open
title: Tweak wording for importlib.util.LazyLoader in regards to 
Loader.create_module()
versions: Python 3.5

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



[issue23008] pydoc enum.{,Int}Enum fails

2014-12-08 Thread Berker Peksag

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


--
nosy: +ethan.furman

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



[issue23014] Don't have importlib.abc.Loader.create_module() be optional

2014-12-08 Thread Brett Cannon

New submission from Brett Cannon:

I continue to be bothered by how we designed 
importlib.abc.Loader.create_module(). I don't like that it's optional and I 
don't like that it can return None.

I would much rather make it so that importlib.abc.Loader.create_module() was a 
static method that does what importlib.util.module_from_spec() does. I would 
also like importlib to throw a fit if exec_module() was defined on a loader but 
not create_module() with a DeprecationWarning to start and then an 
AttributeError later (as I said, this requires exec_module() defined and does 
not play into the whole load_module() discussion). This should also hopefully 
promote people subclassing importlib.abc.Loader more as well.

What do other people think?

--
components: Interpreter Core
messages: 232313
nosy: brett.cannon, eric.snow, ncoghlan
priority: normal
severity: normal
stage: test needed
status: open
title: Don't have importlib.abc.Loader.create_module() be optional
type: behavior
versions: Python 3.5, Python 3.6

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



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Guido van Rossum

Guido van Rossum added the comment:

Please add a comment explaining the complaint from epoll.poll() we're
trying to avoid here.

I presume Tulip never gets into this state because of the self-pipe.

On Mon, Dec 8, 2014 at 8:01 AM, STINNER Victor rep...@bugs.python.org
wrote:


 STINNER Victor added the comment:

 It's a little bit surprising to call epoll_wait() without any FD
 subscribed, but select([], [], [], delay) is a known way to sleep 'delay'
 seconds, so why not using epoll in a similar way? :-)

 epoll_02.patch looks good to me. Can you please also apply the patch to
 the Tulip project?

 (By the way, test_selectors.py to Tulip is completly different, we may
 just reuse the file from CPython and drop the code from Tulip.)

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue23009
 ___


--

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



[issue22935] Disabling SSLv3 support

2014-12-08 Thread Kurt Roeckx

Kurt Roeckx added the comment:

I did update the documentation to mention that, but it seems none of my 
documentation changes got applied.

--

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



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b2ee06684b6a by Yury Selivanov in branch '3.4':
selectors: Make sure EpollSelecrtor.select() works when no FD is registered.
https://hg.python.org/cpython/rev/b2ee06684b6a

New changeset 202995833ef4 by Yury Selivanov in branch 'default':
selectors: Make sure EpollSelecrtor.select() works when no FD is registered.
https://hg.python.org/cpython/rev/202995833ef4

--
nosy: +python-dev

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



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Yury Selivanov

Yury Selivanov added the comment:

 Please add a comment explaining the complaint from epoll.poll() we're
trying to avoid here.

Good point! Committed.

--

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



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


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

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



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Charles-François Natali

Charles-François Natali added the comment:

Thanks for taking care of this.

--

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



[issue23007] Unnecessary big intermediate result in Lib/bisect.py

2014-12-08 Thread Mark Dickinson

Mark Dickinson added the comment:

 What troubles?

Well, I imagine that something like bisect(a, 155, lo=numpy.uint8(0), 
hi=numpy.uint8(254)) would be asking for trouble.  But (a) it's hard to 
imagine why anyone would want to do that given that NumPy has its own bisection 
code, and (b) you'd have to somehow make sure that you were using the plain 
Python bisect code and not the `_bisect` module code, which AFAIK does the 
right thing here.

Sergey: what troubles have you run into?  With what user-defined types?  Note 
that if you just do from bisect import * at a Python prompt, you're not even 
using the code in Lib/bisect.py: the main implementation is written in C.

--

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



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8f1be68dfcab by Yury Selivanov in branch '3.4':
NEWS: Add news entry for issue #23009.
https://hg.python.org/cpython/rev/8f1be68dfcab

New changeset d36711410f48 by Yury Selivanov in branch 'default':
NEWS: Add news entry for issue #23009.
https://hg.python.org/cpython/rev/d36711410f48

--

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



[issue23010] unclosed file warning when defining unused logging FileHandler in dictConfig

2014-12-08 Thread Vinay Sajip

Vinay Sajip added the comment:

Well, it's possible that you could configure handlers in the configuration for 
later use (i.e. at some point after the dictConfig() call returns).

If you want to avoid opening the file until it's actually needed, you can 
specify delay=True, and then you shouldn't see the resource leak because the 
stream will be opened when it's actually needed.

Unless there's some reason you can't do that, or there's something I've 
overlooked, I think I should close this as invalid.

--

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



[issue15582] Enhance inspect.getdoc to follow inheritance chains

2014-12-08 Thread Yury Selivanov

Yury Selivanov added the comment:

@Claudiu, you should also add this test and make sure that it passes:

   class Parent:
  __doc__ = 'some documentation'

   class Child(Parent):
  __doc__ = None

   assert getdoc(Child) is None

In other words -- we use __doc__ defined in parent classes only when there was 
no __doc__ in children's __dict__s.

--
nosy: +yselivanov

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



[issue15582] Enhance inspect.getdoc to follow inheritance chains

2014-12-08 Thread Claudiu Popa

Claudiu Popa added the comment:

Alright, I'll update my patch later this week.

--

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



[issue21740] doctest doesn't allow duck-typing callables

2014-12-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d22ca7496c54 by Yury Selivanov in branch 'default':
Issue #21740: Support wrapped callables in pydoc. Patch by Claudiu Popa.
https://hg.python.org/cpython/rev/d22ca7496c54

--
nosy: +python-dev

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



[issue21740] doctest doesn't allow duck-typing callables

2014-12-08 Thread Yury Selivanov

Yury Selivanov added the comment:

Thank you for the patch, Claudiu!

--
nosy: +yselivanov
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue23010] unclosed file warning when defining unused logging FileHandler in dictConfig

2014-12-08 Thread Walter Doekes

Walter Doekes added the comment:

Thanks for the quick response!

 Well, it's possible that you could configure handlers in the configuration 
 for later use (i.e. at some point after the dictConfig() call returns).

After the dictConfig call returns, the StreamHandler/FileHandler is not 
referenced by anyone anymore. That's what causes the ResourceWarning. Unless 
I'm severely mistaken, there is no way to reach that old FileHandler instance.

 If you want to avoid opening the file until it's actually needed, you can 
 specify delay=True.

I am aware of that, but that's a workaround, not a fix. (And it has drawbacks 
of its own, for example in forking and/or setuid situations.)

 Unless there's some reason you can't do that, or there's something I've 
 overlooked, I think I should close this as invalid.

You could do that, but -- barring me overlooking something here -- I think that 
would only be correct if the dictionary that I passed to dictConfig is judged 
as being illegal, because it contains unused handlers.

The ResourceWarning thrown is hard to understand because of where it is raised 
(at random points in a different modules), so like it is now, it may dissuade 
users from enabling more (visual) warnings. I'd rather see a warning raised 
earlier from dictConfig() that I configured an unused handler, so I have a 
better indication of what to fix.

--

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



[issue23015] Improve test_uuid

2014-12-08 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch makes following changes to test_uuid.

* Report the test as skipped if this method to determine MAC address doesn't 
work on this platform.
* Output found node value if test ran with -vv.
* Output node values in hexadecimal if node tests fail.
* Check that 47 bit is clear for node values obtained from network card.
* Remove unused commented out code.
* Move internal functions tests to separate test class.

--
components: Tests
files: test_uuid.patch
keywords: patch
messages: 232327
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Improve test_uuid
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file37389/test_uuid.patch

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



[issue1218234] inspect.getsource doesn't update when a module is reloaded

2014-12-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8e2505d535c8 by Yury Selivanov in branch 'default':
inspect: Fix getsource() to load updated source of reloaded module
https://hg.python.org/cpython/rev/8e2505d535c8

--
nosy: +python-dev

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



[issue1218234] inspect.getsource doesn't update when a module is reloaded

2014-12-08 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


--
resolution:  - fixed
status: open - closed

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



[issue1218234] inspect.getsource doesn't update when a module is reloaded

2014-12-08 Thread Yury Selivanov

Yury Selivanov added the comment:

Fixed in 3.5. Not sure if we need to backport this to 3.4 and 2.7.

Closing this issue. Thanks to Björn Lindqvist and Berker Peksag!

--

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



[issue9678] uuid._ifconfig_getnode can't work on NetBSD

2014-12-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch is updated to current sources. Please test on NetBSD5.

--
nosy: +serhiy.storchaka
stage:  - patch review
versions: +Python 3.4, Python 3.5 -Python 3.2
Added file: http://bugs.python.org/file37390/uuid_arp_getnode_netbsd.patch

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



[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2014-12-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
keywords: +needs review
stage: needs patch - patch review
versions: +Python 3.4, Python 3.5

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



[issue1703178] link_objects in setup.cfg crashes build

2014-12-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Donald, can you look at this one-line patch?  Éric has not responded.

--
nosy: +dstufft, terry.reedy -tarek

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



[issue1218234] inspect.getsource doesn't update when a module is reloaded

2014-12-08 Thread Jason R. Coombs

Jason R. Coombs added the comment:

FWIW, I'd appreciate a backport to 3.4, given that 3.5 is scheduled for release 
in Sep 2015.

--

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



[issue1703178] link_objects in setup.cfg crashes build

2014-12-08 Thread Éric Araujo

Éric Araujo added the comment:

Thanks for the patch.  It looks good to me.

--
assignee: eric.araujo - 

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



[issue1218234] inspect.getsource doesn't update when a module is reloaded

2014-12-08 Thread Berker Peksag

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


--
stage: patch review - resolved

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



[issue23014] Don't have importlib.abc.Loader.create_module() be optional

2014-12-08 Thread Nick Coghlan

Nick Coghlan added the comment:

I mostly like the idea, but am wary of having the base class implement it
as a static method that subclasses are then likely to override with a
normal instance method.

A module level function somewhere + a base class instance method that just
delegates to the stateless function version would feel cleaner to me.

--

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



[issue1218234] inspect.getsource doesn't update when a module is reloaded

2014-12-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e52d8e888df1 by Yury Selivanov in branch '3.4':
inspect: Fix getsource() to load updated source of reloaded module
https://hg.python.org/cpython/rev/e52d8e888df1

--

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



[issue1218234] inspect.getsource doesn't update when a module is reloaded

2014-12-08 Thread Yury Selivanov

Yury Selivanov added the comment:

@Jason: done ;)

--

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



[issue23010] unclosed file warning when defining unused logging FileHandler in dictConfig

2014-12-08 Thread Vinay Sajip

Vinay Sajip added the comment:

The delay= is not really a workaround for this particular circumstance, it's 
mainly there to avoid leaving empty files around and allocating resources that 
might never be used (which is analogous to this issue, but delay was not 
implemented to work around this specific scenario).

The handlers are AFAIK referenced - if you peek at logging._handlerList or 
logging._handlers you should see them in there.

A config dictionary is not judged as being illegal just because it contains 
unused handlers - you just happen to allocate resource that you never use. You 
could just leave out the handlers, since you're never using them; it's not 
logging's job to be overly restrictive about this sort of thing. Python doesn't 
warn you for allocating a dictionary that you never populate, or if you 
populate a dictionary that you then never interrogate. The type of unnecessary 
allocation of resources you're talking about happens a lot in programs - in 
fact, it also applies to loggers, since you might never use them in a specific 
program run, because of which code gets run based on command-line arguments, or 
with handlers that are used (in the sens you mean here, because they are 
linked to loggers), but never *actually* used because the levels in the 
configuration are set to CRITICAL, and there are no .critical() calls 
encountered during a program run. I'm not sure a line can usefully be drawn 
regarding
  useless allocations.

--

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



[issue1425127] os.remove OSError: [Errno 13] Permission denied

2014-12-08 Thread Josh Rosenberg

Josh Rosenberg added the comment:

I think you're overinterpreting. The bug probably still exists on Windows if 
you're using a poorly designed anti-virus or indexing tool; nothing fundamental 
has changed in how files are deleted on Windows since this was opened.

--

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



[issue22123] Provide a direct function for types.SimpleNamespace()

2014-12-08 Thread Eric Snow

Eric Snow added the comment:

 It's not a builtin yet, solely because we get far fewer arguments about the 
 contents of the types module than we do builtins :)

Exactly.  As Mark noted, I did have hopes of it reaching that status though. :) 
So +1 from me for adding the namespace builtin!

--
nosy: +eric.snow

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



[issue19725] Richer stat object

2014-12-08 Thread Philip Jenvey

Philip Jenvey added the comment:

I can't find the paper trail of what I originally thought was a consensus or 
even that many clear pronouncements about it, but I recall Nick being 
originally opposed to it but he later changed his mind, you can see his 
approval here:

https://mail.python.org/pipermail/python-dev/2013-May/125809.html

'It's also quite likely the rich stat object API will be pursued for 3.5'

https://mail.python.org/pipermail/python-dev/2013-November/130582.html

https://mail.python.org/pipermail/python-dev/2013-November/130588.html

Antoine seems ok w/ it, encouraging others to make it happen:

https://mail.python.org/pipermail//python-dev/2013-September/128708.html

You can probably find a bit more discussion within those threads

--

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



[issue1425127] os.remove OSError: [Errno 13] Permission denied

2014-12-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I sometimes have problems deleting files in Windows Explorer.  Sometimes I have 
to wait for reboot, sometimes I have to login as admin.  None of this is a bug 
in Python.  The original post, nearly 9 years ago, was not obviously a Python 
bug report but appears to be question about quirks in Windows.  Two Python 
experts disagreed whether there is a Python bug.

In any case, an open issue needs a repeatable test case that demonstrates a 
problem with current Python running on a currently supported OS, preferably 
without 'poorly designed' 3rd party software involved.

--

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



[issue23016] uncatched exception in lib/warnings.py when executed with pythonw

2014-12-08 Thread stockbsd Li

New submission from stockbsd Li:

in py3k, the following simple code will throw an uncatched exception when 
executed with pythonw:

import warnings
warnings.warn('test')

the problem occurs in showarning function: in py3k's pythonw , stderr/stdout is 
set to None, so the file.write(...) statement will thorw AttributeError 
uncatched. I think a catch-all except(delete 'OSError') can solve this.

def showwarning(message, category, filename, lineno, file=None, line=None):
Hook to write a warning to a file; replace if you like.
if file is None:
file = sys.stderr
try:
file.write(formatwarning(message, category, filename, lineno, line))
except OSError:
pass # the file (probably stderr) is invalid - this warning gets lost.

--
components: Library (Lib)
messages: 232342
nosy: stockbsd
priority: normal
severity: normal
status: open
title: uncatched exception in lib/warnings.py when executed with pythonw
type: crash
versions: Python 3.2, Python 3.3, Python 3.4

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



[issue23017] string.printable.isprintable() returns False

2014-12-08 Thread Steve Ward

New submission from Steve Ward:

string.printable includes all whitespace characters.  However, the only 
whitespace character that is printable is the space (0x20).


By definition, the only ASCII characters considered printable are:
alphanumeric characters
punctuation characters
the space character (not all whitespace characters)


Source:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03

7.2 POSIX Locale

Conforming systems shall provide a POSIX locale, also known as the C locale.


7.3.1 LC_CTYPE

space
Define characters to be classified as white-space characters.

In the POSIX locale, exactly space, form-feed, newline, 
carriage-return, tab, and vertical-tab shall be included.

cntrl
Define characters to be classified as control characters.

In the POSIX locale, no characters in classes alpha or print shall be 
included.

graph
Define characters to be classified as printable characters, not including 
the space.

In the POSIX locale, all characters in classes alpha, digit, and punct 
shall be included; no characters in class cntrl shall be included.

print
Define characters to be classified as printable characters, including the 
space.

In the POSIX locale, all characters in class graph shall be included; no 
characters in class cntrl shall be included.


LC_CTYPE Category in the POSIX Locale

# print is by default alnum, punct, and the space

--
components: Library (Lib)
files: bug-string-ascii.py
messages: 232343
nosy: planet36
priority: normal
severity: normal
status: open
title: string.printable.isprintable() returns False
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file37391/bug-string-ascii.py

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



[issue22919] Update PCBuild for VS 2015

2014-12-08 Thread Steve Dower

Steve Dower added the comment:

Small incremental patch from Zach's feedback and a few sysconfig changes I 
missed.

--
Added file: http://bugs.python.org/file37392/round6incremental.patch

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



[issue23018] Add version info to python[w].exe

2014-12-08 Thread Steve Dower

New submission from Steve Dower:

We should include the version resource in python[w].exe as well as python35.dll 
so that it can be properly identified. (If possible, we should do .pyd files 
too, though I don't think the version info will be displayed, so it's probably 
not worth it.)

--
assignee: steve.dower
messages: 232345
nosy: steve.dower
priority: normal
severity: normal
status: open
title: Add version info to python[w].exe
type: enhancement
versions: Python 3.5

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



[issue23018] Add version info to python[w].exe

2014-12-08 Thread Steve Dower

Steve Dower added the comment:

Patch for the version info, and also for half of #19143 since I was there.

--
components: +Windows
keywords: +patch
nosy: +tim.golden, zach.ware
Added file: http://bugs.python.org/file37393/23018.patch

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



[issue22932] email.utils.formatdate uses unreliable time.timezone constant

2014-12-08 Thread Dmitry Shachnev

Dmitry Shachnev added the comment:

Here is the updated patch based on Alexander’s suggestion.

Works fine, the only difference with previous behavior is that the zero time 
zone is now + instead of -.

--
Added file: http://bugs.python.org/file37394/issue22932_v2.patch

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



[issue23019] pyexpat.errors wrongly bound to message strings instead of message codes

2014-12-08 Thread Björn Karge

New submission from Björn Karge:

expat.errors should expose the enum values and NOT the associated message 
strings, so they can be tested against ExpatError.code

--
components: Library (Lib)
messages: 232348
nosy: bkarge
priority: normal
severity: normal
status: open
title: pyexpat.errors wrongly bound to message strings instead of message codes
type: behavior
versions: Python 2.7

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