Issue1837

classification
Title: gderived.py and template Ant target fail on Windows
Type: crash Severity: normal
Components: Core Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: amak, fwierzbicki, jeff.allen
Priority: high Keywords: patch

Created on 2012-02-11.23:08:53 by jeff.allen, last changed 2012-03-29.20:57:32 by fwierzbicki.

Files
File name Uploaded Description Edit Remove
Issue1837-gderived-windows.patch jeff.allen, 2012-02-11.23:49:59 Patch fixing issue 1837
Messages
msg6777 (view) Author: Jeff Allen (jeff.allen) Date: 2012-02-11.23:08:52
gderived.py fails on a Python 2.x Windows platform because os.path.samefile is not supported. This prevents the development of new built-in types. The templates section of "ant template" fails like this:
template-init:
    [javac] .\build.xml:476: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 1 source file to .\build\classes

template:
 [gentempl] executing: python .\src\templates\gexpose.py --lazy
 [gentempl] executing: python .\src\templates\gderived.py --lazy
 [gentempl] Traceback (most recent call last):
 [gentempl]   File ".\src\templates\gderived.py", line 251, in <module>
 [gentempl] Processing .\src\templates\ast_Subscript.derived into .\src\org\python\antlr\ast\SubscriptDerived.java
 [gentempl]     process(mapping[0], mapping[1], lazy)
 [gentempl]   File ".\src\templates\gderived.py", line 206, in process
 [gentempl]     result = hack_derived_header(outfile, result)
 [gentempl]   File ".\src\templates\gderived.py", line 215, in hack_derived_header
 [gentempl]     if os.path.samefile(parent, core_dir):
 [gentempl] AttributeError: 'module' object has no attribute 'samefile'

I've replaced the (rather long) absolute path to the root of the project by "." in this dump.
msg6778 (view) Author: Jeff Allen (jeff.allen) Date: 2012-02-11.23:49:59
Patch addressing this by providing, when os.path.samefile is missing, a sunstitute that compares absolute paths.

I have tested this by running the ant template target to regenerate all *Derived.java files, then rebuilding successfully.
msg6983 (view) Author: Alan Kennedy (amak) Date: 2012-03-29.20:10:50
The patch seems to have been committed

http://hg.python.org/jython/rev/76b77b00a4fe

But the patch wasn't committed against 2.5?

And the NEWS file should be updated too, to say that it's fixed.
msg6984 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2012-03-29.20:42:30
oops, my bad - will fix.
History
Date User Action Args
2012-03-29 20:57:32fwierzbickisetstatus: open -> closed
resolution: fixed
2012-03-29 20:42:30fwierzbickisetmessages: + msg6984
2012-03-29 20:10:50amaksetnosy: + amak
messages: + msg6983
2012-02-12 05:28:43fwierzbickisetpriority: high
assignee: fwierzbicki
2012-02-11 23:49:59jeff.allensetfiles: + Issue1837-gderived-windows.patch
nosy: + fwierzbicki
messages: + msg6778
keywords: + patch
2012-02-11 23:08:53jeff.allencreate