This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_peepholer failing on HEAD
Type: Stage:
Components: Interpreter Core Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: rhettinger, tim.peters
Priority: normal Keywords:

Created on 2005-02-15 19:49 by tim.peters, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (6)
msg24303 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2005-02-15 19:49
On WinXP with current CVS HEAD:

FAIL: test_folding_of_binops_on_constants 
(__main__.TestTranforms)
------------------------------------------------------
----------------
Traceback (most recent call last):
  File "../lib/test/test_peepholer.py", line 134, in 
test_folding_of_binops_on_constants
    self.assert_('(1000)' in asm)
AssertionError

and asm contains the big string 'x'*1000 instead.
msg24304 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2005-02-15 22:49
Logged In: YES 
user_id=80475

Can you confirm that it works after deleting the pyc file? 
If so, I'll bump the magic number.
msg24305 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2005-02-15 23:03
Logged In: YES 
user_id=31435

Well, I'm using rt.bat from PCbuild to run the tests.  That 
deletes all the .pyc and .pyo files reachable from Lib before 
running the tests.  So, no, deleting .pyc doesn't matter here.

...\PCbuild>python rmpyc.py
81 .pyc deleted, 0 .pyo deleted

...\PCbuild>dir/s/b ..\Lib\*.pyc ..\Lib\*.pyo
File Not Found

...\PCbuild>rt test_peepholer
Deleting .pyc/.pyo files ...
14 .pyc deleted, 0 .pyo deleted

...\PCbuild>python  -E -tt ../lib/test/regrtest.py 
test_peepholer
test_peepholer
test test_peepholer failed -- Traceback (most recent call 
last):
  File "C:\Code\python\lib\test\test_peepholer.py", line 134, 
in test_folding_of_binops_on_constants
    self.assert_('(1000)' in asm)
AssertionError

1 test failed:
    test_peepholer
About to run again without deleting .pyc/.pyo first:
Press any key to continue . . .
Terminate batch job (Y/N)? y

Is it possible, e.g., that you have an unchecked-in change on 
your development machine?
msg24306 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2005-02-15 23:48
Logged In: YES 
user_id=80475

Hmm, I don't see how we could get different results.  After
a fresh cvs up and recompilation, I get:

C:\py25>cvs st Python/compile.c
===================================================================
File: compile.c         Status: Up-to-date

   Working revision:    2.344
   Repository revision: 2.344  
/cvsroot/python/python/dist/src/Python/compile.
,v
   Sticky Tag:          (none)
   Sticky Date:         (none)
   Sticky Options:      (none)


C:\py25>cvs st Lib/test/test_peepholer.py
===================================================================
File: test_peepholer.py Status: Up-to-date

   Working revision:    1.11
   Repository revision: 1.11   
/cvsroot/python/python/dist/src/Lib/test/test_pe
epholer.py,v
   Sticky Tag:          (none)
   Sticky Date:         (none)
   Sticky Options:      (none)


C:\py25\Lib\test>python -tt test_peepholer.py
test_elim_extra_return (__main__.TestTranforms) ... ok
test_elim_inversion_of_is_or_in (__main__.TestTranforms) ... ok
test_folding_of_binops_on_constants (__main__.TestTranforms)
... ok
test_folding_of_tuples_of_constants (__main__.TestTranforms)
... ok
test_none_as_constant (__main__.TestTranforms) ... ok
test_pack_unpack (__main__.TestTranforms) ... ok
test_unot (__main__.TestTranforms) ... ok
test_while_one (__main__.TestTranforms) ... ok

----------------------------------------------------------------------
Ran 8 tests in 0.170s

OK


C:\py25>python
Python 2.5a0 (#46, Feb 15 2005, 18:32:36) [MSC v.1200 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more
information.
>>> from dis import dis
>>> dis(compile('a="x"*1000', '', 'single'))
  1           0 LOAD_CONST               0 ('x')
              3 LOAD_CONST               1 (1000)
              6 BINARY_MULTIPLY
              7 STORE_NAME               0 (a)
             10 LOAD_CONST               2 (None)
             13 RETURN_VALUE
msg24307 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2005-02-16 01:56
Logged In: YES 
user_id=31435

Peculiar!  I have the same CVS status output, and recompiled 
Python from scratch earlier just to be sure.

Oh, dang, I'm sorry.  Turns out my Visual Studio run was still 
pointing at the 24-maint branch checkout -- I wasn't 
recompiling the HEAD at all.  Works fine!  False alarm.  Sorry, 
Raymond!
msg24308 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2005-02-16 02:58
Logged In: YES 
user_id=80475

C'est le vie.  :-)
History
Date User Action Args
2022-04-11 14:56:09adminsetgithub: 41580
2005-02-15 19:49:22tim.peterscreate