[issue10572] Move test sub-packages to Lib/test

2013-02-24 Thread Geoff Wilson

Geoff Wilson added the comment:

The move will need to be done by someone with commit access. These patches came 
from using hg mv.

After doing the move, there is some cleanup needed in each. These changes are 
included in the attached patches.

--

___
Python tracker 

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



[issue17293] uuid.getnode() MAC address on AIX

2013-02-24 Thread Aivars Kalvāns

New submission from Aivars Kalvāns:

uuid.getnode() on AIX returned random integer. This patch finds MAC in output 
of `netstat -ia`.
Tested on AIX 5.2

--
components: Library (Lib)
files: aix_mac.patch
keywords: patch
messages: 182925
nosy: aivarsk
priority: normal
severity: normal
status: open
title: uuid.getnode() MAC address on AIX
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file29229/aix_mac.patch

___
Python tracker 

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



[issue16997] subtests

2013-02-24 Thread Nick Coghlan

Nick Coghlan added the comment:

My day job these days is to work on the Beaker test system 
(http://beaker-project.org).

I realised today that it actually includes a direct parallel to Antoine's 
proposed subtest concept: whereas in unittest, each test currently has exactly 
one result, in Beaker a given task may have *multiple* results. The overall 
result of the task is then based on the individual results (so if any result is 
a failure, the overall test is a failure).

"tasks" are the smallest addressable unit in deciding what to run, but each 
task may report multiple results, allowing fine-grained reporting of what 
succeeded and what failed.

That means there's a part of Antoine's patch I disagree with: the change to 
eliminate the derived "overall" result attached to the aggregate test. I think 
Beaker's model, where there's a single result for the overall task (so you can 
ignore the individual results if you don't care), and the individual results 
are reported separately (if you do care), will make it easier to provide 
something that integrates cleanly with existing test runners.

The complexity involved in attempting to get expectedFailure() to behave as 
expected is also a strong indication that there are still problems with the way 
these results are being aggregated.

--

___
Python tracker 

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



[issue10799] Improve webbrowser (.open) doc and behavior

2013-02-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I no longer think we should touch the url; just pass it to each browser in 
turn, as needed, and let the user get the result.

--
versions: +Python 3.3, Python 3.4 -Python 3.2

___
Python tracker 

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



[issue10799] Improve webbrowser (.open) doc and behavior

2013-02-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Before closing #8936, I realized that perhaps my user default browser *is* 
being called but is returning an error code. It does not really matter, where 
the error code comes from. I think 'using the default browser' should be 
expanded to ''using the first default browser that claims to succeed.'. Also, 
'default browser list' should be explained in a sentence before the one about 
over-riding it with an env. var. It depends on the software on the machine at 
import in addition to the platform.

--

___
Python tracker 

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



[issue16801] Preserve original representation for integers / floats in docstrings

2013-02-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Sorry, as with all similar subclasses, class op subclass = class unless one 
explicitly subclasses the answer or overrides the __op__ method to do that for 
you.

class octint(int):
'int that displays as octal'
def __str__(self):
return oct(self)
__repr__ = __str__

mode = octint(0o640)
print(mode + 4, octint(mode+4))

def __add__(self, other):
return octint(int.__add__(self, other))
# octint(self+other) is infinite recursion 

octint.__add__ = __add__
print(mode+4)
>>> 
420 0o644
0o644

--

___
Python tracker 

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



[issue17291] Login-data raising EOFError

2013-02-24 Thread Gregory P. Smith

Gregory P. Smith added the comment:

File "/home/riley/pywikipedia/userinterfaces/terminal_interface_base.py", line 
129, in input
text = getpass.getpass('')

you can't call getpass without stdin or a terminal and expect it to do 
anything.  your problem is in the pywikipedia code, not Python's getpass module.

http://docs.python.org/2/library/getpass.html

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue17291] Login-data raising EOFError

2013-02-24 Thread Riley

Riley added the comment:

The script is being run from a cronjob with saved login data. And thus, there 
is no stdin for cronjobs as there's no attached terminal. Reopening.

--
resolution: invalid -> 
status: closed -> open

___
Python tracker 

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



[issue17291] Login-data raising EOFError

2013-02-24 Thread Gregory P. Smith

Gregory P. Smith added the comment:

yeah that looks like stdin was closed or was /dev/null.

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue8936] webbrowser regression on windows

2013-02-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The regression issue is red herring. An issue should propose new behavior 
(based on an understanding of the doc and actual current behavior). Then ask: 
"Is the proposed behavior better than the current behavior?", and "Is the 
current behavior a bug?". After reading the doc and the code, I am convinced 
that current behavior is close to the implied wanted behavior, and that it is 
not a bug.

The doc says
 webbrowser.open(url, new=0, autoraise=True)
Display url using the default browser.

What does 'default browswer' mean? Near the top, the doc says "If the 
environment variable BROWSER exists, it is interpreted to override the platform 
default list of browsers,". So the 'default browser' is actually the 'default 
browser list'. What open() does is to try each in turn and stop when one says 
it succeeded. So the doc should say 'using the first default browser that 
claims to succeed.'

What does 'default browser list' mean? It depends on the platform *and* the 
software loaded on the particular machine when webbrowser is first imported in 
a particular instance of the interpreter. The 'platform' part is in the quote 
above, the rest is not. I will open a separate doc issue.

On Windows, the list starts with 'default Windows browser', which calls 
os.startfile(), which, I believe, does call the user default browser. Next is 
Internet Explorer -- if available at that time on the particular machine! If 
the user-default browser rejects the url, then IE is tried.

On my win7 machine today, I have Firefox the default and IE available. Firefox 
rejects 127.0.0.1:8080 with an 'Unable to connect' error box. IE 'accepts' it 
in the sense that it displays an information starting 'The webpage cannot be 
displayed'. For 'invalid.xxx', IE displays the page for a German domain 
registrar. I strongly suspect that the change Anatoly saw was a difference in 
IE, out of Python's control.

Georg, if you think I got it wrong, please correct.

--
nosy: +terry.reedy
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue17292] Autonumbering in string.Formatter doesn't work

2013-02-24 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +eric.smith

___
Python tracker 

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



[issue17292] Autonumbering in string.Formatter doesn't work

2013-02-24 Thread Nathan Binkert

New submission from Nathan Binkert:

Autonumbering with string.format does not work as it does in str.format:

>>> '{}'.format(1)
'1'
>>> import string
>>> string.Formatter().format('{}', 1)
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/nate/src/python3/Lib/string.py", line 164, in format
return self.vformat(format_string, args, kwargs)
  File "/Users/nate/src/python3/Lib/string.py", line 168, in vformat
result = self._vformat(format_string, args, kwargs, used_args, 2)
  File "/Users/nate/src/python3/Lib/string.py", line 190, in _vformat
obj, arg_used = self.get_field(field_name, args, kwargs)
  File "/Users/nate/src/python3/Lib/string.py", line 253, in get_field
obj = self.get_value(first, args, kwargs)
  File "/Users/nate/src/python3/Lib/string.py", line 210, in get_value
return kwargs[key]

--
components: Library (Lib)
messages: 182916
nosy: binkert
priority: normal
severity: normal
status: open
title: Autonumbering in string.Formatter doesn't work
versions: Python 2.7, Python 3.3

___
Python tracker 

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



[issue17283] Lib/test/__main__.py should share code with regrtest.py

2013-02-24 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Here is a new patch which does not use the global keyword.

--
Added file: http://bugs.python.org/file29228/issue-17283-2.patch

___
Python tracker 

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



[issue16406] move the "Uploading Packages" section to distutils/packageindex.rst

2013-02-24 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Attaching an improved patch.

This patch improves the introductory wording, adds some additional hyperlinks, 
and changes the order of one of the inserted sections.

--
Added file: http://bugs.python.org/file29227/issue-16406-4.patch

___
Python tracker 

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



[issue10572] Move test sub-packages to Lib/test

2013-02-24 Thread Ezio Melotti

Ezio Melotti added the comment:

> Naming of files has been kept the same in the move from
> Lib/sqlite/test, to allow for easier merging of future patches.

This should be done with "hg mv" -- this will also allow to change the name 
while preserving the history if that's desirable.

--

___
Python tracker 

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



[issue17223] Initializing array.array with unicode type code and buffer segfaults

2013-02-24 Thread Ezio Melotti

Ezio Melotti added the comment:

Even if deprecated it should continue to work (if possible).

--

___
Python tracker 

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



[issue10952] Don't normalize module names to NFKC?

2013-02-24 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
versions:  -Python 3.1

___
Python tracker 

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



[issue10952] Don't normalize module names to NFKC?

2013-02-24 Thread Atsuo Ishimoto

Atsuo Ishimoto added the comment:

Converting identifiers to NFKC is problematic to work with FULLWIDTH letters 
such as 'a'(FULLWIDTH LATIN SMALL LETTER A).

We can create module named 'aaa.py', but this module could not be imported on 
all platforms I know.

>>> import aaa
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named 'aaa'

Talking about Japanese environment, I don't see benefit to normalize variable 
names. FULLWIDTH/HALFWIDTH compatibility characters are commonly used here, and 
they are recognized different characters.  It would be too late to argue, but 
converting to normal form NKC instead of NFKC would be better. Python 
distinguishes small letters and large letters, but doesn't distinguish 
fullwidth and halfwidth. This is a pretty surprising behavior to me.

--

___
Python tracker 

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



[issue17283] Lib/test/__main__.py should share code with regrtest.py

2013-02-24 Thread Chris Jerdonek

Changes by Chris Jerdonek :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue17283] Lib/test/__main__.py should share code with regrtest.py

2013-02-24 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Attaching patch.

The use of "global TEMPDIR" isn't ideal.  Alternatively, TEMPDIR's value when 
sysconfig.is_python_build() is true can be set when initially setting TEMPDIR:

http://hg.python.org/cpython/file/96f08a22f562/Lib/test/regrtest.py#l203

--
keywords: +patch
Added file: http://bugs.python.org/file29226/issue-17283-1.patch

___
Python tracker 

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



[issue16801] Preserve original representation for integers / floats in docstrings

2013-02-24 Thread Larry Hastings

Larry Hastings added the comment:

FWIW I think the octint class is a great idea.  It's nice and localized, and it 
should have no performance impact and only a small maintenance impact.  It'll 
also preserve the readability of the default if you pull it out with 
inspect.getfullargspec / inspect.Signature and repr it.  I'm not sure how IDLE 
et all produce their tooltips, but whatever technique they use octint should 
work there.  Heck, it should even survive calculations for default values (as I 
mentioned in the original post), assuming that int + octint = octint.

Is there a significant downside to octint that I'm missing?

--

___
Python tracker 

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



[issue16801] Preserve original representation for integers / floats in docstrings

2013-02-24 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Your indeed cumbersome and overly specific process has almost nothing to do 
with what I proposed and gave two examples of. Please reread and understand 
msg178542 before you criticize it.

Class octint pythonically solves the octal mode display problem that started 
this issue, and in my opinion about as elegantly as possible.

--

___
Python tracker 

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



[issue10952] Don't normalize module names to NFKC?

2013-02-24 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto :


--
nosy: +ishimoto

___
Python tracker 

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



[issue16121] shlex.shlex.error_leader() reports incorrect line number

2013-02-24 Thread R. David Murray

R. David Murray added the comment:

Is it necessarily a bug if the behavior is different with posix=True or False?  
If I understand correctly, non-posix mode is a backward compatibility mode, and 
really nobody "should" be using non-posix mode any more :)

--

___
Python tracker 

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



[issue16121] shlex.shlex.error_leader() reports incorrect line number

2013-02-24 Thread Birk Nilson

Birk Nilson added the comment:

After investigating the issue I have a couple of proposals.

Although a bit vague, the documentation of shlex.lineo seems to suggest that it 
should be incremented immediately on finding a newline character. Changing this 
to allow wrapped lines within a token without incrementing the line number 
changes the existing shlex API. Something I believe should be avoided since 
netrc relies on the existing behavior and third-party modules might too.

Instead I recommend the following steps.
Step #1: Fix the immediate issue of getting different line numbers for the same 
input depending on whether posix=(True|False), but keep the current - greedy - 
behavior of shlex.lineo.
Step #2: A separate patch introduces shlex.wrapped_lineo which does not 
increment the lineno immediately, but prior to reading the next token - as 
introduced in my previous patch.

Step #2 should arguably be introduced in a separate issue - if at all - since 
it is a new feature to the shlex API.

I will provide a patch for #1 within the next day or two along with one for #2 
if you guys think it is a good idea.

--

___
Python tracker 

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



[issue17226] libintl should also check for libiconv

2013-02-24 Thread Jeffrey Armstrong

Jeffrey Armstrong added the comment:

I would suggest a more straightforward patch.  My understanding is that the 
standard library on the m68k-atari-mint platform does not include the necessary 
gettext functionality.  This functionality is present in glibc, however.  A 
more direct test might be to see if gettext is available in the standard 
library.  If so, proceed.  If not, attempt to link in libintl and its 
dependency:

--- a/configure.ac  Sat Feb 23 18:52:51 2013 +0100
+++ b/configure.ac  Sun Feb 24 17:59:41 2013 -0500
@@ -2180,6 +2180,14 @@
[Define to 1 if libintl is needed for locale functions.])
 LIBS="-lintl $LIBS"])
 
+# search for gettext in either libc or libintl
+AC_CHECK_FUNC(gettext, [],
+   [AC_CHECK_LIB(intl, gettext, 
+  [LIBS="$LIBS -lintl -liconv"],
+  [AC_MSG_ERROR([unable to find the gettext() function])],
+  [-liconv])
+])
+

--

___
Python tracker 

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



[issue17290] pythonw - loading cursor bug when launching scripts

2013-02-24 Thread netrick

netrick added the comment:

I just want to add that it *may* be the issue with the new windows launcher 
introtuced in 3.3. Because in 2.7 everything runs great and running through 
"pythonw" command works flawlessy as well. I think it's worth to look into it.

--

___
Python tracker 

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



[issue17226] libintl should also check for libiconv

2013-02-24 Thread Jeffrey Armstrong

Jeffrey Armstrong added the comment:

Alan, I was about to file a bug as well because I'm not even getting a libintl 
dependency to be acknowledged under these build conditions.  What versions of 
gettext and GCC are you using?

Ned, not sure if it matters, but the libintl page does specify that -liconv 
must also be linked as it is a dependency:

http://www.gnu.org/software/gettext/FAQ.html#integrating_undefined

--
nosy: +Jeffrey.Armstrong

___
Python tracker 

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



[issue17267] datetime.time support for '+' and 'now'

2013-02-24 Thread Joar Wandborg

Joar Wandborg added the comment:

I am adding yet another patch. This time it has

- TZ-aware tests (datetimetester.TestTimeTZ).
- C time_subtract method.
- Pure time.__sub__ method.

in addition to the previous

- Tests for time + timedelta
- C time_add
- Pure time.__add__

There's one issue though, and that is that I have not quite figured out 
TZ-aware cross-TZ `time - timedelta` i.e.

time(0, tzinfo=est) - timedelta(hours=1) * 5 == time(0, tzinfo=utc)

fails.

I have included a failing test for it.

--
Added file: http://bugs.python.org/file29225/issue17267-v2.patch

___
Python tracker 

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



[issue17291] Login-data raising EOFError

2013-02-24 Thread R. David Murray

R. David Murray added the comment:

My guess would be that stdin is closed.  I doubt that it is a python problem.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue15305] Test harness unnecessarily disambiguating twice

2013-02-24 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I don't think support.temp_cwd() should be changed for this issue (or needs to 
be).  Also, changing it in the proposed way could mask errors in the test suite 
since tests were written against the current behavior.

regrtest.py and __main__.py should both behave the same with respect to 
creating the temp dir, etc. since both invocations should work from the 
command-line:

http://hg.python.org/cpython/file/96f08a22f562/Lib/test/regrtest.py#l9

--

___
Python tracker 

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



[issue1613500] Write mode option for fileinput module.

2013-02-24 Thread R. David Murray

R. David Murray added the comment:

As far as I can see from a quick look, the problem this patch addresses still 
exists in Python3, and in Python3 it be (more of?) a bug.  That is, the output 
file is opened in text mode, regardless of whether the input mode was text or 
bytes.  I'm not sure about the solution; it seems like it makes more sense to 
deduce the output mode from the input mode.

The test changes, though, are obsolete.

--
assignee: BreamoreBoy -> 
nosy: +r.david.murray
versions: +Python 3.5 -Python 3.2

___
Python tracker 

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



[issue17263] crash when tp_dealloc allows other threads

2013-02-24 Thread Charles-François Natali

Charles-François Natali added the comment:

I don't know how OS X crash report works, but it seems to have at
least some debug info available, since some ymbols are resolved in the
backtrace.
You might be able to get more info with gdb, with something like:
"""
gdb /path/to/python
(gdb) info line *
(gdb) disassemble 
"""

Otherwise, is there are way to run your code on Linux?

--

___
Python tracker 

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



[issue17290] pythonw - loading cursor bug when launching scripts

2013-02-24 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +brian.curtin, terry.reedy, tim.golden

___
Python tracker 

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



[issue17094] sys._current_frames() reports too many/wrong stack frames

2013-02-24 Thread Charles-François Natali

Charles-François Natali added the comment:

Thanks, it's surprising this was never noticed before.
Your patch has two issues:
- it doesn't clear the thread state before deleting it, which would leak the 
frame, thread-specific dict, etc
- it only clears the thread states after the current thread state: if the 
current thread is not at the head of the linked list - if it's not the most 
recently created thread - some thread states won't get cleared

I'm attaching a patch doing the cleanup in PyEval_ReInitThreads(), with test.

--

___
Python tracker 

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



[issue17291] Login-data raising EOFError

2013-02-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue17291] Login-data raising EOFError

2013-02-24 Thread Riley

New submission from Riley:

When running Pywikipediabot and retrieving a password I get the following error:
Password for user RileyBot on wiktionary:en: 
/usr/lib/python2.7/getpass.py:83: GetPassWarning: Can not control echo on the 
terminal.
  passwd = fallback_getpass(prompt, stream)
Warning: Password input may be echoed.
Traceback (most recent call last):
  File "globalfunc1.py", line 250, in 
main()
  File "globalfunc1.py", line 244, in main
bot.run()
  File "globalfunc1.py", line 197, in run
sandboxPage.put(translatedContent, translatedMsg)
  File "/home/riley/pywikipedia/wikipedia.py", line 1990, in put
sysop=sysop)
  File "/home/riley/pywikipedia/wikipedia.py", line 1863, in _getActionUser
self.site().forceLogin(sysop = sysop)
  File "/home/riley/pywikipedia/wikipedia.py", line 5861, in forceLogin
if loginMan.login(retry = True):
  File "/home/riley/pywikipedia/login.py", line 307, in login
password = True)
  File "/home/riley/pywikipedia/wikipedia.py", line 8927, in input
data = ui.input(question, password)
  File "/home/riley/pywikipedia/userinterfaces/terminal_interface_base.py", 
line 129, in input
text = getpass.getpass('')
  File "/usr/lib/python2.7/getpass.py", line 83, in unix_getpass
passwd = fallback_getpass(prompt, stream)
  File "/usr/lib/python2.7/getpass.py", line 118, in fallback_getpass
return _raw_input(prompt, stream)
  File "/usr/lib/python2.7/getpass.py", line 135, in _raw_input
raise EOFError
EOFError

While this may have something to do with Pywikipediabot, it all comes down to 
python. Help?

--
components: None
messages: 182896
nosy: Riley
priority: normal
severity: normal
status: open
title: Login-data raising EOFError
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue17290] pythonw - loading cursor bug when launching scripts

2013-02-24 Thread netrick

New submission from netrick:

Firstly, just to mention - the issue that I will describe doesn't exist in 
python 2.7. It is python3 and windows related (python 3.3 for sure, didn't test 
previous). I also tested it on 2 different PCs (one fresh windows install, 
second long running with different hardware), so it's not my OS messed up.

So - the issue appears with every gui script I tried (PySide and tkinter, 
various codes).  Basically when I have the script saved as "*.py", everything 
is great but there is unwanted console. So I save the script as "*.pyw" to run 
it using "pythonw" without console. When I run it  there is indeed no console, 
but for the first 10-15 seconds no matter what I do the cursor is "loading 
cursor", everywhere in Windows. (see the screen I uploaded to this issue). I 
can click everything but the cursor won't return to normal for about 15 secs. 
Of course, the cursor is normal when using standard python 3.3 (with console) 
or pythonw 2.7.

The code pasted from 3.3 documentation which reproduces the problem:

#START CODE
import tkinter as tk

class Application(tk.Frame):
def __init__(self, master=None):
tk.Frame.__init__(self, master)
self.pack()
self.createWidgets()

def createWidgets(self):
self.hi_there = tk.Button(self)
self.hi_there["text"] = "Hello World\n(click me)"
self.hi_there["command"] = self.say_hi
self.hi_there.pack(side="top")

self.QUIT = tk.Button(self, text="QUIT", fg="red",
command=root.destroy)
self.QUIT.pack(side="bottom")

def say_hi(self):
print("hi there, everyone!")

root = tk.Tk()
app = Application(master=root)
app.mainloop()
#END CODE

To sum up, the issue is present with pythonw 3.3 on Windows XP 32 bit.
BUT! When I typed in terminal:

ftype Python.File=C:\Python33\pythonw.exe "%1" %*

then every .py file started to be run using pythonw. What matters is in that 
case, there is no loading cursor at all! Add to it that in python 2.7 the issue 
doesn't exist and I think that in recent windows packages something with 
extensions is messed up. I have no idea what, but this stops me from using 
python3 for serious GUI development on windows (which is something I really 
want to do).

I wanted to write some commercial GUI apps using python, but I can't say my 
customers to type that line in terminal. Also, they won't accept terminal or 15 
sec loading cursor. It's just unwanted thing. Right now I have to use python 
2.7, but I like python 3 much more. I think it's something with the way ".pyw" 
extension is handled as something adds that loading cursor.

Python is the best, I hope that you will be able to fix it!

--
components: Installation, Tkinter, Windows
files: AZb4toA.jpg
messages: 182895
nosy: netrick
priority: normal
severity: normal
status: open
title: pythonw - loading cursor bug when launching scripts
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file29224/AZb4toA.jpg

___
Python tracker 

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



[issue11480] Cannot copy a class with a metaclass other than type

2013-02-24 Thread Jyrki Pulliainen

Jyrki Pulliainen added the comment:

Oh, my bad. The * was not just showing next to your name. Maybe someone with 
more access rights can help?

--

___
Python tracker 

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



[issue13684] httplib tunnel infinite loop

2013-02-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue11480] Cannot copy a class with a metaclass other than type

2013-02-24 Thread Daniel Urban

Daniel Urban added the comment:

I did, and I've been told that it has been added to the bug tracker: 
http://mail.python.org/pipermail/python-committers/2012-May/001987.html

--

___
Python tracker 

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



[issue1470548] Bugfix for #1470540 (XMLGenerator cannot output UTF-16)

2013-02-24 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

This patch works for me.

--

___
Python tracker 

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



[issue11480] Cannot copy a class with a metaclass other than type

2013-02-24 Thread Jyrki Pulliainen

Jyrki Pulliainen added the comment:

Hi, to be able to include your patch, could you sign the contributor form, 
please: http://www.python.org/psf/contrib/ ?

--
nosy: +nailor

___
Python tracker 

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



[issue15128] inspect raises exception when frames are misleading about source line numbers

2013-02-24 Thread Jyrki Pulliainen

Jyrki Pulliainen added the comment:

Use of IOError might be a bit problematic. The find & get return IOError if 
they can't find the source, but for mismatch if the line is not found is not to 
me an IOError.

Btw, to be able to merge your patch, you need to sign the contributor agreement 
in here: http://www.python.org/psf/contrib/contrib-form-python/

--
nosy: +nailor

___
Python tracker 

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



[issue17117] Update importlib.util.module_for_loader/set_loader to set when __loader__ = None

2013-02-24 Thread Gökcen Eraslan

Gökcen Eraslan added the comment:

I have already given my form to akheron during a Python sprint, I think he will 
submit it to PSF within a few days.

--

___
Python tracker 

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



[issue17117] Update importlib.util.module_for_loader/set_loader to set when __loader__ = None

2013-02-24 Thread Brett Cannon

Brett Cannon added the comment:

Issue #17116 will be fixed by issue #17715 if you decide to tackle it. That bug 
will require C-level changes to the module type; just FYI.

Please consider a PSF contributor form, Gökcen, if you plan to continue to 
submit code (your importlib.util fixes are simple enough to not require 
anything yet, but tests added to that plus anything you do for issue #17115 
will require the form in order for me to commit your code). Instructions can be 
found at http://www.python.org/psf/contrib/ .

And obviously thanks for taking a look at all of this!

--

___
Python tracker 

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



[issue17116] xml.parsers.expat.(errors|model) don't set the __loader__ attribute

2013-02-24 Thread Brett Cannon

Brett Cannon added the comment:

The comment is out of date; I removed the test because it was constantly 
failing.

As for the patch, it looks correct, but I plan to make a change to Python so 
that __loader__ is set by default (see the dependent issue #17115). If I don't 
get to that change I will commit the patch, else it will implicitly get fixed.

--

___
Python tracker 

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



[issue17117] Update importlib.util.module_for_loader/set_loader to set when __loader__ = None

2013-02-24 Thread Gökcen Eraslan

Gökcen Eraslan added the comment:

Of course. I have also commented on issue#17116 but I couldn't find the pyexpat 
test you mentioned. I would like to fix #17116 and #17115

--

___
Python tracker 

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



[issue17176] Document imp.NullImporter is NOT used anymore by import

2013-02-24 Thread Brett Cannon

Brett Cannon added the comment:

The docs for NullImporter need to not mention that it is used with 
sys.path_importer_cache since it isn't. As for sys.path_importer_cache, it 
should say that None is inserted and not NullImporter. Both need a 
versionchanged notation of the switch from None to NullImporter, but 
sys.path_importer_cache needs a special mention that to be fully 
backwards-compatible to check for both None and NullImporter.

And just to make sure you are looking at the right docs, Andreas, your links 
were to the Python 2.7 docs. If you look at the top of the docs you will see a 
dropdown which lets you switch to the 3.3 or 3.4 docs easily.

--

___
Python tracker 

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



[issue17117] Update importlib.util.module_for_loader/set_loader to set when __loader__ = None

2013-02-24 Thread Brett Cannon

Brett Cannon added the comment:

Yep, the patch looks right, Gökcen! If you want to update the tests and docs 
that would be great, but obviously don't feel obliged to.

--

___
Python tracker 

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



[issue10560] Fixes for Windows sources

2013-02-24 Thread Carlo Bramini

Carlo Bramini added the comment:

Hello,
no problem, the fix on GetModuleHandle() can be avoided without problems if you 
want. Anyways, although nowadays the "hybrid" operating systems like Windows 
9x/ME are dead and burried, in this particular case I would still suggest to 
use directly GetModuleHandleA(), because the instance to find is just 
"KERNEL32" and it is not made by esoteric characters. Normally, as developer 
for Windows platform, I would surely agree to use the wide char version, but 
due to the highly portable nature of Python, with my experience I learned that 
some particular conditions can make the cross compiling for Windows easier, if 
you do not explicitely add "-fshort-wchar".
BTW, the ".dll" in the string of the parameter is redundant as you can see from 
MSDN page of GetModuleHandle(), there are also few other points in the sources 
of Python that can be "optimized", but afterall these are just "fine" 
improvements, not so much important if they are compared to other things...

--

___
Python tracker 

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



[issue17289] readline.set_completer_delims() doesn't play well with others

2013-02-24 Thread Bradley Froehle

New submission from Bradley Froehle:

The `readline.set_completer_delims` doesn't play well with others because
it assumes that only it ever allocates or modifies the
rl_completer_word_break_characters buffer.  If other programs modify this
value, for example changing it from heap allocated space to stack
allocated space, the results can be catastrophic.

To remind you, the function essentially works as:

set_completer_delims(PyObject *self, PyObject *args)
{
// ...
free((void*) rl_completer_word_break_characters;
rl_completer_word_break_characters = strdup(break_chars);
// ...
}

where `break_chars` is the user provided string.

Take, for example, R as another programs which changes the readline
completer strings.  When an embedded R instance is initialized (say, using
`r2py`) something similar to the following takes place::

static void
set_rl_completer_word_break_characters(const char *new)
{
static char[201] buffer;
strncpy(buffer, new, 200);
rl_completer_word_break_characters = buffer;
}

static void
initialize_embedded_R(...)
{
// ...
set_rl_completer_word_break_characters(...);
}

As you might expect the next trip through `readline.set_completer_delims`
after initializing R will be catastrophic when we attempt to free a stack
allocate buffer.

I think we should consider modifying the `readline.set_completer_delims`
to store the allocated buffers in the module state::

set_completer_delims(PyObject *self, PyObject *args)
{
// ...
free(_readlinestate_global->break_chars);
rl_completer_word_break_characters = strdup(break_chars);
_readlinestate_global->break_chars = rl_completer_word_break_characters;
// ...
}

This would prevent the segfault and memory leaks, and would render weird
hacks (like https://bitbucket.org/lgautier/rpy2/commits/408bae913653 in
the r2py code) unnecessary.

--
components: Extension Modules
messages: 182882
nosy: bfroehle
priority: normal
severity: normal
status: open
title: readline.set_completer_delims() doesn't play well with others
type: crash
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue17288] cannot jump from a return after setting f_lineno

2013-02-24 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Oops, it occurs too with python 2.7.

--
versions: +Python 2.7

___
Python tracker 

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



[issue17279] Document which named built-in classes can be subclassed

2013-02-24 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

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



[issue17288] cannot jump from a return after setting f_lineno

2013-02-24 Thread Xavier de Gaye

New submission from Xavier de Gaye:

On python 3.3 and the default branch, the jump from a 'return' fails although
the change to f_lineno is validated, see below.

This problem does not occur with python 2.7.

$ python return.py
> /tmp/return.py(8)()
-> foo()
(Pdb) break 5
Breakpoint 1 at /tmp/return.py:5
(Pdb) continue
> /tmp/return.py(5)foo()
-> lineno = 5
(Pdb) step
--Return--
> /tmp/return.py(5)foo()->None
-> lineno = 5
(Pdb) jump 4
> /tmp/return.py(4)foo()->None
-> lineno = 4
(Pdb) where
  /tmp/return.py(8)()
-> foo()
> /tmp/return.py(4)foo()->None
-> lineno = 4
(Pdb) step
--Return--
> /tmp/return.py(8)()->None
-> foo()
(Pdb)

--
components: Interpreter Core
files: return.py
messages: 182880
nosy: xdegaye
priority: normal
severity: normal
status: open
title: cannot jump from a return after setting f_lineno
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file29223/return.py

___
Python tracker 

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



[issue17277] incorrect line numbers in backtrace after removing a trace function

2013-02-24 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> fix the issue by changing PyFrame_GetLineNumber() and the f_lineno accessors

The new patch named traced_frame.patch has been uploaded.

Also, now it is not allowed anymore to set the f_lineno attribute of a frame
that is not the frame being traced, as f_lasti is invalidated anyway on
returning to the evaluation of that frame.

--
Added file: http://bugs.python.org/file29222/traced_frame.patch

___
Python tracker 

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



[issue17287] slice inconsistency

2013-02-24 Thread R. David Murray

R. David Murray added the comment:

Thanks for the report, but this is working as designed, and is a fundamental 
part of the design of slices.

That said, I have no idea what you are referring to by saying it is 
inconsistent, and what is "upper" and "lower" referring to?

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

___
Python tracker 

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



[issue17285] subprocess.check_output incorrectly state that output is always bytes

2013-02-24 Thread R. David Murray

R. David Murray added the comment:

IMO the statement should read "and return the stdout data".  The point is that 
check_output calls Popen and accepts all its arguments except for stdout, which 
it handles itself and returns as the result.  It would probably be good to then 
follow that up with something like "This will be bytes unless 
universal_newlines is set True".

--
nosy: +r.david.murray
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue15305] Test harness unnecessarily disambiguating twice

2013-02-24 Thread Geoff Wilson

Geoff Wilson added the comment:

Both are called at different points when running './python.exe -m test -j3':
1. In __main__.py, this is called once at the start of the test run. By putting 
TESTCWD as the first/name arg, the directory is created.
2. In regrtest.py, the main file is called per test.

The support.temp_cwd command was raising a warning if the directory already 
existed. I've updated this to no longer raise a warning, although it will still 
try to create it. Passing it in explicitly as the path= argument would have it 
not try to create the directory.

--
Added file: http://bugs.python.org/file29221/issue15305-2.patch

___
Python tracker 

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



[issue11063] uuid.py module import has heavy side effects

2013-02-24 Thread Jyrki Pulliainen

Jyrki Pulliainen added the comment:

Here's a second take on the patch

--
Added file: http://bugs.python.org/file29220/issue11063_2.patch

___
Python tracker 

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



[issue11063] uuid.py module import has heavy side effects

2013-02-24 Thread Jyrki Pulliainen

Changes by Jyrki Pulliainen :


Removed file: http://bugs.python.org/file29189/issue11063_2.patch

___
Python tracker 

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



[issue17287] slice inconsistency

2013-02-24 Thread Elazar Gershuni

New submission from Elazar Gershuni:

slice behavior is not consistent for negative lower or upper arguments, which 
could be surprising:

>>> 'hello'[:-2]
'hel'
>>> 'hello'[:-1]
'hell'
>>> 'hello'[:-0]
''

this is obvious when written as literal, but not so obvious when using 
variables in expressions like 'fullname[:-len(lastname)]'. same goes for 
'lower'.

--
components: None
messages: 182874
nosy: elazar
priority: normal
severity: normal
status: open
title: slice inconsistency
type: enhancement
versions: Python 3.1

___
Python tracker 

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



[issue11063] uuid.py module import has heavy side effects

2013-02-24 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Jyrki, roundup doesn’t seem to recognize you patch so we can’t review it in 
Rietveld. Could you re-try, maybe using hg?

--

___
Python tracker 

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



[issue17286] Make subprocess handling text output with universal_newlines more obious

2013-02-24 Thread Baptiste Lepilleur

New submission from Baptiste Lepilleur:

It tooks me a while to figure out that using universal_newlines was the 
solution to "tell" subprocess that I wanted text string output instead of byte 
string.

A search on stackoverflow shows that this issue is common and the solution 
nearly unknown (answer is usually to decode the byte string manually)...

Because dealing with text output is IMHO the most common use case, the 
subprocess documentation should make it easier to "find" the recipe.

I would suggest changing the documentation so that the universal_newlines is 
made obvious as it is very important:
1) the first /bin/vikings example be modified to show the use of this flag (at 
the top of the documentation, most people copy/past that):
  >>> p = subprocess.Popen(args, universal_newlines=True) # Success!
  and at a small comment below the example to explain that flag
2) change other example similarly when that make sense, IMHO:
   - ifconfig example
   - one of the subprocess.check_output example
   - subprocess.check_output() example, consider separating the byte string / 
text string example for increased visibility
3) consider adding a section with an obvious title "Dealing with binary and 
text input/output", providing examples and pointer to the correct documentation 
(I would place it after the convenience functions section for visibility). I 
think this would help attracting "eye" on this large piece of documentation.

--
assignee: docs@python
components: Documentation
messages: 182872
nosy: Baptiste.Lepilleur, docs@python
priority: normal
severity: normal
status: open
title: Make subprocess handling text output with universal_newlines more obious
type: enhancement
versions: Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue12226] use HTTPS by default for uploading packages to pypi

2013-02-24 Thread Giovanni Bajo

Giovanni Bajo added the comment:

Please notice that a redesign of PyPI and package security is ongoing in 
catalog-sig.

--
nosy: +Giovanni.Bajo

___
Python tracker 

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



[issue17192] libffi-3.0.12 import

2013-02-24 Thread Georg Brandl

Georg Brandl added the comment:

Updating 3.x branches is fine with me.

--

___
Python tracker 

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



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2013-02-24 Thread Takayuki SHIMIZUKAWA

Takayuki SHIMIZUKAWA added the comment:

FYI. I was able to build both 32bit/64bit.

Python 2.7.3 (32bit)
WinXP Professional SP3 (x86)
Visual Studio C++ Express 2008 SP1
Microsoft Windows SDK 2008

invoke Windows SDK's `CMD Shell` and do following:

C:\tmp> setenv /x64 /release
C:\tmp> set libpath=dummy
C:\tmp> python setup.py build --plat-name=win-amd64 build_ext 
--library_dirs=C:\Python27\libs-amd64

details is here: 
http://www.freia.jp/taka/blog/python-win32-binary-building-and-x64-cross-compiling-on-32bit-platform/index.html

--
nosy: +shimizukawa

___
Python tracker 

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



[issue17285] subprocess.check_output incorrectly state that output is always bytes

2013-02-24 Thread Baptiste Lepilleur

New submission from Baptiste Lepilleur:

Documentation states:

>>> help( subprocess.check_output )
check_output(*popenargs, timeout=None, **kwargs)
Run command with arguments and return its output as a byte string.

But the most common usage is:
>>> subprocess.check_output( 'echo test', shell=True, universal_newlines=True )
'test\n'

Which obviously output a text string, not a byte string.

IMHO, one of the example should also be modified to show the existence of this 
flag, as it is what user want 90% of the times.

--
assignee: docs@python
components: Documentation
messages: 182868
nosy: Baptiste.Lepilleur, docs@python
priority: normal
severity: normal
status: open
title: subprocess.check_output incorrectly state that output is always bytes
versions: Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue17277] incorrect line numbers in backtrace after removing a trace function

2013-02-24 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The proposed patch fixes the backtrace line numbers issue, but it does not fix
PyFrame_GetLineNumber() which is the recommended way to get the frame line
number.

As mentionned in the original message, testing for f->f_trace to implement the
f_lineno getter is not correct. The f_lineno setter is also wrong in allowing to
modify f_lineno when the frame is not the one that is being traced (pdb prevents
that to happen though, in do_jump()).

I am working on another patch that should fix the issue by changing
PyFrame_GetLineNumber() and the f_lineno accessors.

--

___
Python tracker 

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



[issue17100] rotating an ordereddict

2013-02-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Perhaps for consistency with popitem() and move_to_end() it is worth
> to merge rotate_at() and rotate_after() in one method (rotate_to()?
> move_to()?) with a boolean parameter.

Yes, perhaps. rotate_to(last=False) sounds ok, but perhaps a native
English speaker can suggest a better name.

--

___
Python tracker 

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



[issue14468] Update cloning guidelines in devguide

2013-02-24 Thread Ezio Melotti

Ezio Melotti added the comment:

> I'm going to start proposing smaller issues off of this one

I still fail to understand what are you trying to achieve.  If you want to 
further dissect my patches, hand picking chunks and reorder them in order to 
obtain even more patches, I'll just close this issue and let you do what you 
think it's best -- but I'm not going to spend more time on this.

Otherwise I will commit my patches as they are, either all together or one by 
one or anything in the middle -- you pick the granularity you like most.  After 
that it's done you can open other issues to further improve what we have.

--

___
Python tracker 

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



[issue16945] rewrite CGIHTTPRequestHandler to always use subprocess

2013-02-24 Thread Charles-François Natali

Changes by Charles-François Natali :


Added file: http://bugs.python.org/file29219/cgi_subprocess-1.diff

___
Python tracker 

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



[issue17100] rotating an ordereddict

2013-02-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Perhaps for consistency with popitem() and move_to_end() it is worth to merge 
rotate_at() and rotate_after() in one method (rotate_to()? move_to()?) with a 
boolean parameter.

--

___
Python tracker 

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



[issue16801] Preserve original representation for integers / floats in docstrings

2013-02-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It's particular because there are functions whose signatures can't be expressed 
with valid Python syntax (dict, range, operator.methodcaller, many curses 
functions). They required other solution and this more general solution is 
applicable for the problem of nonstandard representation of default values.

--

___
Python tracker 

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



[issue16801] Preserve original representation for integers / floats in docstrings

2013-02-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It's cumbersome and burdensome because you need for every nonstandard default 
value:

1) define a class with __repr__();
2) instantiate a sentinel;
3) check for the sentinel in the function and replace it but an actual value.

class _ExternalAttrDefault:
def __repr__():
return '(stat.S_IRUSR|stat.S_IRUSR)<<16'

_external_attr_default = _ExternalAttrDefault()

def open(self, name, mode='r', external_attr=_external_attr_default):
if external_attr is _external_attr_default:
external_attr = (stat.S_IRUSR|stat.S_IRUSR)<<16
...

Instead of just:

def open(self, name, mode='r', 
external_attr=(stat.S_IRUSR|stat.S_IRUSR)<<16):
"""
Foo.open(name, mode='r', external_attr=(stat.S_IRUSR|stat.S_IRUSR)<<16)
"""
...

--

___
Python tracker 

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



[issue1470548] Bugfix for #1470540 (XMLGenerator cannot output UTF-16)

2013-02-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for report. Here is a patch which fixes this bug.

--
Added file: http://bugs.python.org/file29218/XMLGenerator_fragment-2.7.patch

___
Python tracker 

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



[issue13952] mimetypes doesn't recognize .csv

2013-02-24 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue14468] Update cloning guidelines in devguide

2013-02-24 Thread Chris Jerdonek

Chris Jerdonek added the comment:

As discussed above and because this comment thread is getting very long, I'm 
going to start proposing smaller issues off of this one.  In this way we can 
start committing as we reach agreement, and hash out any disagreements in more 
focused contexts around smaller patches.  I will copy the nosy list unless I 
hear otherwise from anyone.

> Patch 2 could indeed committed separately,

I created issue 17284 for this.

--

___
Python tracker 

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



[issue17284] create mercurial section in devguide's committing.rst

2013-02-24 Thread Chris Jerdonek

New submission from Chris Jerdonek:

As discussed in issue 14468, this issue is to reorder the sections in the 
devguide's committing.rst to create a section dedicated to using Mercurial when 
committing.  The attached patch is adapted from the "2-move_two_sections.diff" 
patch of that issue.

--
components: Devguide
files: mercurial-section-1.patch
keywords: easy, patch
messages: 182859
nosy: chris.jerdonek, eric.araujo, ezio.melotti, ncoghlan, pitrou, sandro.tosi, 
terry.reedy, tshepang
priority: normal
severity: normal
stage: patch review
status: open
title: create mercurial section in devguide's committing.rst
type: enhancement
Added file: http://bugs.python.org/file29217/mercurial-section-1.patch

___
Python tracker 

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



[issue14720] sqlite3 microseconds

2013-02-24 Thread Petri Lehtinen

Petri Lehtinen added the comment:

Serhiy Storchaka wrote:
> convert_timestamp() can silently return wrong result if seconds
> saved with more than millisecond precision (i.e. '2012-04-04
> 15:06:00.000123456'). I propose or truncate fractional part to 6
> digits ('{:0<6.6}') or explicitly raise an exception if
> len(timepart_full[1]) > 6.

That's a good point. Also, '2012-04-04 15:06:00.1234567' fails with a
ValueError when executing the SELECT statement, because the
microsecond part is not in range 0-99.

Truncating the fractional part to 6 characters sounds good to me,
because that way we get the best possible precision without failing
abruptly.

--

___
Python tracker 

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



[issue16121] shlex.shlex.error_leader() reports incorrect line number

2013-02-24 Thread Petri Lehtinen

Petri Lehtinen added the comment:

> I'm investigating it now and will get back with a revised &
> fully tested patch.

Sounds good. FWIW, it only broke on 3.x and default branches, and you can 
probably reproduce it on my own machine, too, by applying the patch and then 
running test_netrc.

This is what shlex documentation says about lineno:

> shlex.lineno
> Source line number (count of newlines seen so far plus one).

This is a bit vague, as it doesn't really state whether newlines should be 
treated "greedily" (consumbed before the next token is read) or "lazily" 
(consumed only when the next token is read).

--

___
Python tracker 

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



[issue14720] sqlite3 microseconds

2013-02-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

convert_timestamp() can silently return wrong result if seconds saved with more 
than millisecond precision (i.e. '2012-04-04 15:06:00.000123456'). I propose or 
truncate fractional part to 6 digits ('{:0<6.6}') or explicitly raise an 
exception if len(timepart_full[1]) > 6.

--

___
Python tracker 

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