[issue18411] signal.SIGINT in windows cause process exit directly.

2013-07-09 Thread guo tie

New submission from guo tie:

I wrote those test python code as following:

import signal
import time
import os

def handler(signum, frame):
print do whatever, like call thread.interrupt_main()
return

signal.signal(signal.SIGINT, handler)

while 1:
try:
time.sleep(10)
except:
os.kill(int(os.getpid()), signal.SIGINT)
pass


when i excute this test code on windows, the process print do whatever, like 
call thread.interrupt_main(), then exit;
on linux, it works correctly.

why on windows it not work?

--
components: Windows
messages: 192722
nosy: guo.tie
priority: normal
severity: normal
status: open
title: signal.SIGINT in windows cause process exit directly.
type: behavior
versions: Python 2.7

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



[issue18404] Memory leak in gdbmmodule

2013-07-09 Thread Bohuslav Slavek Kabrda

Bohuslav Slavek Kabrda added the comment:

I just tried rebuilding with my patch and running test suite + I did some 
manual testing and everything seems to work fine - and the memory leak is not 
there.

--

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



[issue18406] unicodedata.itergraphemes / str.itergraphemes / str.graphemes

2013-07-09 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

It may be useful to also add the start position of the grapheme to the iterator 
output.

Related to this, please also see this pre-PEP I once wrote for a Unicode 
indexing module:

http://mail.python.org/pipermail/python-dev/2001-July/015938.html

--
components: +Unicode
nosy: +lemburg

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



[issue18397] Python with MinGW

2013-07-09 Thread Friedrich Spee von Langenfeld

Friedrich Spee von Langenfeld added the comment:

@ Christian Heimes
Thank you for your hint. Martin v. Löwis made an interesting commend, if his 
way succeed, it would be worth considering to make a paragraph in the devguide 
how to build Python with MinGW. The way Forward depends on the results.

@ Martin v. Löwis
I've tried the Unix configure under MinGW. It failed.
I've written it in the appended file with:
$ cd C:/MinGW/python_mercurial
$ ./configure  configure_test.txt

--
components:  -Build, Windows
Added file: http://bugs.python.org/file30875/configure_test.txt

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



[issue18397] Python with MinGW

2013-07-09 Thread Christian Heimes

Christian Heimes added the comment:

Please install awk and try again.

--

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



[issue18404] Memory leak in gdbmmodule

2013-07-09 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


--
nosy: +haypo
stage:  - patch review
type:  - resource usage
versions: +Python 3.4

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



[issue14518] Add bcrypt $2a$ to crypt.py

2013-07-09 Thread Christian Heimes

Christian Heimes added the comment:

I can't find any system that supports $2a$. My Ubuntu box returns a string of 
13 chars (plain crypt) and the BSD box returns just :.

--
assignee: christian.heimes - 
priority: normal - low

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



[issue17911] Extracting tracebacks does too much work

2013-07-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 If we keep a reference to f_globals for each line in the traceback, we 
 can defer this to later (ideally we'd just keep the __loader__ value,
 but that would require changing the linecache interface as well).

Or you could add a *new* linecache interface.
Keeping __loader__ sounds much less hackish than keeping f_globals to me.

--

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



[issue2528] Change os.access to check ACLs under Windows

2013-07-09 Thread Christian Heimes

Christian Heimes added the comment:

Do you want to provide an updated patch for 3.4?

--
nosy: +christian.heimes
status: open - languishing
versions: +Python 3.4 -Python 3.2

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



[issue10042] functools.total_ordering fails to handle NotImplemented correctly

2013-07-09 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Nick, let me know when you think it is ready and I'll review the patch.

--

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



[issue18397] Python with MinGW

2013-07-09 Thread Friedrich Spee von Langenfeld

Friedrich Spee von Langenfeld added the comment:

I've installed the MSYS gawk Utility and configure succeeded (thank you!), but 
now make failed. Should I upload the entire log file or ony the error messages?

--
Added file: http://bugs.python.org/file30876/make_test.txt

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



[issue18100] socket.sendall() cannot send buffers of 2GB or more

2013-07-09 Thread Anton Tyurin

Anton  Tyurin added the comment:

There seems to be no, because there's this bug is already fixed in Python 3, 
according to 
http://hg.python.org/cpython/file/c1a400501db6/Modules/socketmodule.c#l3290. 
But the use of Py_ssize_t (len and n) hides the potential type conversion.

--

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



[issue4708] os.pipe should return inheritable descriptors (Windows)

2013-07-09 Thread Richard Oudkerk

Richard Oudkerk added the comment:

 - would improve POSIX compatibility, it mimics what os.pipe()
 does on those OS

I disagree.

On Windows fds can only be inherited if you start processes using the spanwn*() 
family of functions.  If you start them using CreateProcess() then the 
underlying *handles* are inherited, but the *fds* are not.

In Python 2, os.spawn*() used spawn*(), so making os.pipe() return inheritable 
fds would have made some sense.  But in Python 3 os.spawn*() is implemented 
using subprocess/CreateProcess so fds will NOT be inherited (even if the 
wrapped handles are).

Note that subprocess *does* know how to redirect the standard streams to fds 
returned by os.pipe().

So for Python 3 I don't think there is any point in changing things.

--

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



[issue18100] socket.sendall() cannot send buffers of 2GB or more

2013-07-09 Thread STINNER Victor

STINNER Victor added the comment:

 But the use of Py_ssize_t (len and n) hides the potential type conversion.

Which type conversion?

--

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



[issue18100] socket.sendall() cannot send buffers of 2GB or more

2013-07-09 Thread Anton Tyurin

Anton  Tyurin added the comment:

I could be wrong, but:

ssize_t
send(int socket, const void *buffer, size_t length, int flags);

so length is size_t, but Py_ssize_t is ssize_t (signed to unsigned).

PS. sorry for my bad English

--

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



[issue4708] os.pipe should return inheritable descriptors (Windows)

2013-07-09 Thread Richard Oudkerk

Richard Oudkerk added the comment:

Oops.  I confused os.popen() with os.spawn*().  os.spawnv() IS still 
implemented using spawnv() in Python 3.

--

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



[issue18412] Minor problem in PEP 8

2013-07-09 Thread Xue Fuqiao

New submission from Xue Fuqiao:

PEP 8 says:

---
|The closing brace/bracket/parenthesis on multi-line constructs may
|either line up under the last item of the list, as in:
|
|my_list = [
|1, 2, 3,
|4, 5, 6,
|]
|result = some_function_that_takes_arguments(
|'a', 'b', 'c',
|'d', 'e', 'f',
|)
---

I think the code isn't consistent with the description.  See:
http://article.gmane.org/gmane.comp.python.general/737558

--
messages: 192737
nosy: xfq
priority: normal
severity: normal
status: open
title: Minor problem in PEP 8
type: enhancement

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



[issue13788] os.closerange optimization

2013-07-09 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Two small technical comments:

1) I'd add a configure or compile-time check to determine if the procfs
   interface might be available. I don't like probing for features that
   you know are not available.

2) MacOSX has simular functionality using /dev/fd instead of
   /proc/${PID}/fd  (and other BSD systems might have this as well)

--
nosy: +ronaldoussoren

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



[issue13788] os.closerange optimization

2013-07-09 Thread Christian Heimes

Christian Heimes added the comment:

In case someone is wondering if the approach really reduces the amount of 
syscalls: yes, it does. readdir() doesn't do a syscall for each entry. On Linux 
it uses the internal syscall getdents() to fill a buffer of directory entry 
structs. http://man7.org/linux/man-pages/man2/getdents.2.html

On my system os.listdir() does four syscalls:

$ strace python -c import os; os.listdir('/home/heimes')

openat(AT_FDCWD, /home/heimes, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
getdents(3, /* 381 entries */, 32768)   = 12880
getdents(3, /* 0 entries */, 32768) = 0
close(3)

On Linux you can also use /proc/self/fd instead of /proc/YOURPID/fd.

Other operating systems have different APIs to get a list of open FDs. AFAK 
/dev/fd is static on FreeBSD and Mac OS X:

FreeBSD:
  
http://www.manualpages.de/FreeBSD/FreeBSD-7.4-RELEASE/man3/kinfo_getfile.3.html

Darwin / Mac OS X:
  proc_pidinfo()

--

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



[issue18412] Minor problem in PEP 8

2013-07-09 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


--
assignee:  - docs@python
nosy: +docs@python
priority: normal - low

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



[issue2554] test_ioctl failed Python 2.6a2 Solaris 10 SUN C

2013-07-09 Thread Christian Heimes

Christian Heimes added the comment:

It looks like the bug is gone. The ioctl test is passing on Solaris 10 and 11 
with Sun's CC.

http://buildbot.python.org/all/builders/SPARC%20Solaris%2010%20%28cc%2C%2032b%29%20%5BSB%5D%202.7/builds/336

--
nosy: +christian.heimes
resolution:  - fixed
status: open - closed

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



[issue12115] some tests need to be skipped on threadless systems

2013-07-09 Thread Christian Heimes

Christian Heimes added the comment:

I assume that you have fixed it two years ago. Right?

--
nosy: +christian.heimes
resolution:  - fixed
status: open - closed

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



[issue10482] subprocess and deadlock avoidance

2013-07-09 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


--
stage:  - needs patch
versions: +Python 3.4 -Python 3.3

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



[issue1193610] Expat Parser to supply document locator in incremental parse

2013-07-09 Thread Christian Heimes

Christian Heimes added the comment:

Does anybody want to work on a patch?

--
assignee: loewis - 
nosy: +christian.heimes
priority: normal - low
stage:  - needs patch
status: open - languishing
versions: +Python 3.4 -Python 3.2

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



[issue1445781] install fails on hard link

2013-07-09 Thread Christian Heimes

Christian Heimes added the comment:

Our Makefile still uses a hard link in two place:

libpython$(LDVERSION).so 

python$(LDVERSION)$(EXE) python$(VERSION)$(EXE))

--
nosy: +christian.heimes
stage: test needed - needs patch
versions: +Python 3.3, Python 3.4 -Python 3.2

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



[issue18413] logging.error('asdf', extra={'msg':123}) raise KeyError exception

2013-07-09 Thread Артем Меженин

New submission from Артем Меженин:

Hello.
I noticed strange behavior of logging module, when debugging my code:

$ python
Python 2.7.3 (default, Aug  1 2012, 05:14:39) 
[GCC 4.6.3] on linux2
Type help, copyright, credits or license for more information.
 import logging
 logging.error('asdf')
ERROR:root:asdf
 logging.error('asdf', extra={'msg':123})
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python2.7/logging/__init__.py, line 1575, in error
root.error(msg, *args, **kwargs)
  File /usr/lib/python2.7/logging/__init__.py, line 1166, in error
self._log(ERROR, msg, args, **kwargs)
  File /usr/lib/python2.7/logging/__init__.py, line 1257, in _log
record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, 
func, extra)
  File /usr/lib/python2.7/logging/__init__.py, line 1235, in makeRecord
raise KeyError(Attempt to overwrite %r in LogRecord % key)
KeyError: Attempt to overwrite 'msg' in LogRecord


Originally code was extra=locals() and 'msg' was local variable, but it doesn't 
matter.

--
messages: 192744
nosy: amezhenin
priority: normal
severity: normal
status: open
title: logging.error('asdf', extra={'msg':123}) raise KeyError exception

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



[issue18413] logging.error('asdf', extra={'msg':123}) raise KeyError exception

2013-07-09 Thread Артем Меженин

Changes by Артем Меженин a.mezhe...@gmail.com:


--
components: +Library (Lib)
type:  - behavior
versions: +Python 2.7

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



[issue10042] functools.total_ordering fails to handle NotImplemented correctly

2013-07-09 Thread Nick Coghlan

Nick Coghlan added the comment:

I think I spotted a logic bug in _not_op_and_not_eq (it uses or instead
of  and in the final line) , so I suspect we still have a missing test
case in the latest patch. (My fault - I should have suggested using
coverage.py to ensure all the branches were covered by the chosen test
cases).

The general structure of the proposed update is complete though.

--

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



[issue18413] logging.error('asdf', extra={'msg':123}) raise KeyError exception

2013-07-09 Thread Christian Heimes

Christian Heimes added the comment:

The issue is covered by the docs:

http://docs.python.org/2.7/library/logging.html#logging.Logger.debug

 The keys in the dictionary passed in extra should not clash with the keys 
 used by the logging system.

You can't use a couple of reserved keys like 'msg' in the extra args. Perhaps 
you can find a simple workaround for your issue?

--
nosy: +christian.heimes
resolution:  - wont fix
status: open - closed

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



[issue4079] new urllib2.Request 'timeout' attribute needs to have a default

2013-07-09 Thread R. David Murray

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


--
stage: test needed - patch review
status: languishing - open

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



[issue18414] random.choices(seq, k)

2013-07-09 Thread Christian Heimes

New submission from Christian Heimes:

The random module has no method to obvious way to select k elements from a 
sequence without enforcing unique values in the result set. It's a rather 
useful feature for salts, randomly generated passwords and other applications. 
See #18405

The patch implements random.choices(seq, k) - list

--
components: Library (Lib)
files: random_choices.patch
keywords: patch
messages: 192747
nosy: christian.heimes, mark.dickinson, rhettinger
priority: normal
severity: normal
stage: patch review
status: open
title: random.choices(seq, k)
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file30877/random_choices.patch

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



[issue12645] test.support. import_fresh_module - incorrect doc

2013-07-09 Thread Eli Bendersky

Eli Bendersky added the comment:

_save_and_remove module can also raise ImportError

--

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



[issue12645] test.support. import_fresh_module - incorrect doc

2013-07-09 Thread Eli Bendersky

Eli Bendersky added the comment:

A single patch for both the ReST doc and docstring would be helpful. Except 
formatting, their contents can be the same.

--

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



[issue18412] Minor problem in PEP 8

2013-07-09 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

I clarified the wording.

--
nosy: +barry
resolution:  - fixed
status: open - closed

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



[issue18382] multiprocessing's overlapped PipeConnection issues on Windows 8

2013-07-09 Thread R. David Murray

R. David Murray added the comment:

All the buildbots are volunteer hosted and run, so we need someone to volunteer 
to run a Windows 8 buildbot.  That said, I'm not sure if we are formally 
supporting Windows 8 yet or not.  Actually, given the lack of a buildbot, I 
suppose the answer is not :)

--
nosy: +r.david.murray

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



[issue18384] Add devhelp build instructions to the documentation makefile

2013-07-09 Thread R. David Murray

R. David Murray added the comment:

I'm not sure that this belongs in core, but I'll certainly defer to Georg on 
that :).  If it does go in, the help string should explain what 'devhelp' does, 
since it isn't obvious from the name (for a non-GNOME user...I had to google 
it).

--
nosy: +r.david.murray

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



[issue18389] os.path.relpath gives incorrect results if start parameters is not a directory

2013-07-09 Thread R. David Murray

R. David Murray added the comment:

I understand your concern, but the API is that 'start' is a directory.  The 
function does not interrogate the file system, and should not do so.  It is 
purely a path computation, and as such the current behavior is correct.

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

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



[issue18397] Python with MinGW

2013-07-09 Thread R. David Murray

R. David Murray added the comment:

I believe there are open (and some closed) issues in this tracker related to 
mingw support, though many of them are for support for compiling extensions 
using mingw, which is actually a harder problem.  They will probably provide 
clues if nothing else.  What we probably lack is a core developer with the time 
and desire to review and commit the patches.  If I remember correctly someone 
started trying to sort the proposals into small enough patches to make review 
practical.  With another pair of eyes doing review, testing, and sorting, the 
chances of making progress would be increased.

--
nosy: +r.david.murray

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



[issue18389] os.path.relpath gives incorrect results if start parameters is not a directory

2013-07-09 Thread Jonathan Eldridge

Jonathan Eldridge added the comment:

At the very least, the documentation should be updated to explain this.

--

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



[issue17778] Fix test discovery for test_multiprocessing.py

2013-07-09 Thread Zachary Ware

Zachary Ware added the comment:

Since there's been another test added since the last version of this patch, 
here's a new patch again.  I'll also be attaching a patch to 3.3, which 
includes backports of the 4 changesets mentioned in my last message, as well as 
the changes for this issue.

--
Added file: 
http://bugs.python.org/file30878/test_multiprocessing_discovery.v3.diff

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



[issue13418] Embedded Python memory leak

2013-07-09 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Ok, closing it.

--
status: languishing - closed

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



[issue17778] Fix test discovery for test_multiprocessing.py

2013-07-09 Thread Zachary Ware

Changes by Zachary Ware zachary.w...@gmail.com:


Added file: 
http://bugs.python.org/file30879/test_multiprocessing_discovery.v3-3.3.diff

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



[issue12641] Remove -mno-cygwin from distutils

2013-07-09 Thread Christian Heimes

Christian Heimes added the comment:

The is_cygwingcc() function can be simplified a lot with 
subprocess.check_output().

--
nosy: +christian.heimes

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



[issue18397] Python with MinGW

2013-07-09 Thread Martin v . Löwis

Martin v. Löwis added the comment:

@David: I don't think any of the other open issues actually addresses building 
Python with mingw (but I may misremember).

@Friedrich: This is only going to be productive if you are willing to look into 
the issues yourself, and propose changes. If I had time to look into this issue 
(which I don't), it would be much easier for me to reproduce and fix the 
problem, than to wait for you to report the next problem. Be prepared that this 
task may take several days (or even weeks) of work. If you merely keep 
reporting the problems you find, expect people to lose interest quickly.

As for the specific problem (make_test.txt): MS_WINDOWS needs to get defined 
somehow (I think), and then EALREADY etc ought to come from winsock2.h (see 
exceptions.c around line 2360).

Try replacing the generated pyconfig.h with PC/pyconfig.h to see whether that 
gets you further.

--

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



[issue13788] os.closerange optimization

2013-07-09 Thread Gregory P. Smith

Gregory P. Smith added the comment:

_posixsubprocess already uses the Linux getdent64 syscall when available 
(though for different reasons: readdir is not safe in that context). 
http://hg.python.org/cpython/file/3f3cbfd52f94/Modules/_posixsubprocess.c#l227

Probing for procfs at configure time could be problematic. It is a virtual 
filesystem. It is entirely possible for a system to choose not to mount it. It 
might be reasonable to assume that it might be present only if the system had 
it mounted at compile time but a configure flag to override that might be 
desirable for some systems (not the Linux systems I usually deal with).

If we're going through all of these hoops for closerange: I'd love to see an 
API exposed in the os module to return a list of open fd's. It is an 
abstraction nobody should have to write for themselves.

--

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



[issue18389] document that os.path.relpath does not interrogate the file system

2013-07-09 Thread R. David Murray

R. David Murray added the comment:

That's a good point.

--
assignee:  - docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
resolution: rejected - 
stage: committed/rejected - needs patch
status: closed - open
title: os.path.relpath gives incorrect results if start parameters is not a 
directory - document that os.path.relpath does not interrogate the file system
versions: +Python 3.3, Python 3.4

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



[issue18397] Python with MinGW

2013-07-09 Thread R. David Murray

R. David Murray added the comment:

@Martin: you are probably correct, though I think there was at least one closed 
issue that did deal with mingw/msys build.  As I recall it wasn't coherent 
enough to produce useful patches, but may have some clues.

--

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



[issue12641] Remove -mno-cygwin from distutils

2013-07-09 Thread Oscar Benjamin

Oscar Benjamin added the comment:

On 9 July 2013 16:25, Christian Heimes rep...@bugs.python.org wrote:

 The is_cygwingcc() function can be simplified a lot with 
 subprocess.check_output().

My initial thought was to do that but then I based it on
_find_exe_version which for whatever reason uses Popen directly [1].
I'm happy to make that change and retest the patches although I can't
do it right now.

Can someone first accept or reject the general idea of the patches
though? I'm happy to answer any questions about them but it takes time
to get the diffs right and test against all compilers and Python
versions and I don't really want to do it if the patches will just be
rejected.

Also I may soon lose access to the machine that I used to write and
test these patches. If it is desired for me to change and retest them
it may not be possible after two weeks or so.

[1] 
http://hg.python.org/cpython/file/3f3cbfd52f94/Lib/distutils/cygwinccompiler.py#l368

--

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



[issue12641] Remove -mno-cygwin from distutils

2013-07-09 Thread Éric Araujo

Éric Araujo added the comment:

Don’t forget that distutils is used during CPython’s build process to compile 
extension modules: subprocess may not be importable then.

--

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



[issue10984] argparse add_mutually_exclusive_group should accept existing arguments to register conflicts

2013-07-09 Thread paul j3

paul j3 added the comment:

This approach of simply adding the existing actions to the group's 
_group_actions works fine, at least when it comes catching the error.

It may be difficult to get a useful usage line.  In usage, arguments appear in 
the order in which they were created, optionals first, positionals after.  
Group notation is added if the subset of the arguments appear in its list in 
the same order.

In the patch .rst, 

usage: PROG [-h] (--foo | --bar) [--baz]

the foo,bar group is marked correctly; the foo,baz group is not contiguous and 
is omited.

In bethard's example neither group will be marked
(class TestMutuallyExclusiveGroupWithExistingArguments)

But the problem isn't just with adding existing arguments.

class TestMutuallyExclusiveOptionalsMixed illustrates this with a case where 
group and parser arguments overlap.

In class TestMutuallyExclusiveOptionalsAndPositionalsMixed, the mix of 
optionals and positionals makes group marking impossible.

If the groups are in order, but overlap, usage can be a confusing mix

Groups ab, bc, cd, produce: 
[-a A | [-b B | [-c C | -d D]

But if created in a different order, the usage can be: 
[-a A | [-b B | -c C] -d D]

So there are 2 issues
   - if groups are not continuous or overlap, what is a meaningful usage?
   - any choice is likely to require a major reworking of the formatting logic.

Since confusing group markings are worse than none, a first step might be to 
flag a group added via this patch as 'do not mark'.  Also add a note to the 
documentation that user may need to write their own grouping  instructions (in 
usage, description or epilog).

--
nosy: +paul.j3

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



[issue12641] Remove -mno-cygwin from distutils

2013-07-09 Thread Oscar Benjamin

Oscar Benjamin added the comment:

On 9 July 2013 17:36, Éric Araujo rep...@bugs.python.org wrote:

 Don’t forget that distutils is used during CPython’s build process to compile 
 extension modules: subprocess may not be importable then.

Subprocess is imported at at the top of the module in 3.x [1]. The
whole distutils.cygwinccompiler module is an ImportError if subprocess
is not importable.

Or did you mean for 2.7 only (where get_versions() uses os.popen)?

[1] 
http://hg.python.org/cpython/file/3f3cbfd52f94/Lib/distutils/cygwinccompiler.py#l51

--

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



[issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures)

2013-07-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 330c7aa2922b by Charles-François Natali in branch '3.3':
Issue #18308: don't take the scope ID into account when comparing IPv6
http://hg.python.org/cpython/rev/330c7aa2922b

New changeset b44749cee660 by Charles-François Natali in branch 'default':
Issue #18308: don't take the scope ID into account when comparing IPv6
http://hg.python.org/cpython/rev/b44749cee660

--
nosy: +python-dev

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



[issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures)

2013-07-09 Thread Charles-François Natali

Charles-François Natali added the comment:

Fixed, thanks!

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue18406] unicodedata.itergraphemes / str.itergraphemes / str.graphemes

2013-07-09 Thread Matthew Barnett

Matthew Barnett added the comment:

This is basically what the regex module does, written in Python:

def get_grapheme_cluster_break(codepoint):
Gets the Grapheme Cluster Break property of a codepoint.

The properties defined here:


http://www.unicode.org/Public/UNIDATA/auxiliary/GraphemeBreakProperty.txt

# The return value is one of:
#
# Other
# CR
# LF
# Control
# Extend
# Prepend
#  Regional_Indicator
# SpacingMark
# L
# V
# T
# LV
# LVT
...

def at_grapheme_boundary(string, index):
Checks whether the codepoint at 'index' is on a grapheme boundary.

The rules are defined here:

http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries

# Break at the start and end of the text.
if index = 0 or index = len(string):
return True

prop = get_grapheme_cluster_break(string[index])
prop_m1 = get_grapheme_cluster_break(string[index - 1])

# Don't break within CRLF.
if prop_m1 == CR and prop == LF:
return False

# Otherwise break before and after controls (including CR and LF).
if prop_m1 in (Control, CR, LF) or prop in (Control, CR, 
LF):
return True

# Don't break Hangul syllable sequences.
if prop_m1 == L and prop in (L, V, LV, LVT):
return False
if prop_m1 in (LV, V) and prop in (V,  T):
return False
if prop_m1 in (LVT, T) and prop == T:
return False

# Don't break between regional indicator symbols.
if (prop_m1 == REGIONALINDICATOR and prop ==
  REGIONALINDICATOR):
return False

# Don't break just before Extend characters.
if prop == Extend:
return False

# Don't break before SpacingMarks, or after Prepend characters.
if prop == SpacingMark:
return False

if prop_m1 == Prepend:
return False

# Otherwise, break everywhere.
return True

--
nosy: +mrabarnett

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



[issue17457] Unittest discover fails with namespace packages and builtin modules

2013-07-09 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Hello. Can I do something to move this issue forward?

--

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



[issue18397] Python with MinGW

2013-07-09 Thread Roumen Petrov

Changes by Roumen Petrov bugtr...@roumenpetrov.info:


--
nosy: +rpetrov

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



[issue18415] Normalize single/double quote usage in importlib

2013-07-09 Thread Brett Cannon

New submission from Brett Cannon:

Importlib has ended up with a mixed use of single and double quotes. Should 
clean it up to be consistent.

--
assignee: brett.cannon
components: Library (Lib)
keywords: easy
messages: 192771
nosy: brett.cannon
priority: low
severity: normal
stage: needs patch
status: open
title: Normalize single/double quote usage in importlib
type: enhancement
versions: Python 3.4

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



[issue18416] Move to absolute file paths for module.__file__

2013-07-09 Thread Brett Cannon

New submission from Brett Cannon:

$ touch blah.py; ./python -c import blah; print(blah.__file__)
./blah.py

Should really change that to be an absolute path since the file's location is 
not accurate if you call os.chdir().

--
components: Interpreter Core
messages: 192772
nosy: brett.cannon
priority: normal
severity: normal
stage: test needed
status: open
title: Move to absolute file paths for module.__file__
type: behavior
versions: Python 3.4

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



[issue18417] urlopen() has a hidden default for its timeout argument

2013-07-09 Thread Barry A. Warsaw

New submission from Barry A. Warsaw:

urllib.request.urlopen() takes a `timeout` argument with a default value, but 
the default value is hidden and undocumented.  As implemented, the value is 
socket._GLOBAL_DEFAULT_TIMEOUT, but even this isn't really correct or useful.

The problem comes if you are passing a set of arguments to urlopen() and want 
to pass in a timeout that is the same as default.  Because its undocumented, 
you have to UTSL to figure out what the value is, and then you have to use a 
non-public attribute of the socket module.

It would be better if urlopen() was documented to default `timeout=None` 
meaning use the default timeout.  The implementation should then use 
socket.getdefaulttimeout() when timeout=None.

The documentation should also be updated.

Now if you want to call urlopen() with the default values, it would just be 
`urlopen(..., timeout=None, ...)`

--
messages: 192773
nosy: barry
priority: normal
severity: normal
status: open
title: urlopen() has a hidden default for its timeout argument
versions: Python 3.4

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



[issue18416] Move to absolute file paths for module.__file__

2013-07-09 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue18417] urlopen() has a hidden default for its timeout argument

2013-07-09 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Targeting only 3.4 because, while this should no break any (reasonable wink) 
backward compatibility, it is technically an API change and thus should not get 
backported.

--

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



[issue18415] Normalize single/double quote usage in importlib

2013-07-09 Thread STINNER Victor

STINNER Victor added the comment:

Do you mean in .c and .py files, or in error messages?

--
nosy: +haypo

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



[issue18415] Normalize single/double quote usage in importlib

2013-07-09 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue13788] os.closerange optimization

2013-07-09 Thread STINNER Victor

STINNER Victor added the comment:

FreeBSD and other OSes provide closefrom(). Why not exposing this function 
which is probably implemented as a single syscall?

--
nosy: +haypo

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



[issue18416] Move to absolute file paths for module.__file__

2013-07-09 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
nosy: +ncoghlan

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



[issue18415] Normalize single/double quote usage in importlib

2013-07-09 Thread Brett Cannon

Brett Cannon added the comment:

String constants in importlib/_bootstrap.py; pylint noticed the discrepancy.

--

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



[issue18100] socket.sendall() cannot send buffers of 2GB or more

2013-07-09 Thread STINNER Victor

STINNER Victor added the comment:

 ssize_t send(int socket, const void *buffer, size_t length, int flags);

Oh, I didn't notice that. I hope that the result always fit in a ssize_t. If it 
is not the case, it is probably a bug in the kernel. An example of such bug:
http://xorl.wordpress.com/2009/04/10/cve-2009-1265-linux-kernel-rosex25netrom-integer-overflows/

On Solaris, read(), send() and probably other functions return EINVAL if input 
length argument overflows a ssize_t. We may be extra-safe by truncating the 
length to PY_SSIZE_T_MAX. But I would appreciate a test on Linux and Solaris 
with such huge values. Which kind of socket should be used to test such buffer?

--

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



[issue18408] Fixes crashes found by pyfailmalloc

2013-07-09 Thread Gregory P. Smith

Changes by Gregory P. Smith g...@krypto.org:


--
nosy: +gregory.p.smith

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



[issue17558] gdb debugging python frames in optimised interpreters

2013-07-09 Thread Marcus Cobden

Marcus Cobden added the comment:

Is there anyone who could take a look at this? I'd rather it not bit-rot into 
oblivion.

I know the code quality is rather poor, but I can fix that.

--

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



[issue18414] random.choices(seq, k)

2013-07-09 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
assignee:  - rhettinger

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



[issue18418] Thread.isAlive() sometimes True after fork

2013-07-09 Thread A. Jesse Jiryu Davis

New submission from A. Jesse Jiryu Davis:

In threading.Thread.__bootstrap_inner(), the thread sets self.__started before 
adding itself to the _active collection. If a different thread forks between 
these two operations, we're left with a thread that believes it's alive 
although it isn't. _after_fork() doesn't call __stop() on this thread because 
the thread isn't in _active.

In the attached patch, Thread adds itself to _active before setting 
self.__started. This way, if it's interrupted by a fork, it may end up stopped 
without being started, rather than the reverse. In this case isAlive() 
correctly returns False.

One concern about the patch: my new test in test_threading.py only reveals the 
bug in Python 2.7.5 very occasionally. I don't know how to force the test to 
fail more frequently.

Looking at the threading.py on the 3.3 branch, it appears to have the same bug, 
but I can't reproduce it there, only on the 2.7 branch.

--
components: Library (Lib)
files: fix_is_alive_and_fork.patch
keywords: patch
messages: 192780
nosy: emptysquare
priority: normal
severity: normal
status: open
title: Thread.isAlive() sometimes True after fork
versions: Python 2.7
Added file: http://bugs.python.org/file30880/fix_is_alive_and_fork.patch

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



[issue18414] random.choices(seq, k)

2013-07-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

How about [random.choice(seq) for i in range(k)]? Isn't it obvious enough?

--
nosy: +pitrou

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



[issue18418] Thread.isAlive() sometimes True after fork

2013-07-09 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +gregory.p.smith, sbt

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



[issue18419] For reasons I can't explain Python in some cases says that getstatusoutput is not an attribute of the commands module but it is and should be

2013-07-09 Thread Georgiy Treyvus

New submission from Georgiy Treyvus:

Basically in a lot of situations in recent times I've had to make sure a bunch 
of files are all the same. Now diff is great but it only lets me pass two 
files. diff3 and sdiff also aren't what I'm looking for. So I decided to write 
my own little script that does that.

I was doing a few crude preliminary tests on an early version of the utility 
and that's when shit hit the fan. For reasons I can't explain Python 2.7.5 in 
some circumstances said that getstatusoutput wasn't an attribute of the 
commands module. The program executed fine though under Python 3.3.2.

Anyway here's some shell output which will leave you folks scratching your head 
as much as I am. I have several times checked the syntax and I just simply 
don't think I'm doing anything wrong. What are your thoughts?

===SHELL OUTPUT===

[georgiy@PANTHER mess]$ python
Python 2.7.5 (default, May 16 2013, 13:44:12) 
[GCC 4.8.0 20130412 (Red Hat 4.8.0-2)] on linux2
Type help, copyright, credits or license for more information.
 import commands as run
 run.getstatusoutput
function getstatusoutput at 0x247a9b0
 
[georgiy@PANTHER mess]$ python3
Python 3.3.2 (default, May 20 2013, 12:05:55) 
[GCC 4.8.0 20130412 (Red Hat 4.8.0-2)] on linux
Type help, copyright, credits or license for more information.
 import subprocess as run
 run.getstatusoutput
function getstatusoutput at 0x7f5880225ef0
 
[georgiy@PANTHER mess]$ cat allthesame.py 
import sys
if sys.version_info==2:
import commands as run
else:
import subprocess as run
baseCommand='diff --recursive '+sys.argv[1]+' '
for item in sys.argv[2:]:
if run.getstatusoutput(baseCommand+item)[0]!=0:
print('not all the same')
exit(1)
print('all the same')
exit(0)
[georgiy@PANTHER mess]$ cat a
test
[georgiy@PANTHER mess]$ cat b
test
[georgiy@PANTHER mess]$ python allthesame.py a b
Traceback (most recent call last):
  File allthesame.py, line 8, in module
if run.getstatusoutput(baseCommand+item)[0]!=0:
AttributeError: 'module' object has no attribute 'getstatusoutput'
[georgiy@PANTHER mess]$ python3 allthesame.py a b
all the same

--
messages: 192782
nosy: wfatp
priority: normal
severity: normal
status: open
title: For reasons I can't explain Python in some cases says that 
getstatusoutput is not an attribute of the commands module but it is and should 
be
versions: Python 2.7

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



[issue18420] os.rename FileNotFound complaining about dst, but it is src which is missing

2013-07-09 Thread Dun Peal

New submission from Dun Peal:

# The following reproduction is running on Ubuntu 13.04, Python 3.3.1:

$ ls
bar
$ python3 -c import os; os.rename('foo', 'bar')
Traceback (most recent call last):
  File string, line 1, in module
FileNotFoundError: [Errno 2] No such file or directory: 'bar'

--
components: Library (Lib)
messages: 192783
nosy: Dun.Peal
priority: normal
severity: normal
status: open
title: os.rename FileNotFound complaining about dst, but it is src which is 
missing
versions: Python 3.3

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



[issue18338] python --version should send output to STDOUT

2013-07-09 Thread Michael Dickens

Michael Dickens added the comment:

Patch for issue 18338. Changes output for --version and updates unit test 
accordingly.

--
nosy: +MTGandP
Added file: http://bugs.python.org/file30881/issue18338.diff

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



[issue18419] For reasons I can't explain Python in some cases says that getstatusoutput is not an attribute of the commands module but it is and should be

2013-07-09 Thread Ezio Melotti

Ezio Melotti added the comment:

That's because subprocess.getstatusoutput exists only in Python 3, and not 
Python 2.7.  The if sys.version_info==2: is also wrong, so subprocess is 
always selected, resulting in an error when the program is run with Python 2.

--
components: +Library (Lib)
nosy: +ezio.melotti
resolution:  - invalid
stage:  - committed/rejected
status: open - closed
type:  - behavior

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



[issue16665] doc for builtin hex() is poor

2013-07-09 Thread Michael Dickens

Michael Dickens added the comment:

I used the wording suggested by rurpy with some changes. I also added a few 
examples.

--
keywords: +patch
nosy: +MTGandP
Added file: http://bugs.python.org/file30882/issue16665.diff

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



[issue16665] doc for builtin hex() is poor

2013-07-09 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Personally, I think this is overkill.  Can you capture the essence of what you 
want to say in something short and sweet that gets to the point?  We're not 
looking for a complete spec.  You just need to say basically what the function 
does.

--

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



[issue18419] For reasons I can't explain Python in some cases says that getstatusoutput is not an attribute of the commands module but it is and should be

2013-07-09 Thread Georgiy Treyvus

Georgiy Treyvus added the comment:

I realized my mistake too late. It should have been

if sys.version_info[0]==2:

On the other hand

if sys.version_info==2:

while syntactically correct wasn't semantically correct.

My apologies for wasting your time and for my stupidity.

--

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



[issue18420] os.rename FileNotFound complaining about dst, but it is src which is missing

2013-07-09 Thread Ned Deily

Ned Deily added the comment:

Thanks for the report.  This problem is being tracked in Issue16074.

--
nosy: +ned.deily
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - bad error message in os.rename

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



[issue12641] Remove -mno-cygwin from distutils

2013-07-09 Thread Roy Ivy III

Changes by Roy Ivy III rivy@gmail.com:


--
nosy: +rivy

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



[issue18411] signal.SIGINT in windows cause process exit directly.

2013-07-09 Thread R. David Murray

R. David Murray added the comment:

Windows doesn't support posix signals, sending one just kills the process, as 
you have observed.  See the documentation for the os.kill function.

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

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



[issue18417] urlopen() has a hidden default for its timeout argument

2013-07-09 Thread R. David Murray

R. David Murray added the comment:

Please see issue 14425 and then let us know if this is still valid.  It's been 
a while since I looked at the code and I no longer remember the details, but I 
seemed confident in my conclusion at the time... :)

--
nosy: +r.david.murray

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