[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-23 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

I give up. Call it 'linux3', then.

--

___
Python tracker 

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



[issue12618] py_compile cannot create files in current directory

2011-07-23 Thread Sjoerd de Vries

New submission from Sjoerd de Vries :

When you specify cfile to be in the current directory, an error occurs (line 
133).
I have fixed the file, see attached

--
components: Library (Lib)
files: py_compile.py
messages: 140940
nosy: sjdv1982
priority: normal
severity: normal
status: open
title: py_compile cannot create files in current directory
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file22722/py_compile.py

___
Python tracker 

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



[issue12618] py_compile cannot create files in current directory

2011-07-23 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

Please create a patch in unified format.

--
nosy: +Arfrever

___
Python tracker 

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



[issue11435] Links to source code should now point to hg repo

2011-07-23 Thread Georg Brandl

Georg Brandl  added the comment:

Done (in rev e32f140a020b).

--

___
Python tracker 

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



[issue11975] Fix referencing of built-in types (list, int, ...)

2011-07-23 Thread Georg Brandl

Georg Brandl  added the comment:

index does create targets, but they are not accessible for creating a link *to* 
it. They are only used for links from the indices.

--

___
Python tracker 

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



[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-23 Thread Matthias Klose

Matthias Klose  added the comment:

this does sound very ugly.

so we get now another mostly unmaintained platform directory? unfortunately the 
generated header files are almost never updated during a releaes cycle.

and we repeat the mistakes that some constants differ on some architectures?

--

___
Python tracker 

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



[issue12605] Enhancements to gdb 7 debugging hooks

2011-07-23 Thread Georg Brandl

Changes by Georg Brandl :


--
nosy: +georg.brandl, loewis

___
Python tracker 

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



[issue12618] py_compile cannot create files in current directory

2011-07-23 Thread Sjoerd de Vries

Sjoerd de Vries  added the comment:

The attached file just works.
You can diff with trunk, or wherever python devs store the latest version.

--

___
Python tracker 

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



[issue12618] py_compile cannot create files in current directory

2011-07-23 Thread Georg Brandl

Georg Brandl  added the comment:

It might work right now, but in case the file changes before your change can be 
processed, we will lose the previous changes if we just copy in your new file.

IOW, you're making our work much harder and your change is less likely to be 
applied.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue12576] urlib.request fails to open some sites

2011-07-23 Thread Georg Brandl

Georg Brandl  added the comment:

Recognizing "ction: close" as "Connection: close" is exactly what those servers 
do *not* want you to do.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-23 Thread Ned Deily

Ned Deily  added the comment:

Doesn't unix_terminate() also get called on Windows?  If so, what does 
os.kill() do on Windows?  The docs for os.kill say "New in version 3.2: Windows 
support."  Perhaps this was being skipped before and now has some negative 
effect?

--

___
Python tracker 

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



[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-23 Thread STINNER Victor

STINNER Victor  added the comment:

It's too late to "fix" sys.platform.

--

___
Python tracker 

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



[issue12581] Increased test coverage of test_urlparse

2011-07-23 Thread Éric Araujo

Éric Araujo  added the comment:

Peter’s patch now uses iter(thing) instead of len(thing) to assess 
sequenciness.  I made this comment:
> You can iterate over an iterator (which is not a sequence). Here I
> don’t know if the code talks about sequence because it pre-dates
> iterators or because it really wants sequences.

Peter’s reply:
> Fair point. The *code*, though, doesn't say either, and len() doesn't
> express it any better (IMO) than iter(). It seems to me that the
> check basically just verifies that the presumed sequence can be 
> safely iterated over, before trying to enter the for loop. If so, my
> iter() check seems to encapsulate it cleanly in code rather than
> needing an additional comment.

I think iter may exhaust a non-repeatable iterable, whereas len would give a 
TypeError and not consume the iterable.  iter(thing) being successful does not 
guarantee that a second iteration will succeed.

I’ve had a look at the docstring and the reST docs, and they clearly say that 
sequences are supported, not arbitrary iterables.

> If not -- if the code should enforce "true sequence-ness" -- maybe it
> should use the ABC (as my first patch did)? Which is *correct*,
> though, I'm too much an outsider to judge!

Note that ABCs are not strict, “true” type checks like there is in other 
languages :)

> (I tried to check the revlog for clues, but the code entered in
> 5a416a6417d3, which was the new urllib package combining several old
> packages. It's been there for a while.)

Log viewing tools usually let you follow the history across renames, or 
otherwise let you see the history for a file that’s not anymore in the tip 
revision.  Here it was Lib/urlparse.py.  (Just saying this for your 
information, it does not matter anymore to check the history to find if the 
code pre-dates iterators.)

--

___
Python tracker 

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-23 Thread Éric Araujo

Éric Araujo  added the comment:

Same bug.  I’ve added debug prints to find out the rights (UNIX permission 
system) of the files, and they’re very strange: --wxrw--wt (the read bit is 
missing, and the t is strange).  It should be -rwxr-xr-x, like other programs.

The bug is likely this change:
-os.chmod(target, 0755)
+os.chmod(target, 755)

An octal literal in 3.x is 0o755.  Decimal 755 means 0o1363, which is not good 
:)

I’ll let you check the Python docs and Wikipedia if you don’t know these rxw or 
octal codes.

--

___
Python tracker 

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



[issue12619] Automatically regenerate platform-specific modules

2011-07-23 Thread Arfrever Frehtes Taifersar Arahesis

New submission from Arfrever Frehtes Taifersar Arahesis 
:

I suggest that platform-specific modules be automatically regenerated during 
installation. I'm attaching a patch.

--
files: python-regenerate_platdir.patch
keywords: patch
messages: 140952
nosy: Arfrever, amaury.forgeotdarc, djc, doko, eric.araujo, ezio.melotti, 
haypo, jwilk, lemburg, loewis, maniram.maniram, neologix, petri.lehtinen, 
pitrou, python-dev, r.david.murray, rosslagerwall
priority: normal
severity: normal
status: open
title: Automatically regenerate platform-specific modules
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file22723/python-regenerate_platdir.patch

___
Python tracker 

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



[issue12618] py_compile cannot create files in current directory

2011-07-23 Thread Sjoerd de Vries

Sjoerd de Vries  added the comment:

Makes no sense to me: since I don't have the trunk version, I can only diff -c 
against 3.2 release. Doing a diff against trunk is 1 sec of work for you.

But I am just being a helpful user; so if a diff is what you want, here it is. 
No trouble for me, since I am on Linux. 

Not a very nice policy to any helpful Windows users, though: they won't have 
diff installed and they would waste an hour or so on this.

--
keywords: +patch
Added file: http://bugs.python.org/file22724/py_compile.diff

___
Python tracker 

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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-23 Thread Eli Bendersky

Eli Bendersky  added the comment:

Indeed, unix_terminate is invoked on Windows, and since Windows now has 
"os.kill" it runs. However, it appears that the actual os.kill call throws 
OSError, saying:

[Error 87] The parameter is incorrect

--

___
Python tracker 

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



[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-23 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

See issue #12619 for potential solution for platform-specific modules.

--

___
Python tracker 

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-23 Thread Éric Araujo

Éric Araujo  added the comment:

I confirm fixing 0o755 makes the tests pass for me.

Your code gives one warning:
build_scripts.py:241: BytesWarning: str() on a bytes instance
  hdr = "#!%(executable)s%(options)s\n" % locals()

The object with the name executable or options is bytes, which you should 
explicitly convert to a string with decode.  I also don’t like using locals(), 
but that’s a personal style thing.

Your test should catch stdout (see other packaging tests for how to do that), 
so that people or buildbots running the tests don’t see “Hello world!”, and so 
that you can run asserts for the output.

--

___
Python tracker 

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



[issue12619] Automatically regenerate platform-specific modules

2011-07-23 Thread Éric Araujo

Éric Araujo  added the comment:

(Autotools/make newbie here) Why during install and not build?

--

___
Python tracker 

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



[issue12619] Automatically regenerate platform-specific modules

2011-07-23 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

I don't care when they will be regenerated.

--

___
Python tracker 

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



[issue12618] py_compile cannot create files in current directory

2011-07-23 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

It's a context patch, not a unified patch, and it is reversed :) .

--

___
Python tracker 

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



[issue12617] Mutable Sequence Type can work not only with iterable in slice[i:j] = t

2011-07-23 Thread Daniel Urban

Changes by Daniel Urban :


--
nosy: +durban

___
Python tracker 

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



[issue12604] VTRACE macro in _sre.c should use do {} while (0)

2011-07-23 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Should the component really be extension modules? I don't believe _sre.c is a 
part of the API, and the problem is embedding Python as a whole.

--

___
Python tracker 

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



[issue12581] Increased test coverage of test_urlparse

2011-07-23 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

On Sat, Jul 23, 2011 at 09:37:27AM +, Éric Araujo wrote:
> I’ve had a look at the docstring and the reST docs, and they clearly
> say that sequences are supported, not arbitrary iterables.

Yeah. At the first cut, when I saw the suggestion of iter(), I thought
it was better, but looking at it again, we just need to test the
sequence-ness. I would leave it as such with len() unless we come up
with a case that it does not test the sequenceness completely.

As Eric points out, changing it to iter may cause some side-effects
(of exhaustion of the container)

--

___
Python tracker 

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



[issue12619] Automatically regenerate platform-specific modules

2011-07-23 Thread Matthias Klose

Matthias Klose  added the comment:

is auto-generation wanted?
are you sure that you can't end up with bad syntax?

--

___
Python tracker 

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



[issue12581] Increased test coverage of test_urlparse

2011-07-23 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset e171db785c37 by Senthil Kumaran in branch '3.2':
Fix closes issue12581 - Increase the urllib.parse test coverage. Patch by 
Petter Haggholm.
http://hg.python.org/cpython/rev/e171db785c37

New changeset fcccda3c546f by Senthil Kumaran in branch 'default':
merge from 3.2 - Fix closes issue12581 - Increase the urllib.parse test 
coverage. Patch by Petter Haggholm.
http://hg.python.org/cpython/rev/fcccda3c546f

New changeset ed79da800b4a by Senthil Kumaran in branch '2.7':
merge from 3.2 - Fix closes issue12581 - Increase the urllib.parse test 
coverage (cases applicable to 2.7). Patch by Petter Haggholm.
http://hg.python.org/cpython/rev/ed79da800b4a

--
nosy: +python-dev
resolution:  -> fixed
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



[issue12618] py_compile cannot create files in current directory

2011-07-23 Thread Georg Brandl

Georg Brandl  added the comment:

Well, we can work with this patch.  Thanks.

Yes, we can diff against 3.2, but for that you would have at least needed to 
specify

* that you worked on a released version
* and that that version is 3.2

Otherwise, we cannot know what to diff against.

Note that even Windows users usually use Python from Mercurial for developing, 
so that they can use "hg diff" to create a patch easily.

--

___
Python tracker 

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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-23 Thread Eli Bendersky

Eli Bendersky  added the comment:

Here's a simple reproducer for the same problem, without the context of IDLE. 
As far as I understand, what IDLE's spawn and then kill process are doing is:

  import os
  from signal import SIGTERM

  pid = os.spawnv(os.P_NOWAIT, "notepad.exe", ['notepad.exe'])
  print('pid = %s, SIGTERM = %s' % (pid, SIGTERM))
  os.kill(pid, SIGTERM)

Running this, the notepad.exe subprocess stays alive after the script exits, 
and I get the error:

  pid = 1868, SIGTERM = 15
  Traceback (most recent call last):
File "k.py", line 6, in 
  os.kill(pid, SIGTERM)
  WindowsError: [Error 87] The parameter is incorrect

--

___
Python tracker 

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



[issue12617] Mutable Sequence Type can work not only with iterable in slice[i:j] = t

2011-07-23 Thread Georg Brandl

Georg Brandl  added the comment:

Yes, this is a bug in bytearray and should be fixed.

--
assignee: docs@python -> 
components:  -Documentation
nosy: +georg.brandl
versions: +Python 2.7, Python 3.2 -Python 3.1

___
Python tracker 

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



[issue12581] Increased test coverage of test_urlparse

2011-07-23 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Thanks a lot for the patch, Petter Haggholm.

I was initially hesitant to have separate tests for functions/methods
which are helper functions and not necessarily have documented api.
My thought was that those should be tested as part of the public api.

But once I tried coverage report on the module and saw that
unexercised parts, I thought your current patch does indeed a lot of
value. Aiming for a 100% test coverage of module is always a joy!. :)

--

___
Python tracker 

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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-23 Thread Georg Brandl

Georg Brandl  added the comment:

Hmm, the docs say "Any other value for sig will cause the process to be 
unconditionally killed by the TerminateProcess API [...]"

What happens if you try to use other signals (like signal.SIGKILL) instead of 
SIGTERM?

--

___
Python tracker 

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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-23 Thread Georg Brandl

Georg Brandl  added the comment:

The other question is if it is an access control problem.

win32_kill tries to open the process with PROCESS_ALL_ACCESS, while IMO 
PROCESS_TERMINATE would suffice.

--

___
Python tracker 

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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-23 Thread Eli Bendersky

Eli Bendersky  added the comment:

Georg, I'm now debugging into win32_kill, and it's an error in OpenProcess, so 
this *could* be a security issue.

The process is started with _spawnv, so maybe this causes problems opening it 
with OpenProcess later.

--

___
Python tracker 

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



[issue8714] Delayed signals in the REPL on OpenBSD (possibly libpthread related)

2011-07-23 Thread Charles-François Natali

Charles-François Natali  added the comment:

> This behavior was introduced (exposed by?) r68460.

After a quick look, I don't see anything wrong with r68460, but it might very 
well have exposed this problem which was lurking before.

> When Python is compiled without threads, the behavior is normal.

We've already had some problems - especially on *BSD - when mixing signals and 
threads (and it might be even worse on OpenBSD, since pthreads are implemented 
in user-space). However, IIUC, in this case you only have a single thread, 
right?

Could you post the output of an strace (well, ktrace on OpenBSD)?
Is Python compiled with readline support?

--
nosy: +neologix

___
Python tracker 

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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-23 Thread Eli Bendersky

Eli Bendersky  added the comment:

According to 
http://msdn.microsoft.com/en-us/library/7zt1y878%28v=vs.80%29.aspx, on Windows 
_spawnv in async mode (P_NOWAIT) returns the process _handle_, not the process 
ID.

win32_kill uses OpenProcess, passing it pid to obtain the handle, but this pid 
is already the process handle. 

Removing the whole call to OpenProcess in win32_kill and passing pid (instead 
of handle) directly to TerminateProcess, solves the problem.



So this appears to be a mismatch between os.spawnv and os.kill on windows. The 
fist returns the process handle, the second expects a process ID.

Note that the documentation of os.spawnv mentions something about this:

  If mode is P_NOWAIT, this function returns the process id of the new process; 
[...] On Windows, the process id will actually be the process handle, so can be 
used with the waitpid() function.

--

___
Python tracker 

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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-23 Thread Georg Brandl

Georg Brandl  added the comment:

Hmm, on the other hand there may be valid use cases for using os.kill() with a 
PID.  Argh.

--

___
Python tracker 

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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-23 Thread Eli Bendersky

Eli Bendersky  added the comment:

I don't think there's a problem with os.spawnv and os.kill - they do what their 
docs describe.

IMHO, the solution should be to change IDLE so that it uses subprocess.Popen 
for both starting and killing the child process.

--

___
Python tracker 

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



[issue12620] pending calls: make `pendingbusy` flag static to Py_MakePendingCalls()

2011-07-23 Thread Charles-François Natali

New submission from Charles-François Natali :

Trivial patch.
In Python/ceval.c, when compiled with threads, make the `pendingbusy` flag used 
to guard against reentrant calls static to Py_MakePendingCalls().
Also, make it an int and rename it to `busy` to be consistent with the 
non-threaded code (int might also be a bit faster).

--
components: Interpreter Core
files: pending_busy.diff
keywords: needs review, patch
messages: 140976
nosy: neologix, pitrou
priority: low
severity: normal
stage: patch review
status: open
title: pending calls: make `pendingbusy` flag static to Py_MakePendingCalls()
versions: Python 3.3
Added file: http://bugs.python.org/file22725/pending_busy.diff

___
Python tracker 

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



[issue11049] add tests for test.support

2011-07-23 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 0018a28583f4 by Eli Bendersky in branch 'default':
Issue #11049: skip a test that fails on some buildbots
http://hg.python.org/cpython/rev/0018a28583f4

--

___
Python tracker 

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



[issue12608] crash in PyAST_Compile when running Python code

2011-07-23 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
dependencies: +add a AST validator

___
Python tracker 

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-23 Thread higery

higery  added the comment:

>>An octal literal in 3.x is 0o755.  Decimal 755 means 0o1363, which is not 
>>good :)

Thank you for your reminding. The reason I made this mistake is that I'm not 
familiar with the right way to set permission code in Python3+ .

--

___
Python tracker 

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-23 Thread higery

higery  added the comment:

>>The object with the name executable or options is bytes, which you should 
>>explicitly convert to a string with decode.  I also don’t like using 
>>locals(), but that’s a personal style thing.

Thanks for your test, I'll amend it.

--

___
Python tracker 

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



[issue11049] add tests for test.support

2011-07-23 Thread Eli Bendersky

Eli Bendersky  added the comment:

OK, the bots are green again after the last push.

Sorry about that, folks. I tested this on two different machines (Ubuntu & Win 
XP) before pushing the original commit.

--

___
Python tracker 

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



[issue10883] urllib: socket is not closed explicitly

2011-07-23 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset c741ba9e37ef by Nadeem Vawda in branch '3.2':
Issue #10883: Fix socket leaks in urllib.request.
http://hg.python.org/cpython/rev/c741ba9e37ef

New changeset d68765bd6490 by Nadeem Vawda in branch 'default':
Merge: #10883: Fix socket leaks in urllib.request.
http://hg.python.org/cpython/rev/d68765bd6490

--

___
Python tracker 

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



[issue11877] Change os.fsync() to support physical backing store syncs

2011-07-23 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso  added the comment:

> > Even PEP 3151 won't help.
> 
> I don't understand. If the syscall supposed to flush the disk's buffer
> cache fails - be it fcntl() or sync_file_range() - I think the error
> should be propagated, not silently ignored and replaced with another
> syscall which doesn't have the same semantic. That's all.

I'm with you theoretically - of course errors should be propagated
to users so that they can act accordingly.
And this is exactly what the patches do, *unless* it is an error
which is not produced by the native fsync(2) call:

-- >8 --
?0%0[steffen@sherwood tmp]$ cat t.c 
#include 
#include 
#include 
#include 
#include 
int main(void) {
int r  = fcntl(2, F_FULLFSYNC);
fprintf(stderr, "1. %d: %d, %s\n", r, errno, strerror(errno));
errno = 0;
r = fsync(2);
fprintf(stderr, "2. %d: %d, %s\n", r, errno, strerror(errno));
return 0;
}
?0%0[steffen@sherwood tmp]$ gcc -o t t.c && ./t
1. -1: 25, Inappropriate ioctl for device
2. 0: 0, Unknown error: 0
?0%0[steffen@sherwood tmp]$ grep -F 25 /usr/include/sys/errno.h 
#define ENOTTY  25  /* Inappropriate ioctl for device */
-- >8 --

So in fact the patches do what is necessary to make the changed
version act just as the plain systemcall.

> > - I favour haypos fullsync() approach
> Are you willing to update your patch accordingly?

Both patches still apply onto the tip of friday noon:
http://bugs.python.org/file22016/11877.9.diff,
http://bugs.python.org/file22046/11877-standalone.1.diff.

Again: i personally would favour os.fsync(fd, fullsync=True), because
that is the only way to put reliability onto unaware facilities
unaware (e.g. my S-Postman replaces os.fsync() with a special function
so that reliability is injected in- and onto Python's mailbox.py,
which calls plain os.fsync()), but i've been convinced that this is
impossible to do.  It seems to be impossible to change os.fsync()
at all, because it has a standartized function prototype.

So what do you mean?  Shall i rewrite 11877-standalone.1.diff to
always offer fullsync() whenever there is fsync()?  This sounds to
be a useful change, because testing hasattr() of the one would
imply availability of the other.

> >   + Aaarrg!  I'm a liar!!  I lie about - data integrity!!!
> Well, actually, some hard disks lie about this too :-)

Yeah.  But hey:
"I feel save in New York City.  I feel save in New York City."
Nice weekend - and may the juice be with you!

--Steffen
Ciao, sdaoden(*)(gmail.com)
ASCII ribbon campaign   ( ) More nuclear fission plants
  against HTML e-mailXcan serve more coloured
and proprietary attachments / \ and sounding animations

--

___
Python tracker 

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-23 Thread higery

higery  added the comment:

>>Your test should catch stdout (see other packaging tests for how to do that), 
>>so that people or buildbots running the tests don’t see “Hello world!”, and 
>>so that you can run asserts for the output.


Thanks. Got it - captured_stdout

--

___
Python tracker 

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



[issue12619] Automatically regenerate platform-specific modules

2011-07-23 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

The new patch creates platform-specific modules at build time and verifies 
their syntax.

--
Added file: http://bugs.python.org/file22726/python-regenerate_platdir.patch

___
Python tracker 

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



[issue12619] Automatically regenerate platform-specific modules

2011-07-23 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


Removed file: http://bugs.python.org/file22723/python-regenerate_platdir.patch

___
Python tracker 

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



[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> this does sound very ugly.
> 
> so we get now another mostly unmaintained platform directory?
> unfortunately the generated header files are almost never updated
> during a releaes cycle.

I would be +1 to deprecate this stuff, but that's quite separate from
the issue of not breaking on Linux 3.x.

--

___
Python tracker 

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



[issue12588] test_capi.test_subinterps() failed on OpenBSD (powerpc)

2011-07-23 Thread Charles-François Natali

Charles-François Natali  added the comment:

and Darwin).

It would have been useful...

"""
interp 0x0, thread state 0x81855380:
Program received signal SIGSEGV, Segmentation fault.
"""

Here, the interpreter state is NULL, and this shouldn't happen.
It could be a bug linked to thread-local storage (like issue #10517):
it's just a wild guess, but if for some reason the TLS key isn't reset
before the second pass (by _PyGILState_Init()), the current tstate
after PyGILState_Ensure() could be the first pass' - stale - tstate,
with a potentially NULL interp.
Could you try building Python with --with-pydebug and re-test?

But given the stack trace, it looks more like a stack
corruption/compiler problem.

If you're motivated, you could try setting a watchpoint on the current
tstate's interpreter:

"""
cf@neobox:~/cpython$ gdb Modules/_testembed
[...]
(gdb) watch ((PyThreadState*)_PyThreadState_Current)->interp
Watchpoint 1: ((PyThreadState*)_PyThreadState_Current)->interp
"""

and see when it gets assigned NULL.

--

___
Python tracker 

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



[issue10883] urllib: socket is not closed explicitly

2011-07-23 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset dbf1e1a27427 by Nadeem Vawda in branch '2.7':
Issue #10883: Fix socket leaks in urllib.request.
http://hg.python.org/cpython/rev/dbf1e1a27427

--

___
Python tracker 

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-23 Thread higery

Changes by higery :


Added file: http://bugs.python.org/file22727/c5692393c621.diff

___
Python tracker 

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



[issue12581] Increased test coverage of test_urlparse

2011-07-23 Thread R. David Murray

R. David Murray  added the comment:

Exhaustion of the iterator is easily solved by simply retaining a reference to 
it and iterating that (which is what I had in mind).  However, I had not 
thought about the problem of an *in*exhaustable iterator, and to cover that 
case len is indeed better.

--

___
Python tracker 

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



[issue12528] Implement configurable bitfield allocation strategy

2011-07-23 Thread Vlad Riscutia

Vlad Riscutia  added the comment:

Updated patch to reflect review feedback. Allocation strategy is now specified 
as string in Python code.

I kept asserts in CanContinueField/CanExpandField because, as I said, default 
case should never be hit. Input is validated in stgdict and this should make it 
clear to whoever reads the code that something is very wrong if execution gets 
to default case.

--
Added file: 
http://bugs.python.org/file22728/configurable_bitfield_allocation_v2.diff

___
Python tracker 

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



[issue12618] py_compile cannot create files in current directory

2011-07-23 Thread Sjoerd de Vries

Sjoerd de Vries  added the comment:

Good to hear that the patch is helpful.

Again, I am just trying to be a helpful user, making a (very very little) 
contribution to make Python better. I am not a Python dev at all: Python is 
already awesome enough for me, no desire to change it :-) 
I just want to say that a "we only accept patches" policy is not being very 
nice to similar helpful users on Windows, who don't have diff or Mercurial but 
who did manage to fix a file themselves. 

I did indicate "Python 3.2" in the bug report, maybe something went wrong.

--

___
Python tracker 

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



[issue12560] libpython.so not built on OpenBSD

2011-07-23 Thread Stefan Krah

Stefan Krah  added the comment:

Unassigning: I tested on OpenBSD 4.5 and get other (probably unrelated
errors).

--
assignee: skrah -> 

___
Python tracker 

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



[issue12560] libpython.so not built on OpenBSD

2011-07-23 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +haypo, neologix

___
Python tracker 

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



[issue12620] pending calls: make `pendingbusy` flag static to Py_MakePendingCalls()

2011-07-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Looks obviously fine :)

--

___
Python tracker 

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



[issue12605] Enhancements to gdb 7 debugging hooks

2011-07-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The improvements are welcome, but I'm not sure they're ok for 3.2 or 2.7, since 
they're technically a new feature.
OTOH, one could argue that better debuggability trumps the no-feature rule.

--
nosy: +pitrou
stage:  -> patch review

___
Python tracker 

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



[issue12603] pydoc.synopsis breaks if filesystem returns mtime of 0

2011-07-23 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +neologix

___
Python tracker 

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



[issue12620] pending calls: make `pendingbusy` flag static to Py_MakePendingCalls()

2011-07-23 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset cda93720c06d by Charles-François Natali in branch 'default':
Issue 12620: Make pendingbusy flag static to Py_MakePendingCalls().
http://hg.python.org/cpython/rev/cda93720c06d

--
nosy: +python-dev

___
Python tracker 

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



[issue12620] pending calls: make `pendingbusy` flag static to Py_MakePendingCalls()

2011-07-23 Thread Charles-François Natali

Changes by Charles-François Natali :


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



[issue11610] Improved support for abstract base classes with descriptors

2011-07-23 Thread Darren Dale

Darren Dale  added the comment:

Here is a new version of the patch, addressing points raised in the review of 
the previous version.

--
Added file: http://bugs.python.org/file22729/abc_descriptor.patch

___
Python tracker 

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



[issue11610] Improved support for abstract base classes with descriptors

2011-07-23 Thread Michael Foord

Changes by Michael Foord :


--
nosy:  -michael.foord

___
Python tracker 

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



[issue11553] Docs for: import, packages, site.py, .pth files

2011-07-23 Thread aaugustin

aaugustin  added the comment:

I noticed an inconsistency in the docs, and I think it falls in the "Language 
Reference" section of this ticket. In the definition of the import statement, 
after:

| "from" module "import" "*"

we should add:

| "from" relative_module "import" "*"


It is also possible to replace this line by:

| "from" (module | relative_module) "import" "*"

--
nosy: +aaugustin

___
Python tracker 

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



[issue12603] pydoc.synopsis breaks if filesystem returns mtime of 0

2011-07-23 Thread Charles-François Natali

Charles-François Natali  added the comment:

Demo:

"""
cf@neobox:~/cpython$ ./python -c "import pydoc; 
print(pydoc.synopsis('Lib/os.py'))"
OS routines for Mac, NT, or Posix depending on what system we're on.
[51835 refs]
cf@neobox:~/cpython$ touch -t 19700101 Lib/os.py 
cf@neobox:~/cpython$ ./python -c "import pydoc; 
print(pydoc.synopsis('Lib/os.py'))"
None
[51833 refs]
"""

> I'd suggest using the fix of changing the .get call to return a default of 
> (None,
> None) and changing the conditional to "lastupdate is not None and
> lastupdate < mtime".

You mean "lastupdate is None or lastupdate < mtime"? Otherwise, a file not 
present in the cache would never be looked-up.

Here's a patch.
It's obvious, but note that if the filesystem doesn't provide mtime, then once 
the metadata has been cached, it won't be refreshed if the file is updated.

I'll take a look around the standard library for similar issues.

Note: it would of course be simpler to use -1 as the default mtime value, but a 
negative time_t is possible.

--
keywords: +needs review, patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file22730/pydoc_mtime.diff

___
Python tracker 

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



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
title: text files returned by subprocess.Popen with universal_newlines=True are 
not iterable -> TextIOWrapper should fall back on read() if read1() doesn't 
exist

___
Python tracker 

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



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

So, as the title indicates, I think we should make TextIOWrapper work with raw 
IO objects. The reason is so that write() can behave in a totally unbuffered 
way, which is necessary for Popen to behave appropriately.

--

___
Python tracker 

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



[issue12600] Support parameterized TestCases in unittest

2011-07-23 Thread Michael Foord

Michael Foord  added the comment:

Having a "TestCase factory" would be pretty easy, and solve the scaling 
problems.

For example:

def make_testcase_classes():
for backend in backends:
yield type(
'{}Test'.format(backend.name),
(TheBaseClass, unittest.TestCase),
{'backend': backend}
)

You would use this in the load_tests function at the module level to generate 
all the test cases.

--

___
Python tracker 

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



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Hmm, one problem is that the C TextIOWrapper buffers writes. We would need an 
additional constructor parameter to prevent that :/

--

___
Python tracker 

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



[issue12621] Errors in docstrings of find and rfind methods of bytes and bytestring

2011-07-23 Thread Petri Lehtinen

New submission from Petri Lehtinen :

bytes.{find,rfind} reads s[start:end]; should be B[start:end]

bytearray.{find,rfind} reads s[start,end]; should be B[start:end]

{str,unicode}.{find,rfind} reads s{start:end]; should be S[start:end]

--
assignee: docs@python
components: Documentation, Interpreter Core
keywords: easy
messages: 141001
nosy: docs@python, petri.lehtinen
priority: normal
severity: normal
stage: needs patch
status: open
title: Errors in docstrings of find and rfind methods of bytes and bytestring
versions: Python 2.7, 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



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Another possibility is to provide read1() on RawIO, as a synonym of read().

--

___
Python tracker 

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



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a first patch allowing TextIOWrapper to work with raw IO objects, and 
adding a "write_through" flag.

--
keywords: +patch
Added file: http://bugs.python.org/file22731/textio_rawio.patch

___
Python tracker 

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



[issue12622] failfast argument to TextTestRunner not documented

2011-07-23 Thread Antoine Pitrou

New submission from Antoine Pitrou :

http://docs.python.org/dev/library/unittest.html#unittest.TextTestRunner 
doesn't mention the "failfast" argument, even though it's used by 
unittest.main().

--
assignee: michael.foord
components: Documentation
messages: 141004
nosy: michael.foord, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: failfast argument to TextTestRunner not documented
type: behavior
versions: 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



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

"write_through" is not used in _pyio.py, is it expected?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> "write_through" is not used in _pyio.py, is it expected?

Yup, because it is actually always write-through (writes are not
cached). The argument is only there so that the signature is the same as
the C version.

--

___
Python tracker 

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



[issue8714] Delayed signals in the REPL on OpenBSD (possibly libpthread related)

2011-07-23 Thread Stefan Krah

Stefan Krah  added the comment:

I know, the OpenBSD libpthread has problems. I listed some possible
candidates in #8712.

For instance:

http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/ports/lang/python/2.6/patches/Attic/patch-Lib_test_test_signal_py?rev=1.3;content-type=text%2Fplain


The comment says: "siginterrupt not reliable (does not mix well with threading"



To answer your questions:

1) Yes, there is only a single thread.

2) I only have an old OpenBSD 4.5, so it's not so useful to test
   there; I know Philip Guenther fixed some libpthread problems
   in the meantime.

--

___
Python tracker 

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



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Looks good, then.

--

___
Python tracker 

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



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

This additional patch improves universal_newlines support in subprocess (still 
broken with the select- and poll-based loops in communicate()).

--
Added file: http://bugs.python.org/file22732/spnewlines.patch

___
Python tracker 

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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-23 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Eli, nice detective work. What I understand is that there was a latent 
platform-dependent buglet that presumably got exposed by a recent change in 
process handling, as Ned suggested.

idlelib/PyShell.py, class ModifiedInterpreter(InteractiveInterpreter) has
def spawn_subprocess(self):
if self.subprocess_arglist is None:
self.subprocess_arglist = self.build_subprocess_arglist()
args = self.subprocess_arglist
self.rpcpid = os.spawnv(os.P_NOWAIT, sys.executable, args)

so IDLE expects the return to always be a pid which it is not.

Spawn_subprocess is called in both start_subprocess and restart_subprocess. 
Both now leave zombies on exit. I presume idlelib.run.main listens on the 
passed in port (in args) to make the connection. It appears to me that restart 
reuses the socket wrapped in self.rpcclt (rpc client).

Using subprocess.Popen seems like an good idea. The subprocess module is 
explicitly intended to replace low-level, fragile, difficult to get right, 
usage of os.spawn* and similar. If it does not work for this problem, *it* 
should be fixed.

On the other hand, IDLE uses sockets rather than pipes to communicate with 
subproccesses, perhaps because Windows pipes either are or were not as usable 
as unix pipes. Also, named or reusable pipes may not be usiversally available, 
so wrapping a pipe instead of a socket would, it seems to me, take more than 
simple replacement of spawnv by Popen.

Kurt, what do you think about possible fixes to this bug (critical for using 
IDLE on Windows)?

--

___
Python tracker 

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



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 9144014028f3 by Antoine Pitrou in branch '3.2':
Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without
http://hg.python.org/cpython/rev/9144014028f3

New changeset c3b47cdea0d1 by Antoine Pitrou in branch 'default':
Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without
http://hg.python.org/cpython/rev/c3b47cdea0d1

--
nosy: +python-dev

___
Python tracker 

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



[issue8714] Delayed signals in the REPL on OpenBSD (possibly libpthread related)

2011-07-23 Thread Stefan Krah

Stefan Krah  added the comment:

I forgot: readline support is enabled, and there are known problems:

http://marc.info/?t=12832732933&r=1&w=2

--

___
Python tracker 

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



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 5cc536fbd7c1 by Antoine Pitrou in branch '3.2':
Issue #12591: Improve support of "universal newlines" in the subprocess
http://hg.python.org/cpython/rev/5cc536fbd7c1

New changeset b616396fa170 by Antoine Pitrou in branch 'default':
Issue #12591: Improve support of "universal newlines" in the subprocess
http://hg.python.org/cpython/rev/b616396fa170

--

___
Python tracker 

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



[issue12623] "universal newlines" subprocess support broken with select- and poll-based communicate()

2011-07-23 Thread Antoine Pitrou

New submission from Antoine Pitrou :

The select() and poll() loop implementations of Popen.communicate() call 
os.write() instead of the write() method on the stdin pipe, meaning any newline 
translation *and* unicode-to-bytes encoding step is skipped.

To use the write() method on the stdin pipe, we may have to set the file 
descriptor in non-blocking mode, especially given that _PIPE_BUF worth of 
characters can amount to more than _PIPE_BUF bytes on the underlying raw fd.

See issue12591 for a simpler issue that was fixed.

--
components: Library (Lib)
messages: 141014
nosy: gregory.p.smith, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: "universal newlines" subprocess support broken with select- and 
poll-based communicate()
type: behavior
versions: 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



[issue12591] TextIOWrapper should fall back on read() if read1() doesn't exist

2011-07-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, this should be fixed now. universal newlines support is still broken with 
communicate(), I've opened issue12623 for that.

--
resolution:  -> fixed
stage: needs patch -> 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



[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-07-23 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Attached a patch with the following changes:

Allow an integer argument in range(0, 256) for the following bytes and
bytearray methods: count, find, index, rfind, rindex. Initially, only
count and index were targeted, but as index is implemented in a helper
function that is also used to implement find, rfind and rindex, these
functions were affected too.

The bytes methods were changed to use the new buffer protocol instead
of the deprecated PyObject_AsCharBuffer, for consistency with the
bytearray code.

Tests for all the modified functions were expanded to cover the new
functionality. While at it, the tests for count, index and rindex were
also further expanded (to test for slices, for example), as they were
initially quite minimal.

A paragraph describing the additional semantics of the five methods
was added to the documentation.

The error messages of index and rindex were left untouched
("substring not found" and "subsection not found"). In a case where
the first argument is an integer, the error messages could talk about
a byte instead of substring/subsection. This would have been a bit
non-straightforward to implement, so I didn't.

The docstrings were also left unchanged, as I couldn't find a good
wording for them. The problem is not that the first argument may now
be an integer, but as it can now be more than a substring or
subsection, we might have to specify what a substring or subsection
really means. And that explanation would be lengthy (because of the buffer 
protocol, that's not a concept that a regular Python programmer is, or even 
needs to be, familiar with)...

And finally, there's one thing that I'm unsure of:

When an integer out of range(0, 256) is passed as the first argument,
should we raise a ValueError or a TypeError? Currently, a ValueError
is raised, but this may be bad for index and rindex, as they raise a
ValueError when the substring or byte is not found. I made the
decision to raise a ValueError decision because __contains__ of both
bytes and bytearray raise a ValueError when passed an integer not in
range(0, 256).

--
keywords: +needs review, patch
stage: test needed -> patch review
Added file: http://bugs.python.org/file22733/issue12170.patch

___
Python tracker 

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



[issue12624] failfast support for regrtest

2011-07-23 Thread Antoine Pitrou

New submission from Antoine Pitrou :

This patch adds a new --failfast (-G) argument to regrtest which stops running 
the tests as soon as a test fails (when using unittest-based test cases). 
Useful with long test suites such as test_io and test_subprocess.

--
components: Tests
files: failfast.patch
keywords: patch
messages: 141017
nosy: ezio.melotti, michael.foord, pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: failfast support for regrtest
type: feature request
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file22734/failfast.patch

___
Python tracker 

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



[issue12624] failfast support for regrtest

2011-07-23 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 9f847dfba217 by Antoine Pitrou in branch '3.2':
Issue #12624: It is now possible to fail after the first failure when
http://hg.python.org/cpython/rev/9f847dfba217

New changeset 01d18277c40b by Antoine Pitrou in branch 'default':
Issue #12624: It is now possible to fail after the first failure when
http://hg.python.org/cpython/rev/01d18277c40b

--
nosy: +python-dev

___
Python tracker 

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



[issue12624] failfast support for regrtest

2011-07-23 Thread Antoine Pitrou

Changes by Antoine Pitrou :


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



[issue12625] sporadic test_unittest failure

2011-07-23 Thread Antoine Pitrou

New submission from Antoine Pitrou :

Seen on an OpenIndiana buildbot:

==
FAIL: testInstallHandler (unittest.test.test_break.TestBreak)
--
Traceback (most recent call last):
  File 
"/export/home/buildbot/64bits/3.2.cea-indiana-amd64/build/Lib/unittest/test/test_break.py",
 line 37, in testInstallHandler
self.assertTrue(unittest.signals._interrupt_handler.called)
AssertionError: False is not true

http://www.python.org/dev/buildbot/all/builders/AMD64%20OpenIndiana%203.2/builds/454/steps/test/logs/stdio


Probably something to do with signals behaviour under that particular OS.

--
components: Library (Lib), Tests
messages: 141019
nosy: haypo, michael.foord, neologix, pitrou
priority: normal
severity: normal
status: open
title: sporadic test_unittest failure
type: behavior
versions: 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



[issue12624] failfast support for regrtest

2011-07-23 Thread Sandro Tosi

Changes by Sandro Tosi :


--
resolution: invalid -> fixed

___
Python tracker 

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



[issue10883] urllib: socket is not closed explicitly

2011-07-23 Thread Nadeem Vawda

Changes by Nadeem Vawda :


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



[issue12331] lib2to3 and packaging tests fail because they write into protected directory

2011-07-23 Thread python272

python272  added the comment:

problem exists in python 2.7.2 (should this be reported as a separate issue?)

[Python-2.7.2]$ python -m test.regrtest  -v test_lib2to3
...
ERROR: test_bom (lib2to3.tests.test_refactor.TestRefactoringTool)
...
ERROR: test_crlf_newlines 
ERROR: test_file_encoding
ERROR: test_refactor_file
...

e.g.,

  File "/usr/local/lib/python2.7/lib2to3/tests/test_refactor.py", line 194, in 
check_file_refactoring
with open(test_file, "wb") as fp:
IOError: [Errno 13] Permission denied: 
'/usr/local/lib/python2.7/lib2to3/tests/data/fixers/parrot_example.py'
...
[test]# ls -l 
/usr/local/lib/python2.7/lib2to3/tests/data/fixers/parrot_example.py 
-rw-r--r-- 1 root root 23 2011-07-23 11:48 
/usr/local/lib/python2.7/lib2to3/tests/data/fixers/parrot_example.py

--
nosy: +python272

___
Python tracker 

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



[issue12331] lib2to3 and packaging tests fail because they write into protected directory

2011-07-23 Thread Éric Araujo

Changes by Éric Araujo :


--
versions: +Python 2.7, Python 3.2

___
Python tracker 

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



[issue12603] pydoc.synopsis breaks if filesystem returns mtime of 0

2011-07-23 Thread Éric Araujo

Éric Araujo  added the comment:

Patch looks good.  Does this require a doc update, or is it entirely an 
internal function?

--

___
Python tracker 

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



[issue12626] run test cases based on a glob filter

2011-07-23 Thread Antoine Pitrou

New submission from Antoine Pitrou :

This patch allows to only run tests which satisfy a glob filter, using the 
--match (-m) option to regrtest. For example:

  ./python -m test -m "*Signal*" -v test_io

will execute all the signal-related tests in test_io.

--
components: Tests
files: regrtestglob.patch
keywords: patch
messages: 141022
nosy: ezio.melotti, michael.foord, pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: run test cases based on a glob filter
type: feature request
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file22735/regrtestglob.patch

___
Python tracker 

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



[issue12625] sporadic test_unittest failure

2011-07-23 Thread Charles-François Natali

Charles-François Natali  added the comment:

Looks similar to issue #8263, which is in turn similar to #12469 (see
http://bugs.python.org/issue12469#msg139620 and
http://bugs.python.org/issue12469#msg139626 for original explanations):
normally, pending signals are checked when the process returns to
user-space, so a code like:

os.kill(os.getpid(), signum)
self.assertTrue(signum's handler called)

will succeed, because the signal is delivered before the kill()
syscall returns (it's actually required by POSIX), and the Python
signal handler will be called from the main eval loop before the assertion
test.
But if the signal isn't delivered right away (on FreeBSD6, it happens
only after a thread has been created, which explains #12469 and
probably #8263), then this check can fail (the signal will be
delivered typically when the next syscall returns, or at the next
timer interrupt, which could be after the test).

So I'd say the easier solution is to skip this test on OpenSolaris,
like it's done on FreeBSD6 since issue #8263.
Patch attached.

--
keywords: +patch
Added file: http://bugs.python.org/file22736/indiana_signal.diff

___
Python tracker 

___diff -r cda93720c06d Lib/unittest/test/test_break.py
--- a/Lib/unittest/test/test_break.py   Sat Jul 23 18:15:43 2011 +0200
+++ b/Lib/unittest/test/test_break.py   Sun Jul 24 00:57:04 2011 +0200
@@ -9,9 +9,9 @@
 
 
 @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill")
-@unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows")
-@unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 "
-"if threads have been used")
+@unittest.skipIf(sys.platform == 'win32', "Test cannot run on Windows")
+@unittest.skipIf(sys.platform == 'freebsd6', "due to known OS bug")
+@unittest.skipIf(sys.platform.startswith('sunos'), "due to known OS bug")
 class TestBreak(unittest.TestCase):
 
 def setUp(self):
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12603] pydoc.synopsis breaks if filesystem returns mtime of 0

2011-07-23 Thread Charles-François Natali

Charles-François Natali  added the comment:

Well, the function is part of pydoc's public API, but the inner
working of the cache mechanism is completely private: this won't have
any impact, other than fixing the bug :-)

--

___
Python tracker 

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



[issue12625] sporadic test_unittest failure

2011-07-23 Thread Charles-François Natali

Charles-François Natali  added the comment:

> So I'd say the easier solution is to skip this test on OpenSolaris,
> like it's done on FreeBSD6 since issue #8263.

Another option could be to add a dummy syscall, like os.getpid(),
before checking that the handler got called - this might be enough to
have the signal delivered.
Note that this kind of test assumes that the Python signal handler is
called right after the signal is delivered, i.e. every time from the
main eval loop (I think that's true with recent Python versions, is
that true with 2.7?).

--

___
Python tracker 

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



  1   2   >