msg109911 - (view) |
Author: Tiago Antao (tiagoantao) * |
Date: 2010-07-10 19:27 |
2to3 -d sometimes crashes. The problem seems to be in refactor_doctest. The problematic line is: if self.log.isEnabledFor(logging.DEBUG): self.log does not exist. The error, as expected: File "/usr/lib/python3.1/lib2to3/refactor.py", line 516, in refactor_doctest if self.log.isEnabledFor(logging.DEBUG): AttributeError: 'StdoutRefactoringTool' object has no attribute 'log' |
|
|
msg109916 - (view) |
Author: Benjamin Peterson (benjamin.peterson) *  |
Date: 2010-07-10 19:45 |
Fixed in r82779. I'm curious as to what it's failing on. |
|
|
msg109917 - (view) |
Author: Tiago Antao (tiagoantao) * |
Date: 2010-07-10 19:50 |
Benjamin, Thanks for the fast answer. I attach the problematic file. This file is from Biopython. We are trying to have a Python 3 version of it. We applied 2to3 (no -d) first (via distutils on setup.py build) and I was applying 2to3 -d manually after it. |
|
|
msg109925 - (view) |
Author: Tiago Antao (tiagoantao) * |
Date: 2010-07-10 20:03 |
BTW, this happens in 2.6 also |
|
|
msg109988 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2010-07-11 10:32 |
Could it be because of the escaped triple quotes? |
|
|
msg110023 - (view) |
Author: Tiago Antao (tiagoantao) * |
Date: 2010-07-11 16:13 |
A few more problematic examples (hope it helps) >>> my_mseq = MutableSeq("MKQHKAMIVALIVICITAVVAAL", \ IUPAC.protein) Note the line continuation >>> rec.letter_annotations["secondary_structure"] = \ (The same pattern) Another (different) """Returns a simple text representation of the codon table e.g. >>> import Bio.Data.CodonTable >>> print Bio.Data.CodonTable.standard_dna_table >>> print Bio.Data.CodonTable.generic_by_id[1]""" And (the original) >>> class CreatePeople(DocSQL.Create): ... \""" ... CREATE TEMPORARY TABLE people ... (id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, ... last_name TINYTEXT, ... first_name TINYTEXT) ... \""" ... Hope it helps |
|
|
msg110025 - (view) |
Author: Tiago Antao (tiagoantao) * |
Date: 2010-07-11 16:27 |
Another example >>> records = (record for record in \ SeqIO.parse("Roche/E3MFGYR02_random_10_reads.sff","sff") \ if record.seq[record.annotations["cli [...] Note that ... does not apply here (it will fail on python2 doctests) |
|
|
msg110262 - (view) |
Author: Tiago Antao (tiagoantao) * |
Date: 2010-07-14 09:54 |
I've re-opened this bug because of the late examples that I've included that still crash. I can open a new bug if you prefer with the late examples (just tell me and I will open a new bug). This is somewhat important for us: In order to be able to release a Python3 version of biopython we need to have 2to3 doctest processing working. |
|
|
msg111811 - (view) |
Author: Peter (maubp) |
Date: 2010-07-28 13:56 |
Reverted accidental title change - had keyboard focus on the page not the address bar I think. Sorry! |
|
|
msg115588 - (view) |
Author: Jeremy Thurgood (jerith) |
Date: 2010-09-04 16:41 |
This seems to be fixed in 3.2 and the 2.7 maintenance branch, but here's a (one-liner) patch for people who want to fix their local installations. |
|
|