[issue21197] venv does not create lib64 directory and appropriate symlinks

2014-04-12 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +eric.araujo

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



[issue21171] Outdated usage str.encode('rot-13') in rot13 codec

2014-04-12 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +eric.araujo

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



[issue21186] RawConfigParser __name__ option handling inconsistent

2014-04-12 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
assignee:  - lukasz.langa
nosy: +lukasz.langa

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



[issue21188] Broken link

2014-04-12 Thread Éric Araujo

Éric Araujo added the comment:

Thanks for the report.

If the python.org links can be found in the Internet Archive, then one could 
find the new addresses to use by looking for the same message on 
http://www.python.org/pipermail/python-dev/2000-March/

Would you be willing to try that?

--
nosy: +eric.araujo

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



[issue21198] Minor tarfile documentation bug

2014-04-12 Thread Éric Araujo

Éric Araujo added the comment:

Thanks for the report.  Is it an issue in the docstrings, the HTML 
documentation or both?

--
nosy: +eric.araujo

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



[issue21161] list comprehensions don't see local variables in pdb in python3

2014-04-12 Thread Xavier de Gaye

Xavier de Gaye added the comment:

FWIW this generator expression can be evaluated with the 'interact' command:

--Return--
 /test/comprehension.py(5)foo()-None
- pdb.set_trace()
(Pdb) interact
*interactive*
 all(x  limit for x in items)
True
 
(Pdb)

--
nosy: +xdegaye

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



[issue21197] venv does not create lib64 directory and appropriate symlinks

2014-04-12 Thread Matthias Dahl

Matthias Dahl added the comment:

@vinay.sajip: No problem. Jedi is a auto-completion library. It does not add 
any links anywhere. It naturally has to know about which venvs you use so it 
can find all modules and their sources to process them. Thus, you (or the 
implementation using Jedi) pass it the base directories of the venvs and it 
constructs the appropriate path to the site-packages and uses those internally. 
Rightfully, it assumes a lib/ directory to contain everything which works just 
fine for virtualenv created venvs due to the symlink but not for venv created 
venvs.

@ned.deily: I know what you mean. And I am very inclined to fully agree with 
you that dists should patch this as well. But the problem I see with this is: 
Except for Debian-based dists, all of the other major ones  (Gentoo, 
Fedora/RedHat/CentOS, OpenSUSE, ...) and their derivatives, put Python under 
lib64/ on multilib systems. And the patches they use and the changes they 
introduce already differ here and there in important key details. It would be 
no different with this issue as well. Besides, this scenario (Python under 
lib64/) is not so uncommon anymore and imho, should be supported by Python out 
of the box by making those things properly configurable during compilation. But 
that is a different subject altogether.

IMHO, this feature is small enough to be added to Python's venv to standardize 
it across dists. Besides, it makes it more compatible and a better drop-in 
replacement for virtualenv itself.

--

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



[issue21178] doctest cause warnings in tests using generators

2014-04-12 Thread Ontje Lünsdorf

Ontje Lünsdorf added the comment:

I think there may be a bug in doctest which is getting exposed by Python 3.4 
new handling of reference cycles. I've attached a simpler example with a global 
variable.

There's no error if you run the code directly, the global variable still exists 
during the generator exit. If you run it with doctest in Python 3.4 you get the 
warning because the global variable has been deleted. In this corner case, 
doctest execution seem to differ from Python.

--
Added file: http://bugs.python.org/file34790/doctest.txt

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



[issue21161] list comprehensions don't see local variables in pdb in python3

2014-04-12 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The runcode() method of InteractiveInterpreter in code.py uses the 
'self.locals' dictionary as the 'globals' parameter of the invoked exec() 
function. And the do_interact() method of Pdb instantiates 
InteractiveInterpreter with 'locals' as a merge of the current frame's locals 
and globals dictionary. This explains why the interact command of pdb evaluates 
sucessfully the generator expression: the generator function object is 
evaluated by the interpreter in a frame where 'locals' is NULL (see 
fast_function() in ceval.c) and 'globals' includes now the debugged frame 
locals dictionary.

So a fix for this problem is to have the default() method of pdb be implemented 
in the same manner as do_interact() and the runcode() method of 
InteractiveInterpreter. The attached patch does this.

--
keywords: +patch
Added file: http://bugs.python.org/file34791/genexp.patch

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



[issue21202] Naming a file` io.py` causes cryptic error message

2014-04-12 Thread Florent Xicluna

Changes by Florent Xicluna florent.xicl...@gmail.com:


--
nosy: +flox

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



[issue21161] list comprehensions don't see local variables in pdb in python3

2014-04-12 Thread Jurko Gospodnetić

Jurko Gospodnetić added the comment:

Thanks for looking into this Xavier.

Could someone reopen this issue so it can gets looked at again?

--

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



[issue15716] Ability to specify the PYTHONPATH via a command line flag

2014-04-12 Thread mk

Changes by mk mige...@gmail.com:


--
nosy: +migel.k

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



[issue21205] Unable to make decorated generator object to inherit generator function's __name__

2014-04-12 Thread Szieberth Ádám

New submission from Szieberth Ádám:

I faced this particular issue by writing decorators for asyncio coroutines. 

I even posted a question to SO: 
http://stackoverflow.com/questions/23015626/how-to-decorate-an-asyncio-coroutine-to-retain-its-name

However, since that I realized the problem is more general. I believe that a 
generator object should inherit its function's __name__ attribute instead of 
ignoring it. Example:



import functools

def decorated(genfunc):
@functools.wraps(genfunc)
def wrapper(*args, **kargs):
print('inside wrapper')
for x in genfunc(*args, **kargs):
yield 'decorated: {!r}'.format(x)
print('outside wrapper')
print('wrapper.__name__: {!r}'.format(wrapper.__name__))
return wrapper

@decorated
def simple_genfunc():
Testdoc.
yield from range(10)

if __name__ == '__main__':
print('simple_genfunc.__name__: {!r}'.format(
simple_genfunc.__name__))
print('simple_genfunc().__name__: {!r}'.format(
simple_genfunc().__name__))


And its result:

Z:\python -i genfuncdec.py
outside wrapper
wrapper.__name__: 'simple_genfunc'
simple_genfunc.__name__: 'simple_genfunc'
simple_genfunc().__name__: 'wrapper'
 simple_genfunc
function simple_genfunc at 0x00C30420
 simple_genfunc.__wrapped__
function simple_genfunc at 0x00C304B0
 simple_genfunc()
generator object wrapper at 0x00C0EE18
 simple_genfunc.__wrapped__()
generator object simple_genfunc at 0x00C0ED28

As you can see the generator object's __name__ remained the hardcoded one.

--
messages: 215968
nosy: SzieberthAdam
priority: normal
severity: normal
status: open
title: Unable to make decorated generator object to inherit generator 
function's __name__
type: enhancement
versions: Python 3.4

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



[issue1191964] asynchronous Subprocess

2014-04-12 Thread Richard Oudkerk

Richard Oudkerk added the comment:

I added some comments.

Your problem with lost data may be caused by the fact you call ov.cancel() and 
expect ov.pending to tell you whether the write has/will succeed.  Instead you 
should use ov.getresult() and expect either success or an aborted error.

--

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



[issue21206] Provide legit HTTPS certificate for http://bugs.python.org/, redirect HTTP to HTTPS

2014-04-12 Thread Ram Rachum

New submission from Ram Rachum:

Otherwise people could MITM our passwords.

--
components: Demos and Tools
messages: 215970
nosy: cool-RR
priority: normal
severity: normal
status: open
title: Provide legit HTTPS certificate for http://bugs.python.org/, redirect 
HTTP to HTTPS

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



[issue20624] Clarify recommendation to inherit from Exception

2014-04-12 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
assignee: docs@python - mark.dickinson

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



[issue21204] published examples don't work

2014-04-12 Thread Wolfgang Maier

Changes by Wolfgang Maier wolfgang.ma...@biologie.uni-freiburg.de:


--
nosy: +wolma

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



[issue16991] Add OrderedDict written in C

2014-04-12 Thread Eric Snow

Eric Snow added the comment:

After pulling up to tip and sticking in the basic **kwargs change, the results 
on the benchmark suite imply a refleak somewhere.  As soon as I sort that out 
I'll push up the updated patch.

--

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



[issue16991] Add OrderedDict written in C

2014-04-12 Thread Stefan Krah

Changes by Stefan Krah stefan-use...@bytereef.org:


--
nosy: +skrah

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



[issue21009] Potential deadlock in concurrent futures when garbage collection occurs during Queue.get

2014-04-12 Thread Mark Dickinson

Mark Dickinson added the comment:

Adding Brian Quinlan to the nosy list.

I don't see an easy way around this other than documenting it and recommending 
that people do explicit executor shutdown where necessary.

Weakref callbacks are dangerous things.  Weakref callbacks that acquire a lock 
at any point doubly so.

--
nosy: +bquinlan

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



[issue21204] published examples don't work

2014-04-12 Thread Berker Peksag

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


--
nosy: +sbt

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



[issue7951] Should str.format allow negative indexes when used for __getitem__ access?

2014-04-12 Thread Eric V. Smith

Changes by Eric V. Smith e...@trueblade.com:


--
assignee: eric.smith - docs@python
nosy: +docs@python

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



[issue20128] Re-enable test_modules_search_builtin() in test_pydoc

2014-04-12 Thread koobs

Changes by koobs koobs.free...@gmail.com:


--
nosy: +koobs

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



[issue20123] pydoc.synopsis fails to load binary modules

2014-04-12 Thread koobs

Changes by koobs koobs.free...@gmail.com:


--
nosy: +koobs

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



[issue21207] urandom persistent fd - not re-openned after fd close

2014-04-12 Thread Steven Hiscocks

New submission from Steven Hiscocks:

I've seen an issue with using urandom on Python 3.4. I've traced down to fd 
being closed (not by core CPython, but by third party library code). After 
this, access to urandom fails.

I assume this is related to persistent fd for urandom in 
http://bugs.python.org/issue18756

$ python -c import os;os.urandom(1);os.closerange(3,256);os.urandom(1)
Traceback (most recent call last):
  File string, line 1, in module
OSError: [Errno 9] Bad file descriptor

--
messages: 215973
nosy: kwirk
priority: normal
severity: normal
status: open
title: urandom persistent fd - not re-openned after fd close
type: crash
versions: Python 3.4

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



[issue21206] Provide legit HTTPS certificate for http://bugs.python.org/, redirect HTTP to HTTPS

2014-04-12 Thread Ned Deily

Ned Deily added the comment:

Please report issues with bugs.python.org to its issue tracker (Help - Report 
Tracker Problem): http://psf.upfronthosting.co.za/roundup/meta/

--
nosy: +ned.deily
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue21207] urandom persistent fd - not re-openned after fd close

2014-04-12 Thread STINNER Victor

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


--
nosy: +pitrou

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



[issue5845] rlcompleter should be enabled automatically

2014-04-12 Thread R. David Murray

R. David Murray added the comment:

This issue should have gone back to being a release blocker after the alpha 
release to fix the tab-as-indent issue, but obviously that didn't happen (I 
forgot about it myself).  Please open a new issue requesting a fix for this bug 
(that tab doesn't work as indent at the ... prompt), referencing the discussion 
in this issue.

--

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



[issue20010] time.strftime('%z') didn't make +HHMM return in windows xp

2014-04-12 Thread R. David Murray

R. David Murray added the comment:

Can you suggest how to improve the docs?

--

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



[issue20010] time.strftime('%z') didn't make +HHMM return in windows xp

2014-04-12 Thread Aaron Meurer

Aaron Meurer added the comment:

Nowhere at https://docs.python.org/3.5/library/time.html#time.strftime is it 
indicated that %z behaves differently on different platforms. What it *does* 
say is

%z  Time zone offset indicating a positive or negative time difference from 
UTC/GMT of the form +HHMM or -HHMM, where H represents decimal hour digits and 
M represents decimal minute digits [-23:59, +23:59].

I see now that this is mentioned in the footnote at the bottom of the page.

I would split that footnote into two notes. It's really about two things, %Z/%z 
compatibility, and the RFC. The RFC note should stay as it is in the footnote, 
but I would move the bits about %Z/%z compatibility much close to their entries 
in the table, as that is where people are going to look (I personally wouldn't 
even hide the information in a footnote, but that can be debated).

--

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



[issue20010] time.strftime('%z') didn't make +HHMM return in windows xp

2014-04-12 Thread Aaron Meurer

Aaron Meurer added the comment:

I also just noticed that the %z entry in the table wasn't added until the 
Python 3.3 docs, although it apparently works at least in OS X in Python 2.7 (I 
can't test Windows right now).  Was it supposed to be one of the additional 
directives supported on certain platforms?

--

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



[issue15955] gzip, bz2, lzma: add option to limit output size

2014-04-12 Thread Nikolaus Rath

Changes by Nikolaus Rath nikol...@rath.org:


Added file: http://bugs.python.org/file34792/issue15955_r3.diff

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



[issue20578] BufferedIOBase.readinto1 is missing

2014-04-12 Thread Nikolaus Rath

Nikolaus Rath added the comment:

Seems as if no one has an opinion on this at all: 
https://mail.python.org/pipermail/python-dev/2014-April/133739.html

What next?

--

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



[issue19414] iter(ordered_dict) yields keys not in dict in some circumstances

2014-04-12 Thread Chris Angelico

Chris Angelico added the comment:

I agree that current behaviour is a bit confusing; also, the implication is 
that deleting from the dictionary while you have an iterator may leave some 
hanging references around the place, which raises a red flag in my mind (maybe 
something else might find the stale data, too).

My inclination would be to Armin's idea of setting next to None. Seems simpler 
than trying too hard to patch around something that's a bad idea anyway.

--
nosy: +Rosuav

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



[issue19414] iter(ordered_dict) yields keys not in dict in some circumstances

2014-04-12 Thread Alexander Belopolsky

Changes by Alexander Belopolsky alexander.belopol...@gmail.com:


--
nosy: +belopolsky

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



[issue21207] urandom persistent fd - not re-openned after fd close

2014-04-12 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Well, if a third-party library decides to close fds it doesn't own, that 
library should have a bug reported to it.

--

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



[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-12 Thread R. David Murray

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


--
nosy: +r.david.murray

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



[issue21207] urandom persistent fd - not re-openned after fd close

2014-04-12 Thread Steven Hiscocks

Steven Hiscocks added the comment:

I agree in part, but it's quite common to close fd's in some cases like in a 
child process after using os.fork(). There is no way, as far as I'm aware, to 
identify which fd is associated with /dev/urandom to keep it open; or anyway to 
reopen it such that other libraries which depend on it can use it (for example 
tempfile.TemporaryFile).

--

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



[issue21208] Change default behavior of arguments with type bool when options are specified

2014-04-12 Thread Karl Richter

New submission from Karl Richter:

As arguments with type bool are the only ones whose values can be manipulated 
without passing an option to the argument on CLI, the default behavior for 
those should be changed from ignoring options to failing when options are 
specified. Consider the following example:
code

import argparse

cache_size_default=1000
cache_size_option = c
cache_size_option_long = cache-size
start_db_default = False
start_db_option = t
start_db_option_long = start-db


parser = argparse.ArgumentParser(description='Process some integers.')  
 
parser.add_argument(-%s % start_db_option, --%s % start_db_option_long, 
default=start_db_default, type=bool, nargs='?',
   help='@TODO', dest=start_db_option_long)
parser.add_argument(-%s % cache_size_option, --%s % cache_size_option_long, 
type=int, nargs='?', default=cache_size_default, 
   help='size of osm2pgsql cache', dest=cache_size_option_long)

def osm_postgis_transform(cache_size=cache_size_default, 
start_db=start_db_default):
print(start_db, cache_size)

if __name__ == __main__:
args = vars(parser.parse_args())
osm_postgis_transform(cache_size=args[cache_size_option_long], 
start_db=args[start_db_option_long])
/code

When the script is invoked with 
code
python issue-argparse.py --start-db False --cache-size 2000
/code
The value for start-db is True which is not really intuitive. Changing the 
default behavior to either fail at argument parsing or overwrite the argument 
value would be an improvement in my opinion.

--
components: Library (Lib)
messages: 215983
nosy: krichter
priority: normal
severity: normal
status: open
title: Change default behavior of arguments with type bool when options are 
specified
type: behavior
versions: Python 3.4

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



[issue20578] BufferedIOBase.readinto1 is missing

2014-04-12 Thread Martin v . Löwis

Martin v. Löwis added the comment:

I put some review into rietveld. In addition, please avoid code duplication of 
more than three subsequent lines of code.

--
nosy: +loewis

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



[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-04-12 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Nikolaus, can you please restate from scratch what the issue is? If the issue 
is still the one you posed in msg214776, I think the issue should be closed as 
invalid - it's *not* the case that there is no good reason for TextIOWrapper 
not accepting any bytes-like object. Or, to drop the double negation: as Serhiy 
states, read1() should return bytes, and it's perfectly fine to rely on that. 
Your MyByteStream ought to fail, so it is correct behaviour that it does fail.

--
nosy: +loewis

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



[issue21208] Change default behavior of arguments with type bool when options are specified

2014-04-12 Thread Karl Richter

Karl Richter added the comment:

I've been mistaken about the behavior if no argument is specified (then the 
argument value is None), so this is a bug!

--

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



[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-04-12 Thread Nikolaus Rath

Nikolaus Rath added the comment:

My usecase is that I have a binary stream class that internally uses 
memoryviews. I would like to read text data from this stream and thus 
encapsulate it in a TextIOWrapper. Currently, TextIOWrapper (correctly) expects 
read() to return bytes and fails if it receives any other bytes-like object. I 
can change my custom class to internally convert to bytes, but this means that 
the data is needlessly copied around and affects every other consumer of the 
class as well.

Changing TextIOWrapper to work with any bytes-like object is (as far as I can 
see) rather simple. It does not introduce any new branches in the code, and it 
does not change the behavior for bytes objects at all. It does, however, 
eliminate unnecessary memcopies for classes that do not internally work with 
bytes objects. Therefore, I was hoping this patch could be considered for 
inclusion.

The MyByteStream example that I gave in the first message is useless. I merely 
included it as the smallest possible code fragment that currently does not 
work, but would work after the patch in an attempt to illustrate what I meant - 
but apparently it had the opposite effect.

Thanks for considering!

--
type: behavior - enhancement
versions:  -Python 3.4

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



[issue20578] BufferedIOBase.readinto1 is missing

2014-04-12 Thread Nikolaus Rath

Nikolaus Rath added the comment:

Thanks for the review! Attached is a new patch. I was actually pretty careful 
to avoid any code duplication.. are you refering to the readinto1() 
implementations for BytesIO and BufferedReader in Lib/_pyio.py?

--
Added file: http://bugs.python.org/file34793/issue20578_r2.diff

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



[issue20578] BufferedIOBase.readinto1 is missing

2014-04-12 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Put up a new review.

--

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



[issue1191964] asynchronous Subprocess

2014-04-12 Thread Josiah Carlson

Josiah Carlson added the comment:

No, the problem is that that ov.cancel() will attempt to cancel the IO, but a 
subsequent ov.getresult(True) doesn't always return what was *actually* written 
to the pipe unless you explicitly wait for the result to be available. But even 
if you explicitly wait for ov.pending to be False, even if you alternate 
between checking for ov.pending to be False and for WaitForSingleObject() to 
return that the event was signaled (which may never actually happen, according 
to my tests), ov.getresult(True) could *still* raise an exception (that same 
WinError 995), and we *still* don't know how much data was sent.

As one of your comments on subprocess_2.patch, you said:
 Should probably add an assertion that 512 bytes was written.

That's not always the case. I found several odd byte writes, and some writes 
that were whatever blocksize I'd chosen minus 32 bytes (though not reported on 
the write side due to the aforementioned exception/counting error, but the 
child process read an odd number of bytes).

How about you take a look at the patch I'm uploading now. It gets rid of the 
loop in write_nonblocking(), as per Giampaolo's request adds a blocksize 
parameter on reading, and because I was in there, I added a timeout to writing.

If in this new patch I'm doing something wrong, and you can explain via code 
how to guarantee that ProcessTestCase._test_multiple_passes doesn't fail, I'd 
really appreciate it.

--
Added file: http://bugs.python.org/file34794/subprocess_3.patch

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



[issue21209] q.put(some_tuple) fails when PYTHONASYNCIODEBUG=1

2014-04-12 Thread Richard Kiss

New submission from Richard Kiss:

import asyncio
import os

def t1(q):
yield from asyncio.sleep(0.5)
q.put_nowait((0, 1, 2, 3, 4, 5))

def t2(q):
v = yield from q.get()
print(v)

q = asyncio.Queue()
asyncio.get_event_loop().run_until_complete(asyncio.wait([t1(q), t2(q)]))



When PYTHONASYNCIODEBUG is set to 1, this causes a strange error:

TypeError: send() takes 2 positional arguments but 7 were given

See also https://gist.github.com/richardkiss/10564363

--
components: Library (Lib)
files: put_get_bug.py
messages: 215991
nosy: richard.kiss
priority: normal
severity: normal
status: open
title: q.put(some_tuple) fails when PYTHONASYNCIODEBUG=1
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file34795/put_get_bug.py

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



[issue21208] Change default behavior of arguments with type bool when options are specified

2014-04-12 Thread Josh Rosenberg

Josh Rosenberg added the comment:

If your goal is to get a boolean on/off switch, that's what action='store_true' 
is for. You don't need to specify nargs or type at all; using bool as the type 
means it wants an argument, and will pass the string form of the argument to 
the bool constructor; since only the empty string is False, it would be quite 
difficult to pass it intuitively.

--
nosy: +josh.rosenberg

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



[issue21209] q.put(some_tuple) fails when PYTHONASYNCIODEBUG=1

2014-04-12 Thread Richard Kiss

Richard Kiss added the comment:

For a reason that I don't understand, this patch to asyncio fixes the problem:


--- a/asyncio/tasks.py  Mon Mar 31 11:31:16 2014 -0700
+++ b/asyncio/tasks.py  Sat Apr 12 20:37:02 2014 -0700
@@ -49,7 +49,8 @@
 def __next__(self):
 return next(self.gen)
 
-def send(self, value):
+def send(self, value, *args):
 return self.gen.send(value)
 
 def throw(self, exc):


Maybe the problem really is somewhere else, but this works.

--

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



[issue21204] published examples don't work

2014-04-12 Thread R. David Murray

R. David Murray added the comment:

Testing the documentation examples is a long term goal, which people 
occasionally contribute to.  I think there is an open issue about using the 
Sphinx doctest support, that for a long time was blocked by the documentation 
tool chain not using python3.  Some examples are very hard to run in an 
automated fashion, as well.  Perhaps the examples can be tweaked...but in some 
cases they can't, without losing their teaching value.  I have a feeling the 
multiprocessing examples fall into this category, as I seem to remember doing a 
pass of testing of them a (python3) release or two ago.  I did not test them on 
windows, though.

--
assignee:  - docs@python
components: +Documentation -Cross-Build
nosy: +docs@python, r.david.murray

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



[issue21205] Unable to make decorated generator object to inherit generator function's __name__

2014-04-12 Thread R. David Murray

R. David Murray added the comment:

I think this is a specific case of a more general need to improve 'wraps' that 
was discussed on python-dev not too long ago.

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

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



[issue21208] Change default behavior of arguments with type bool when options are specified

2014-04-12 Thread R. David Murray

R. David Murray added the comment:

Yeah, this is a bit non-obvious, but it is a specific instance of the general 
way that argparse handles types.  So as far as I can see there really isn't 
anything to do here.

--
nosy: +r.david.murray
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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