Re: [Python-Dev] Adventures with x64, VS7 and VS8 on Windows

2007-05-26 Thread Kristján Valur Jónsson


> -Original Message-
> From: "Martin v. Löwis" [mailto:[EMAIL PROTECTED]
>
> It doesn't need to, and reluctance is not wrt. to the proposed new
> layout, but wrt. changing the current one. Tons of infrastructure
> depends on the files having exactly the names that they have now,
> and being located in exactly the locations where they are currently
> located. Any change to that, whatever minor, will cause problems
> to some people.

Just to be absolutely clear:  You are talking about the build environment,
right?  Because I am not proposing to change any layout of the
installed Python (wherever that may be :)

I am baffled about why the build environment's layout matters,
but once an .msi install can place the binaries in any
old place it wants.  The build structure doesn't have to
reflect the final installed structure at all.

Kristján
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Adventures with x64, VS7 and VS8 on Windows

2007-05-26 Thread Kristján Valur Jónsson

> -Original Message-
> From: Alexey Borzenkov [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, May 23, 2007 20:36
> To: Kristján Valur Jónsson
> Cc: Martin v. Löwis; Mark Hammond; [EMAIL PROTECTED]; python-
> [EMAIL PROTECTED]
> Subject: Re: [Python-Dev] Adventures with x64, VS7 and VS8 on Windows
>
> On 5/23/07, Kristján Valur Jónsson <[EMAIL PROTECTED]> wrote:
> > > > Install in the ProgramFiles folder.
> > > Only over my dead body. *This* is silly.
> > Bill doesn't think so.  And he gets to decide.  I mean we do want
> > to play nice, don't we?  Nothing installs itself in the root anymore,
> > not since windows 3.1
>
> Maybe installing in the root is not good, but installing to "Program
> Files" is just asking for trouble. All sorts of development tools
> might suddenly break because of that space in the middle of the path
> and requirement to use quotes around it. I thus usually install things
> to :\Programs. I'm not sure if any packages/programs will break
> because of that space, but what if some will?

Development tools used on windows already have to cope with this.
Spaces are not going away, so why not bite the bullet and deal
with them?  Moving forward sometimes means crossing rivers.

As for Vista issues, I'll gather more data before making any more
claims, but I think that it is important that we play by the rules
here.
Just imagine the a school teacher who in good faith wants to introduce
his pupils to the wonderful programming language of Python, but
when he installs it, all kinds of scary looking warnings drive him off.
Vista is, like it or not, going to be very prevalent.  If we want python
to be easily accessible to the masses, we mustn't take an elitist
attitude or else risk scaring people off.

Finally, to add a (mis)quote from Mr. Gorbachev:
"Wer zu spät kommt, den bestraft das Leben"

Kristján
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Adventures with x64, VS7 and VS8 on Windows

2007-05-26 Thread Kristján Valur Jónsson


> -Original Message-
>
> I personally think that if hostile users can replace DLLs on your
> system, you have bigger problems than SxS installation of
> pythhonxy.dll,
> but perhaps that's just me.
An end user application on an end-user's machine is always voulnerable
to reverse engineering.  But it helps to make it more difficult.
The old-style dll loader is a particular vulnerability which makes
it easy to patch into an application at load time.

> >> What about the registry?
> > I don't know about the registry, what is it used for?
>
> For two things, with different importance to different users:
> 1. File extensions are registered there, e.g. .py and .pyc.
>With two binaries installed, the will stomp over each other's
>file associations; only one of them can win.
Sure.  No argument about this.  But as with the explorer and other apps,
it is perfectly possible to manually start one or the other, autoclicking
on .py files isn't the only option.

> 2. Python installs keys under
>HL{LM|CU}\Software\Python\PythonCore\, namely
>InstallPath
>InstallGroup
>PythonPath
>Documentation
>Modules
>
Funnily enough, Bill has thought of this too.  See 
http://support.microsoft.com/kb/305097/
for info.  Co-existence of 32 and 64 bit apps is supported.

>
> The two versions of MSIE actually *are* a big problem, that's
> why MS only runs the 32-bit IE, even on Win64 (otherwise, ActiveX
> controls downloaded from the net wouldn't work).
>
> Also, while they are both shipped, you can't the two versions of
> explorer.exe simultaneously (without trickery), so its far from
> simple.
The two versions aren't the problem, it is the backward support for
32 bit active thingies that are, as you point out.  There is confusion here:
internet explorer shipped in both versions.  The 32 bit version war default
for the above reason.  But explorer.exe (which I was talking about) also
had two versions.  The 64 bit version ran by default.
You may recall that before tortoise shipped a 64 bit version, one had to
kill explorer.exe and restart it (explorer32.exe IIRC) to get tortoise
to work.

Supporting both kinds (country and western) on the same machine might be helpful
to people for this very reason.  A lot of legacy modules are only avaible
in 32 bit mode.  But people may want to do contemporary development using the
new 64 bit mode.

Cheers,

Kristján
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] vs2005 Project Patch and Configuration Inquiry

2007-05-26 Thread Joseph Armbruster

All,

As per the removal of the rgbimgmodule due to deprecation in the trunk:

http://svn.python.org/projects/python/trunk

---Begin SVN log---
r55458 | brett.cannon | 2007-05-20 03:09:50 -0400 (Sun, 20 May 2007) | 2 
lines


Remove the rgbimg module.  It has been deprecated since Python 2.5.
---End SVN log---


The PCbuild8 solution needs to be corrected.  A patch is attached.

In addition, I noticed that under C++/Advanced Properties, all the 
configurations appear to be set to "Compile as C++ Code" with the /TP 
argument.  Should these be set to "Compile as C Code" with the /TC argument?



Joseph Armbruster
Index: PCbuild8/pythoncore/pythoncore.vcproj
===
--- PCbuild8/pythoncore/pythoncore.vcproj   (revision 55600)
+++ PCbuild8/pythoncore/pythoncore.vcproj   (working copy)
@@ -1518,10 +1518,6 @@
>


-   
-   

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] The docs, reloaded

2007-05-26 Thread Alexandre Vassalotti
On 5/19/07, Georg Brandl <[EMAIL PROTECTED]> wrote:
> over the last few weeks I've hacked on a new approach to Python's 
> documentation.
> As Python already has an excellent documentation framework, the docutils, 
> with a
> readable yet extendable markup format, reST, I thought that it should be
> possible to use those instead of the current LaTeX->latex2html toolchain.
>
> For the impatient: the result can be seen at .
>
[SNIP]
> Waiting for comments!

Here a small suggestion, move the sidebar to the right. Moving it to
the right makes it much less intrusive. See that by yourself:
http://peadrop.com/files/pydoc-sidebar-right.png

div.body {
   background-color:white;
   margin:0pt 190pt 0pt 0px;
}
div.sidebar {
   float:right;
   margin-left:-100%;
   width:230px;
}

Keep up the great work,
-- Alexandre
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Adventures with x64, VS7 and VS8 on Windows

2007-05-26 Thread Tony Nelson
At 12:20 PM + 5/26/07, Kristján Valur Jónsson wrote:
>> -Original Message-
>> From: Alexey Borzenkov [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, May 23, 2007 20:36
>> To: Kristján Valur Jónsson
>> Cc: Martin v. Löwis; Mark Hammond; [EMAIL PROTECTED]; python-
>> [EMAIL PROTECTED]
>> Subject: Re: [Python-Dev] Adventures with x64, VS7 and VS8 on Windows
>>
>> On 5/23/07, Kristján Valur Jónsson <[EMAIL PROTECTED]> wrote:
>> > > > Install in the ProgramFiles folder.
>> > > Only over my dead body. *This* is silly.
>> > Bill doesn't think so.  And he gets to decide.  I mean we do want
>> > to play nice, don't we?  Nothing installs itself in the root anymore,
>> > not since windows 3.1
>>
>> Maybe installing in the root is not good, but installing to "Program
>> Files" is just asking for trouble. All sorts of development tools
>> might suddenly break because of that space in the middle of the path
>> and requirement to use quotes around it. I thus usually install things
>> to :\Programs. I'm not sure if any packages/programs will break
>> because of that space, but what if some will?
>
>Development tools used on windows already have to cope with this.
>Spaces are not going away, so why not bite the bullet and deal
>with them?  Moving forward sometimes means crossing rivers.
 ...

Microsoft's command line cannot cope with two pathnames that must be
quoted, so if the command path itself must be quoted, then no argument to
the command can be quoted.  There are tricky hacks that can work around
this mind-boggling stupidity, but life is simpler if Python itself doesn't
use up the one quoted pathname.  I don't know if Microsoft has had the good
sense to fix this in Vista (which I probably will never use, since an
alternative exists), but they didn't in XP.
-- 

TonyN.:'   
  '  
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] vs2005 Project Patch and Configuration Inquiry

2007-05-26 Thread Kristján Valur Jónsson


> -Original Message-
> From: [EMAIL PROTECTED]
> The PCbuild8 solution needs to be corrected.  A patch is attached.
>
Thanks, I'll apply it.

> In addition, I noticed that under C++/Advanced Properties, all the
> configurations appear to be set to "Compile as C++ Code" with the /TP
> argument.  Should these be set to "Compile as C Code" with the /TC
> argument?

Interesting. I hadn't noticed.  I investigated, and this is the default
value for all projects.  However, if you click a single .c file and
check its properties, you will find that it gets the /TC flag in its
advanced settings.  So each file will be correctly compiled. (you can
confirm this by checking the command line).  Removing the /TP flag from
the project settings also results in the disappearance of the per-file
/TC setting.
Very curious.  In end effect, the C files are compiled as such and there
is no need for panic.

Cheers,
Kristján
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] vs2005 Project Patch and Configuration Inquiry

2007-05-26 Thread Joseph Armbruster

Kristján,

I started to investigate the WINVER warnings that are scattered 
throughout the VS 2005 build.  This patch eliminates them but I may have 
overlooked the intentions of the #include ordering.  If this invalid, 
please let me know.


Patch attached.

Joseph Armbruster


Kristján Valur Jónsson wrote:



-Original Message-
From: [EMAIL PROTECTED]
The PCbuild8 solution needs to be corrected.  A patch is attached.


Thanks, I'll apply it.


In addition, I noticed that under C++/Advanced Properties, all the
configurations appear to be set to "Compile as C++ Code" with the /TP
argument.  Should these be set to "Compile as C Code" with the /TC
argument?


Interesting. I hadn't noticed.  I investigated, and this is the default
value for all projects.  However, if you click a single .c file and
check its properties, you will find that it gets the /TC flag in its
advanced settings.  So each file will be correctly compiled. (you can
confirm this by checking the command line).  Removing the /TP flag from
the project settings also results in the disappearance of the per-file
/TC setting.
Very curious.  In end effect, the C files are compiled as such and there
is no need for panic.

Cheers,
Kristján



Index: PC/_winreg.c
===
--- PC/_winreg.c(revision 55600)
+++ PC/_winreg.c(working copy)
@@ -11,9 +11,8 @@
 basic Unicode support added.
 
 */
-
-#include "windows.h"
 #include "Python.h"
+#include "windows.h"
 #include "structmember.h"
 #include "malloc.h" /* for alloca */
 
Index: PC/dl_nt.c
===
--- PC/dl_nt.c  (revision 55600)
+++ PC/dl_nt.c  (working copy)
@@ -7,12 +7,12 @@
 forgotten) from the programmer.
 
 */
-#include "windows.h"
 
+
 /* NT and Python share these */
 #include "pyconfig.h"
 #include "Python.h"
-
+#include "windows.h"
 char dllVersionBuffer[16] = ""; // a private buffer
 
 // Python Globals
Index: Python/dynload_win.c
===
--- Python/dynload_win.c(revision 55600)
+++ Python/dynload_win.c(working copy)
@@ -1,13 +1,12 @@
 
 /* Support for dynamic loading of extension modules */
-
+#include "Python.h"
 #include 
 #ifdef HAVE_DIRECT_H
 #include 
 #endif
 #include 
 
-#include "Python.h"
 #include "importdl.h"
 
 const struct filedescr _PyImport_DynLoadFiletab[] = {
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] whitespace normalization pre-commit hook is giving me grief

2007-05-26 Thread Brett Cannon

On 5/25/07, Neal Norwitz <[EMAIL PROTECTED]> wrote:


On 5/25/07, Brett Cannon <[EMAIL PROTECTED]> wrote:
> In my bcannon-objcap branch I am trying to check in a change that
involves a
> soft symlink from Lib/controlled_importlib.py to
> ../importlib/controlled_importlib.py through ``ln -s
> ../controlled_importlib.py controlled_importlib.py`` while in the Lib
> directory.  I have done this before in this branch so as to allow for
easy
> importing of code from the svn import of importlib that the branch
contains.

I don't know that we've ever tested the commit hook with a link.
Maybe there is some other problem.

Have you tried running reindent on the actual file (not the symlink)?




Yes.


Can somebody help me figure out what the hell is going on?  I am waiting
to
> find out it is something small and stupid, but at this point I am not
seeing
> a solution to this.

Can you check in a smaller part of the change (like leaving out the
symlink)?  That will at least allow you to make progress.




Already did that.


You can send me the file if you want.  I can try to look at it and see

if there are any problems.



Looks like Georg knows the issue.

-Brett
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] whitespace normalization pre-commit hook is giving me grief

2007-05-26 Thread Brett Cannon

On 5/25/07, Georg Brandl <[EMAIL PROTECTED]> wrote:


Neal Norwitz schrieb:
> On 5/25/07, Brett Cannon <[EMAIL PROTECTED]> wrote:
>> In my bcannon-objcap branch I am trying to check in a change that
involves a
>> soft symlink from Lib/controlled_importlib.py to
>> ../importlib/controlled_importlib.py through ``ln -s
>> ../controlled_importlib.py controlled_importlib.py`` while in the Lib
>> directory.  I have done this before in this branch so as to allow for
easy
>> importing of code from the svn import of importlib that the branch
contains.
>
> I don't know that we've ever tested the commit hook with a link.
> Maybe there is some other problem.

The cause: For symlinks, SVN saves a file containing "link /target" and
sets
the "svn:special" property. Since the special file doesn't end with a
newline,
reindent adds that, and boom.

The solution: add
 if fs.node_prop(txn_root, path, 'svn:special') == '*': continue

in the commit hook's for loop.




Great!  So can someone do this?  I don't know where the svn hook code is
stored, let alone whether I have access to commit a change.

-Brett
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Minor ConfigParser Change

2007-05-26 Thread Joseph Armbruster

Kristján,

While we are on the topic of minor changes... :-)

I noticed that one of the parts of ConfigParser was not using "for line 
in fp" style of readline-ing :-)  So, this will reduce the SLOC by 3 
lines and improve readability.  However, I did a quick grep and this 
type of practice appears in several other places.


There is a possibility of good savings in this department.  If you think 
this is worthwhile, I can create one large patch for them all.


I sure hope I am not missing something fundamental with this one...

Joseph Armbruster
Index: Lib/ConfigParser.py
===
--- Lib/ConfigParser.py (revision 55600)
+++ Lib/ConfigParser.py (working copy)
@@ -441,10 +441,7 @@
 optname = None
 lineno = 0
 e = None  # None, or an exception
-while True:
-line = fp.readline()
-if not line:
-break
+for line in fp:
 lineno = lineno + 1
 # comment or blank line?
 if line.strip() == '' or line[0] in '#;':
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] whitespace normalization pre-commit hook is giving me grief

2007-05-26 Thread Neal Norwitz
On 5/26/07, Brett Cannon <[EMAIL PROTECTED]> wrote:
>
>
> On 5/25/07, Georg Brandl <[EMAIL PROTECTED]> wrote:
> > Neal Norwitz schrieb:
> > > On 5/25/07, Brett Cannon <[EMAIL PROTECTED]> wrote:
> > >> In my bcannon-objcap branch I am trying to check in a change that
> involves a
> > >> soft symlink from Lib/controlled_importlib.py to
> > >> ../importlib/controlled_importlib.py through ``ln -s
> > >> ../controlled_importlib.py controlled_importlib.py`` while in the Lib
> > >> directory.  I have done this before in this branch so as to allow for
> easy
> > >> importing of code from the svn import of importlib that the branch
> contains.
> > >
> > > I don't know that we've ever tested the commit hook with a link.
> > > Maybe there is some other problem.
> >
> > The cause: For symlinks, SVN saves a file containing "link /target" and
> sets
> > the "svn:special" property. Since the special file doesn't end with a
> newline,
> > reindent adds that, and boom.
> >
> > The solution: add
> >  if fs.node_prop(txn_root, path, 'svn:special') == '*': continue
> >
> > in the commit hook's for loop.
>
>
> Great!  So can someone do this?  I don't know where the svn hook code is
> stored, let alone whether I have access to commit a change.

I made the change Georg suggested, give it a try.

n
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] The docs, reloaded

2007-05-26 Thread Georg Brandl
Hi,

We managed to get an up to date version of the web version of the docs running
on the server. The address is still the same (http://pydoc.gbrandl.de:3000) and
it's also still running on top of wsgiref.

Changes so far:
   * comments: each page that is generated from an rst file can have some
 comments attached to it. Commenting doesn't require registration at the
 moment.
   * antispam with optional reverse captcha (captcha for bots, a hidden input
 field named "homepage" which bots hopefully fill out, dumb as they are) and
 a regular expression filter rules based on MoinMoin's BadContent file.
   * administration panel for moderating comments. You can find the admin panel
 at http://pydoc.gbrandl.de:3000/admin/ -- login credentials are
 testuser:password)
   * feeds for comments on a page or the last n comments on the whole site.
   * source view is text only (again).

What still works:
   * intelligent error pages: if a page does not exist the URL path is used to
 conduct a fuzzy keyword search (see below).
   * fuzzy keyword search: "os.path.exists" jumps to the entry, "os.paht.exists"
 shows some possibilities.

What needs to be implemented:
   * full text search
   * proposing documentation patches

Note that the comment area is really, really dark, that's intentional.  This is
meant to visually separate comments from the official docs, but if the constrast
is deemed to unsettling, another way can be found.

Also, we're experimenting with alternate stylesheets, e.g. placing the sidebar
on the right of the main text, or a "traditional" style for those liking the
original docs' style.

In any case, we're waiting for your input!

cheers,
Georg and Armin


-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Minor ConfigParser Change

2007-05-26 Thread Joseph Armbruster

Kristján,

Here is a part of the patch that I was referring to.  Something to that 
effect.


Joseph Armbruster
Index: Lib/ConfigParser.py
===
--- Lib/ConfigParser.py (revision 55600)
+++ Lib/ConfigParser.py (working copy)
@@ -441,10 +441,7 @@
 optname = None
 lineno = 0
 e = None  # None, or an exception
-while True:
-line = fp.readline()
-if not line:
-break
+for line in fp:
 lineno = lineno + 1
 # comment or blank line?
 if line.strip() == '' or line[0] in '#;':
Index: Lib/distutils/sysconfig.py
===
--- Lib/distutils/sysconfig.py  (revision 55600)
+++ Lib/distutils/sysconfig.py  (working copy)
@@ -216,10 +216,7 @@
 define_rx = re.compile("#define ([A-Z][A-Za-z0-9_]+) (.*)\n")
 undef_rx = re.compile("/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/\n")
 #
-while 1:
-line = fp.readline()
-if not line:
-break
+for line in fp:
 m = define_rx.match(line)
 if m:
 n, v = m.group(1, 2)
@@ -254,10 +251,7 @@
 done = {}
 notdone = {}
 
-while 1:
-line = fp.readline()
-if line is None:# eof
-break
+for line in fp:
 m = _variable_rx.match(line)
 if m:
 n, v = m.group(1, 2)
Index: Lib/formatter.py
===
--- Lib/formatter.py(revision 55600)
+++ Lib/formatter.py(working copy)
@@ -432,10 +432,7 @@
 fp = open(sys.argv[1])
 else:
 fp = sys.stdin
-while 1:
-line = fp.readline()
-if not line:
-break
+for line in fp:
 if line == '\n':
 f.end_paragraph(1)
 else:
Index: Lib/ftplib.py
===
--- Lib/ftplib.py   (revision 55600)
+++ Lib/ftplib.py   (working copy)
@@ -435,9 +435,7 @@
 '''Store a file in line mode.'''
 self.voidcmd('TYPE A')
 conn = self.transfercmd(cmd)
-while 1:
-buf = fp.readline()
-if not buf: break
+   for buff in fp:
 if buf[-2:] != CRLF:
 if buf[-1] in CRLF: buf = buf[:-1]
 buf = buf + CRLF
Index: Lib/keyword.py
===
--- Lib/keyword.py  (revision 55600)
+++ Lib/keyword.py  (working copy)
@@ -62,9 +62,7 @@
 fp = open(iptfile)
 strprog = re.compile('"([^"]+)"')
 lines = []
-while 1:
-line = fp.readline()
-if not line: break
+for line in fp:
 if '{1, "' in line:
 match = strprog.search(line)
 if match:
Index: Lib/mimetypes.py
===
--- Lib/mimetypes.py(revision 55600)
+++ Lib/mimetypes.py(working copy)
@@ -204,10 +204,7 @@
 list of standard types, else to the list of non-standard
 types.
 """
-while 1:
-line = fp.readline()
-if not line:
-break
+for line in fp:
 words = line.split()
 for i in range(len(words)):
 if words[i][0] == '#':
Index: Lib/urlparse.py
===
--- Lib/urlparse.py (revision 55600)
+++ Lib/urlparse.py (working copy)
@@ -353,9 +353,7 @@
 except ImportError:
 from StringIO import StringIO
 fp = StringIO(test_input)
-while 1:
-line = fp.readline()
-if not line: break
+   for line in fp:
 words = line.split()
 if not words:
 continue
Index: Tools/pynche/ColorDB.py
===
--- Tools/pynche/ColorDB.py (revision 55600)
+++ Tools/pynche/ColorDB.py (working copy)
@@ -50,10 +50,7 @@
 self.__byname = {}
 # all unique names (non-aliases).  built-on demand
 self.__allnames = None
-while 1:
-line = fp.readline()
-if not line:
-break
+   for line in fp:
 # get this compiled regular expression from derived class
 mo = self._re.match(line)
 if not mo:
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Minor ConfigParser Change

2007-05-26 Thread Kristján Valur Jónsson


> -Original Message-
> From: Joseph Armbruster [mailto:[EMAIL PROTECTED]
>
> I noticed that one of the parts of ConfigParser was not using "for line
> in fp" style of readline-ing

I'm afraid my authority is limited to .c stuff having to do with pcbuild8,
but I'm sure someone else here would like to comment.

Kristján
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Minor ConfigParser Change

2007-05-26 Thread Joseph Armbruster
Kristján,

Whoops!  My apologies.  In any case, I created the bugs in the sf issue 
tracker for proper CM practice.  Look under the patches section within 
sf.net.

You should go ahead and close out the 2005 build ones then, once applied :-)


Thank you again,

Joseph Armbruster


Kristján Valur Jónsson wrote:
> 
>> -Original Message-
>> From: Joseph Armbruster [mailto:[EMAIL PROTECTED]
>>
>> I noticed that one of the parts of ConfigParser was not using "for line
>> in fp" style of readline-ing
> 
> I'm afraid my authority is limited to .c stuff having to do with pcbuild8,
> but I'm sure someone else here would like to comment.
> 
> Kristján
> 

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] The docs, reloaded

2007-05-26 Thread Ron Adam
Georg Brandl wrote:
> Hi,
> 
> We managed to get an up to date version of the web version of the docs running
> on the server. The address is still the same (http://pydoc.gbrandl.de:3000) 
> and
> it's also still running on top of wsgiref.
> 
> Changes so far:
>* comments: each page that is generated from an rst file can have some
>  comments attached to it. Commenting doesn't require registration at the
>  moment.
>* antispam with optional reverse captcha (captcha for bots, a hidden input
>  field named "homepage" which bots hopefully fill out, dumb as they are) 
> and
>  a regular expression filter rules based on MoinMoin's BadContent file.
>* administration panel for moderating comments. You can find the admin 
> panel
>  at http://pydoc.gbrandl.de:3000/admin/ -- login credentials are
>  testuser:password)
>* feeds for comments on a page or the last n comments on the whole site.
>* source view is text only (again).
> 
> What still works:
>* intelligent error pages: if a page does not exist the URL path is used to
>  conduct a fuzzy keyword search (see below).
>* fuzzy keyword search: "os.path.exists" jumps to the entry, 
> "os.paht.exists"
>  shows some possibilities.
> 
> What needs to be implemented:
>* full text search
>* proposing documentation patches
> 
> Note that the comment area is really, really dark, that's intentional.  This 
> is
> meant to visually separate comments from the official docs, but if the 
> constrast
> is deemed to unsettling, another way can be found.
> 
> Also, we're experimenting with alternate stylesheets, e.g. placing the sidebar
> on the right of the main text, or a "traditional" style for those liking the
> original docs' style.
> 
> In any case, we're waiting for your input!
> 
> cheers,
> Georg and Armin

Yes, the comments are a bit too dark.  The separation could be done better 
by moving it below the footer.  Or better yet, duplicate the navigation bar 
between the the document page and the comments.


   
   crumbsnavagation
   
 side |main page
 bar  |
  |
  |
   
   crumbsnavagation
   
   User Comment section


   
copy right
   


The user comment section could have it's own side bar if that's desirable.

Also the python version information needs to be on every page someplace.


Ron
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Unable to commit

2007-05-26 Thread Peter Åstrand

I'm unable to commit tonight:

SendingDoc/lib/libsubprocess.tex
SendingLib/subprocess.py
SendingLib/test/test_subprocess.py
Transmitting file data ...svn: Commit failed (details follow):
svn: 'pre-commit' hook failed with error output:
Traceback (most recent call last):
  File "/data/repos/projects/hooks/checkwhitespace.py", line 50, in ?
run_app(main)
  File "/usr/lib/python2.3/site-packages/svn/core.py", line 33, in run_app
return apply(func, (pool,) + args, kw)
  File "/data/repos/projects/hooks/checkwhitespace.py", line 32, in main
if fs.node_prop(txn_root, path, 'svn:special') == '*': continue
TypeError: svn_fs_node_prop() takes exactly 4 arguments (3 given)

Any ideas?

(CC me, I'm not on the list.)

Regards, 
---
Peter Åstrand   ThinLinc Chief Developer
Cendio AB   http://www.cendio.se
Wallenbergs gata 4
583 30 LinköpingPhone: +46-13-21 46 00___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Unable to commit

2007-05-26 Thread Neal Norwitz
On 5/26/07, Peter Åstrand <[EMAIL PROTECTED]> wrote:
>
> I'm unable to commit tonight:
>
> SendingDoc/lib/libsubprocess.tex
> SendingLib/subprocess.py
> SendingLib/test/test_subprocess.py
> Transmitting file data ...svn: Commit failed (details follow):
> svn: 'pre-commit' hook failed with error output:
> Traceback (most recent call last):
>   File "/data/repos/projects/hooks/checkwhitespace.py", line 50, in ?
> run_app(main)
>   File "/usr/lib/python2.3/site-packages/svn/core.py", line 33, in run_app
> return apply(func, (pool,) + args, kw)
>   File "/data/repos/projects/hooks/checkwhitespace.py", line 32, in main
> if fs.node_prop(txn_root, path, 'svn:special') == '*': continue
> TypeError: svn_fs_node_prop() takes exactly 4 arguments (3 given)
>
> Any ideas?

I tried to fix it so you can check in links, but that didn't work.  I
commented out the change, so you should be able to commit again.

n
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Unable to commit

2007-05-26 Thread Georg Brandl
Neal Norwitz schrieb:
> On 5/26/07, Peter Åstrand <[EMAIL PROTECTED]> wrote:
>>
>> I'm unable to commit tonight:
>>
>> SendingDoc/lib/libsubprocess.tex
>> SendingLib/subprocess.py
>> SendingLib/test/test_subprocess.py
>> Transmitting file data ...svn: Commit failed (details follow):
>> svn: 'pre-commit' hook failed with error output:
>> Traceback (most recent call last):
>>   File "/data/repos/projects/hooks/checkwhitespace.py", line 50, in ?
>> run_app(main)
>>   File "/usr/lib/python2.3/site-packages/svn/core.py", line 33, in run_app
>> return apply(func, (pool,) + args, kw)
>>   File "/data/repos/projects/hooks/checkwhitespace.py", line 32, in main
>> if fs.node_prop(txn_root, path, 'svn:special') == '*': continue
>> TypeError: svn_fs_node_prop() takes exactly 4 arguments (3 given)
>>
>> Any ideas?
> 
> I tried to fix it so you can check in links, but that didn't work.  I
> commented out the change, so you should be able to commit again.

Odd... the call worked here (SVN 1.4.3). Which version is the server using?

Georg


-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] whitespace normalization pre-commit hook is giving me grief

2007-05-26 Thread Brett Cannon

On 5/26/07, Neal Norwitz <[EMAIL PROTECTED]> wrote:


On 5/26/07, Brett Cannon <[EMAIL PROTECTED]> wrote:
>
>
> On 5/25/07, Georg Brandl <[EMAIL PROTECTED]> wrote:
> > Neal Norwitz schrieb:
> > > On 5/25/07, Brett Cannon <[EMAIL PROTECTED]> wrote:
> > >> In my bcannon-objcap branch I am trying to check in a change that
> involves a
> > >> soft symlink from Lib/controlled_importlib.py to
> > >> ../importlib/controlled_importlib.py through ``ln -s
> > >> ../controlled_importlib.py controlled_importlib.py`` while in the
Lib
> > >> directory.  I have done this before in this branch so as to allow
for
> easy
> > >> importing of code from the svn import of importlib that the branch
> contains.
> > >
> > > I don't know that we've ever tested the commit hook with a link.
> > > Maybe there is some other problem.
> >
> > The cause: For symlinks, SVN saves a file containing "link /target"
and
> sets
> > the "svn:special" property. Since the special file doesn't end with a
> newline,
> > reindent adds that, and boom.
> >
> > The solution: add
> >  if fs.node_prop(txn_root, path, 'svn:special') == '*': continue
> >
> > in the commit hook's for loop.
>
>
> Great!  So can someone do this?  I don't know where the svn hook code is
> stored, let alone whether I have access to commit a change.

I made the change Georg suggested, give it a try.




Still failing.  I checked the added file for svn:special and it's set with
an '*' just like my other symlink.  And I double-checked the file by running
``python Tools/scripts/reindent.py -v Lib/controlled_importlib.py``  and it
said nothing had changed.

-Brett
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Unable to commit

2007-05-26 Thread Neal Norwitz
 On 5/26/07, Georg Brandl <[EMAIL PROTECTED]> wrote:
> >
> > I tried to fix it so you can check in links, but that didn't work.  I
> > commented out the change, so you should be able to commit again.
>
> Odd... the call worked here (SVN 1.4.3). Which version is the server using?

I don't know.  After some Googling, I found that the call might need to be:

if fs.node_prop(txn_root, path, SVN_PROP_MIME_TYPE,
'svn:special') == '*': continue

That's a pretty blind guess based on the error message and other
random code that I could find.  The line above is commented out right
now.  If I remember and feel like it, I'll try to test this out.

n
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Summary of Tracker Issues

2007-05-26 Thread Tracker

ACTIVITY SUMMARY (05/20/07 - 05/27/07)
Tracker at http://bugs.python.org/

To view or respond to any of the issues listed below, click on the issue 
number.  Do NOT respond to this message.


 1649 open ( +0) /  8584 closed ( +0) / 10233 total ( +0)

Average duration of open issues: 806 days.
Median duration of open issues: 757 days.

Open Issues Breakdown
   open  1649 ( +0)
pending 0 ( +0)

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com