[issue9302] distutils API Reference: setup() and Extension parameters' description not correct.

2011-06-16 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

 FYI, in one packaging doc I added one note instead of changing each cell: 
 http://docs.python.org/dev/library/packaging.compiler#id6


I like this solution, it seems more concise and to the point. With this the doc 
need only one change:


--- a/Doc/distutils/apiref.rst  Fri Apr 29 14:07:28 2011 +0800
+++ b/Doc/distutils/apiref.rst  Thu Jun 16 23:15:12 2011 +0800
@@ -85,15 +85,15 @@
| *script_args*  | Arguments to supply to the | a list of strings   
|
|| setup script   | 
|

+++-+
-   | *options*  | default options for the setup  | a string
|
+   | *options*  | default options for the setup  | a dictionary
|
|| script | 
|

+++-+

--

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



[issue9302] distutils API Reference: setup() and Extension parameters' description not correct.

2011-06-16 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

 I would not read [str] as implying a list of strings, FWIW.

help() on distutils.extension.Extension gives the parameters description like 
this:
..
sources: [string]
..
include_dirs: [string]
..

So I guess this style can be used as somewhere.


 I’m in favor of using explicit “list of strings” wording now.  ysj.ray, I 
 understand from the “Done” comments on the review page that you have an 
 updated patch somewhere; please upload and I’ll commit.


Ok, here is it. Thanks!

--
Added file: http://bugs.python.org/file22391/issue_9302_2.diff

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



[issue11934] build with --prefix=/dev/null and zlib enabled in Modules/Setup failed

2011-06-15 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

Isn’t zlib built by setup.py anyway?


If can be build by Modules/Setup first as a builtin module, then the setup.py 
woun't build it.

--

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



[issue11874] argparse assertion failure with brackets in metavars

2011-04-29 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

Seem as a problem in optparse.HelpFormatter._format_usage(): when the generated 
usage string is too long(longer than 78, e.g.), python tries to break the usage 
string into parts at some proper positions and group them to multiple lines, 
then join the parts with space and assert it equal with original usage string. 
The regular expression used to break the usage string into parts is:
r'\(.*?\)+|\[.*?\]+|\S+'
So when there is '[]' in usage string, like in the example(there is '[]' in 
metavar), the assertion fails.

metavar=[LIB,]FBNAME seems quite reasonable and usable, in the case that one 
want to define an option who has tow values and the first is optional. So I 
suggest '[]' should be allowed in metavar, and the _format_usage() needs fixed.

Here is a patch that fixes by changing the way breaking the usage string to 
parts and remove joining the parts and assert it equal to original usage 
string. Now the usage string is broken into intact each action of group usage 
strings. I think this breaking granularity is enough.

--
keywords: +patch
nosy: +ysj.ray
Added file: http://bugs.python.org/file21832/issue_11874.diff

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



[issue11874] argparse assertion failure with brackets in metavars

2011-04-29 Thread ysj.ray

Changes by ysj.ray ysj@gmail.com:


--
components: +Library (Lib) -None

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



[issue11206] test_readline unconditionally calls clear_history()

2011-04-29 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

This seems has already been fixed in issue11496, should be closed.

--
nosy: +ysj.ray

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



[issue11934] build with --prefix=/dev/null and zlib enabled in Modules/Setup failed

2011-04-27 Thread ysj.ray

New submission from ysj.ray ysj@gmail.com:

The development guide(http://docs.python.org/devguide/setup.html) suggested 
that one can build with --prefix=/dev/null in order to avoid accidentally 
install it. But in the Modules/Setup.dist the zlib module is defined as:

zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz

So configure with --prefix=/dev/null  and enable zlib in Module/Setup and 
then make results in such error: (debian 5)

cc1: error: /dev/null/include: Not a directory


Not sure if this is really a problem. But I need to modify the Module/Setup 
zlib line to

zlib zlibmodule.c -L$(exec_prefix)/lib -lz

instead of just uncomment it to make my build process success. I think it's 
better to be improved.

--
components: Build
messages: 134544
nosy: ysj.ray
priority: normal
severity: normal
status: open
title: build with --prefix=/dev/null and zlib enabled in Modules/Setup failed
type: compile error
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

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



[issue9523] Improve dbm modules

2011-04-25 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

Sorry, previous patch(issue_9523_4.diff) missed a file(Lib/test/dbm_tests.py)
Here is an intact one.

--
Added file: http://bugs.python.org/file21769/issue_9523_5.diff

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



[issue11908] Weird `slice.stop or sys.maxint`

2011-04-25 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

`step` argument for xrange() could not be 0.

But `s.stop or sys.maxint` is really a problem, in the case of `s.stop == 0`.

So the given `Equivalent to` python code in the doc is not precisely equivalent 
to the c implementation. The doc needs a fix.

--
nosy: +ysj.ray

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



[issue11882] test_imaplib failed on x86 ubuntu

2011-04-25 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

Guess the problem is with time.mktime() and time.localtime(). Could you  debug 
into the Internaldate2Tuple() function and see at which step the time value(a 
time_struct or a float which represents seconds) is wrong?

--
nosy: +ysj.ray

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



[issue11785] email subpackages documentation problems

2011-04-17 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

Oh, sorry, I didn't differ :mod:, :module:, :currentmodule: clearly.

But shouldn't the modules link titles in 
http://docs.python.org/dev/library/email.html display correct module names 
instead just the email package name?
email: Representing character sets seems a little wearied.

--

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



[issue11777] Executor.map does not submit futures until iter.next() is called

2011-04-07 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

Got it. Seems the behavior is not consist with the Executor.map() function:

The returned iterator raises a TimeoutError if __next__() is called and the 
result isn't available after timeout seconds from ***the original call to 
map()***

--

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



[issue11785] email subpackages documentation problems

2011-04-06 Thread ysj.ray

New submission from ysj.ray ysj@gmail.com:

All the module name in the first line of email subpackages' documentation 
files(Doc/library/email.xxx.rst) are incorrect: all of them are email but not 
email.xxx

Besides, the Doc/library/email-examples.rst is not a module and it uses 
:mod:`email`: xxx

--
assignee: docs@python
components: Documentation
files: email_subpackages_document_problems.diff
keywords: patch
messages: 133143
nosy: docs@python, ysj.ray
priority: normal
severity: normal
status: open
title: email subpackages documentation problems
versions: Python 3.1, Python 3.2, Python 3.3
Added file: 
http://bugs.python.org/file21552/email_subpackages_document_problems.diff

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



[issue11785] email subpackages documentation problems

2011-04-06 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

And this causes the toctree in email 
doc(http://docs.python.org/dev/library/email.html) in correct. All of the tree 
elements' names are displayed as email.

--

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



[issue11747] unified_diff function product incorrect range information

2011-04-05 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

Since if one of the two comparing files is empty, gnu diff regards the 
beginning line of differences as line 0 (there is not any lines), but difflib 
regards it as line 1(there is a line, but empty). Not sure weather is correct 
since the practice usage of diff output is feeding it to patch program which 
determine the different line location mostly based on context identical lines 
instead of the line numbers in the hunk headers, so it doesn't matter weather 
it's line 0 or line 1. But it is still better to keep consist with gnu diff.

In context_diff() it is correct since if there is less then 2 different lines 
in a hunk, only ending line number is display in hunk header.

Here is a patch which fix this.

--
keywords: +patch
nosy: +ysj.ray
type:  - behavior
versions: +Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file21539/issue_11747.diff

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



[issue11764] inspect.getattr_static code execution w/ class body as non dict

2011-04-05 Thread ysj.ray

Changes by ysj.ray ysj@gmail.com:


--
nosy: +ysj.ray

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



[issue11605] EMail generator.flatten() disintegrates over non-ascii multipart/alternative

2011-04-05 Thread ysj.ray

Changes by ysj.ray ysj@gmail.com:


--
nosy: +ysj.ray

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



[issue11777] Executor.map does not submit futures until iter.next() is called

2011-04-05 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

Isn't this the supposed behavior?

--
nosy: +ysj.ray

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



[issue8070] Infinite loop in PyRun_InteractiveLoopFlags() if PyRun_InteractiveOneFlags() raises an error

2011-04-02 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

I'd prefer not exit program but try to use Py_FileSystemDefaultEncoding as enc 
when sys.stdin is invalid. On most cases, setting sys.stdin to some other 
invalid value does means the program could not continue running.

--

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



[issue8070] Infinite loop in PyRun_InteractiveLoopFlags() if PyRun_InteractiveOneFlags() raises an error

2011-04-02 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

 On most cases, setting sys.stdin to some other invalid value does means the 
 program could not continue running.


Sorry, it should be:

On most cases, setting sys.stdin to some other invalid value does not mean the 
program could not continue running.

--

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



[issue11739] Python doesn't have a 2011 april fools joke

2011-04-01 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

+1.  I was updating my hg clone all the time yesterday to see if there was 
anything interesting happened. But I was disappointed.

--
nosy: +ysj.ray

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



[issue11739] Python doesn't have a 2011 april fools joke

2011-04-01 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

 Perhaps 2012 will be extra special.


I'm afraid 2012 April Fool may be the last April Fool of the world.

--

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



[issue11740] difflib html diff takes extremely long

2011-04-01 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

Reproduced in 3.3

--
components: +Library (Lib) -None
nosy: +ysj.ray
versions: +Python 3.1, Python 3.2, Python 3.3

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



[issue11730] Setting sys.stdin to an invalid input stream causes interpreter run loop forever.

2011-03-31 Thread ysj.ray

New submission from ysj.ray ysj@gmail.com:

Setting sys.stdin to an invalid input stream under interactive mode causes 
interpreter run loop forever:

Python 3.3a0 (default:22ae2b002865+, Mar 30 2011, 21:17:03) 
[GCC 4.4.4] on linux2
Type help, copyright, credits or license for more information.
 import sys
[57804 refs]
 sys.stdin = None
[57809 refs]
[57809 refs]
[57809 refs]
[57809 refs]
[57809 refs]
..


Not only setting to None but also to any other invalid input stream could cause 
this. It's because in the beginning of PyRun_InteractiveOneFlags(), in order to 
get stdin encoding, the code tries to get sys.stdin and check if it's valid(not 
NULL, not None, has encoding attribute), if not, return -1 directly, then the 
loop in PyRun_InteractLoopFlags() continues and does the same thing. I think 
this should be fixed by using the Py_FileSystemDefaultEncoding instead when 
sys.stdin is invalid.

--
components: Interpreter Core
messages: 132678
nosy: ysj.ray
priority: normal
severity: normal
status: open
title: Setting sys.stdin to an invalid input stream causes interpreter run loop 
forever.
type: crash
versions: Python 3.1, Python 3.2, Python 3.3

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



[issue11647] function decorated with a context manager can only be invoked once

2011-03-30 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

Got it. Here is my updated patch. Not sure if the doc is proper.

--
Added file: http://bugs.python.org/file21475/issue_11647_2.diff

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



[issue11654] errors in atexit hooks don't change process exit code

2011-03-30 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

see #1257

--

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



[issue1257] atexit errors should result in nonzero exit code

2011-03-30 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

I think there is no need to implement this in python2.x since it's a  behavior 
change which could introduce some compatibility issues to someone's code, 
besides in 2.x both sys.exitfunc and atexit module should be considered, that 
makes the code looks complex. The sys.exitfunc is removed in 3.x.

+1 on only implementing it in 3.3.

--
nosy: +ysj.ray
versions: +Python 3.3

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



[issue11647] function decorated with a context manager can only be invoked once

2011-03-29 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

Here I worked out a patch to make the function decorated by context manager 
returned by @contextmanager reusable, by storing original function object and 
argments(args, kwds objects) in _GeneratorContextManager and construct a 
generator when needed(in self.__enter__ while used as a context manager and 
self.__call__ while used as a decorator). It still inherit ContextDecorator to 
keep class inheritation complete and the __call__ method is override.

--
keywords: +patch
Added file: http://bugs.python.org/file21449/issue_11647.diff

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



[issue11647] function decorated with a context manager can only be invoked once

2011-03-29 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

 For 3.3, the fix could be generalised with ContextDecorator supporting a 
 documented self._recreate internal interface that, by default, just returns 
 self, but would be overridden in _GeneratorContextManager to actually create 
 a new instance. The custom __call__ implementation for 
 _GeneratorContextManager could then be removed.

How about directly using the existing copy.copy() semantics instead of 
self._recreate()? That is, call with copy.copy(self) instead of with self 
in ContextGenerator.__call__(), implement ContextGenerator.__copy__() method to 
simply return self, and implement  _GeneratorContextManager.__copy__() to 
create a copy of itself. This saves an internal interface.

--

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



[issue11647] function decorated with a context manager can only be invoked once

2011-03-28 Thread ysj.ray

ysj.ray ysj@gmail.com added the comment:

Now I found that I am wrong and I feel OK with make the context manager  
reusable when used as a decorator. I missed one thing: the reusable behavior is 
regarded as in the decorated function but not in the decorator context manager. 
:)

--

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