[issue11252] Handling statement OR assignment continuation '\' on Win32 platform

2011-02-24 Thread Suresh Kalkunte

Suresh Kalkunte sskalku...@gmail.com added the comment:

Thanks for the education (hopefully a slight detour for you 8-). I included '/' 
to convey uniform behavior across platforms.

I will take it that the difference in what os.path.split() returns on Win32 vs. 
Linux is not a bug in Python since its Win32 users have come to expect the 
response it gives ? if yes, please point me to a resource (i.e, if you are 
aware, else do not bother 8-) that identifies such other conundrums.

--

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



[issue11252] Handling statement OR assignment continuation '\' on Win32 platform

2011-02-23 Thread Łukasz Langa

Łukasz Langa luk...@langa.pl added the comment:

OK, now I know more about glob than I ever wanted to! :) Basically it comes 
down to this:

unix os.path.split('\\')
('', '\\')

win32 os.path.split('\\')
('\\', '')

This is why \ is recognized as the root directory on Win32 and as a 
non-existent file on Unix.

In case of / both Unix and Win32 treat it as a valid directory separator so 
`os.path.split('/')` returns `('/', '')`. This is why / is recognized as the 
root directory on both systems.

Does this answer your questions?

--

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



[issue11252] Handling statement OR assignment continuation '\' on Win32 platform

2011-02-21 Thread Łukasz Langa

Łukasz Langa luk...@langa.pl added the comment:

Unfortunately the bug is not in ConfigParser but rather in your gen-build.py. 
There is nothing special about backslashes and ConfigParser reads them in as 
part of the value for ldap/paths.

But then look what happens in gen-build.py:215. The `split()` returns

['ldap/apr_ldap_init.c', '\\', 'ldap/apr_ldap_option.c', '\\', 
'ldap/apr_ldap_rebind.c']

and later on the `map()` in line 216 adds new elements to the list. However, on 
Linux `glob.glob('\\')` == `[]` so nothing is actually added. OTOH on Windows 
`glob.glob('\\')` == `['\\']`. This behaviour is correct. As a side note, the 
assert actually fails on '/' (thanks to `clean_path`).

So, the easiest fix for you is to get rid of the backslashes from the 
configuration file. They work on Linux by mere coincidence.

--
status: open - closed

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



[issue11252] Handling statement OR assignment continuation '\' on Win32 platform

2011-02-21 Thread Suresh Kalkunte

Suresh Kalkunte sskalku...@gmail.com added the comment:

lukasz.langa, confirming the difference in return values for glob.glob() on 
Win32/Cygwin vs. Linux as the following results show:


F1()
ret_val1
 F2(ret_val1)
ret_val2

--
\\\
Cygwin
///
--
string.split() 
/
 glob.glob('/')
['/']

string.split()
\
 glob.glob('\')
['\\']

--
\\\
Win32
///
--
string.split()
/
 glob.glob('/')
['/']

string.split()
\
 glob.glob('\')
['\\']

--
\\\
Linux
///
--
string.split()
/
 glob.glob('/')
['/']

string.split()
\
 glob.glob('\')
[]

For my education, is there a reason why glob.glob('\') on Win32/Cygwin returns 
['\\'] instead of [] in Linux ?

--

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



[issue11252] Handling statement OR assignment continuation '\' on Win32 platform

2011-02-20 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Why do you think this is a bug in Python as opposed to one in the script 
parsing the .conf file?

--
nosy: +georg.brandl
resolution:  - invalid
status: open - pending

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



[issue11252] Handling statement OR assignment continuation '\' on Win32 platform

2011-02-20 Thread Suresh Kalkunte

Suresh Kalkunte sskalku...@gmail.com added the comment:

If the defect was with the script, the failure to bypass the '\' notation would 
have to be true on Redhat Linux. Since build.conf with '\' notation gets parsed 
without errors on Redhat Linux, I am under the impression the parsing performed 
by Python on Win32 recognizes '\' as a legitimate file token resulting in the 
script to fail.

In summary, I view semantics of '\' being different in Win32 vs. Linux as an 
inconsistency and hence thought it to be a possible defect in Python. However, 
if Python scripts do not guarantee platform independence, i.e, one's scripts 
need to be cognizant of platform idiosyncrasy, then, I believe it is not a bug 
in Python.

--
status: pending - open

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



[issue11252] Handling statement OR assignment continuation '\' on Win32 platform

2011-02-20 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
assignee:  - lukasz.langa
nosy: +lukasz.langa

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



[issue11252] Handling statement OR assignment continuation '\' on Win32 platform

2011-02-19 Thread Suresh Kalkunte

New submission from Suresh Kalkunte sskalku...@gmail.com:

Referring to URL for files used to build the Apache Portable Runtime Utilities 
library using Python 2.7.1(AMD64) or 2.6.5(Cygwin) on a Win32 system (Windows 
7), when apr/build/gen-build.py 
(http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/build/gen-build.py?revision=886996view=markup)
 parses '\' on line 96 and 97 in apr-util/build.conf 
(http://svn.apache.org/viewvc/apr/apr-util/branches/1.4.x/build.conf?revision=886996view=markup),
 it recognizes them as separate tokens causing the script to fail on line 168 
assert file[-2:] == '.c'. If the line continuation notation ('\') is removed 
from build.conf, gen-build.py performs without errors. 

On a Redhat Linux, I have verified Python 2.5.5 (and trust 2.7.1 to provide the 
same behavior on Linux) handles '\' without errors leading me to believe that 
if this is a bug, it is only on Win32 platform (and instances where '\' is used 
for directory path separation).

I am new to Python, from searching the python bug database, I have not been 
able to find the above condition covered. If this bug has already been 
identified, please disregard.

--
components: Interpreter Core, Windows
messages: 128890
nosy: Suresh.Kalkunte
priority: normal
severity: normal
status: open
title: Handling statement OR assignment continuation '\' on Win32 platform
type: behavior
versions: Python 2.6, Python 2.7

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