instance_id
stringlengths
10
65
repo
stringlengths
5
59
pr_number
int64
1
313k
task_type
stringclasses
1 value
base_commit
stringlengths
40
40
review_commit
stringlengths
40
40
title
stringlengths
2
282
body
stringlengths
7
3k
patch
stringlengths
202
204k
n_defects
int64
1
72
n_supported
int64
1
65
n_major
int64
0
32
defects
stringlengths
140
18.8k
certifier_count
int64
trailofbits__manticore__2420
trailofbits/manticore
2,420
defect
2e990ba4fec508a5f31a683736197462603eae0b
8ffc32788985207a2038622dd2c7ef91a188ee25
Portfolio of parallel solvers
This PR contains: * A new meta solver called portfolio, that runs several solvers in parallel. Once one solver wins the race, the other ones are stopped, since there is no way to use their results in a meaningful way. * As expected, the number of workers is adjusted when using the portfolio to avoid using more tha...
diff --git a/manticore/core/manticore.py b/manticore/core/manticore.py index 7f48ab25b..fa3104529 100644 --- a/manticore/core/manticore.py +++ b/manticore/core/manticore.py @@ -49,7 +49,7 @@ default=False, description="If True enables to run workers over the network UNIMPLEMENTED", ) -consts.add("procs", def...
13
8
0
[{"id": "G0", "claim": "The solver-specific configuration (commands and inits) should live in each solver class rather than in a central SolverInfo object.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new __readline_and_count retry loop busy-waits ...
null
trailofbits__manticore__2491
trailofbits/manticore
2,491
defect
4d880cd4edbd2f23d840713ed05f441974e894a7
c2063d2d590ca995aca6a519ae968505b1294f7d
Add methods for getting list of (un)implemented system calls
This is primarily a helper function that is useful in evaluating the syscall capabilities of Manticore on Linux
diff --git a/manticore/platforms/linux.py b/manticore/platforms/linux.py index efc526f7e..edefedd12 100644 --- a/manticore/platforms/linux.py +++ b/manticore/platforms/linux.py @@ -3316,6 +3316,44 @@ def _interp_total_size(interp): last = load_segs[-1] return last.header.p_vaddr + last.header.p_memsz ...
1
1
0
[{"id": "G0", "claim": "In implemented_syscalls, prefer tuple unpacking (e.g. `for (name, _) in inspect.getmembers(...)`) over indexing `x[0]`, since the pieces are reused and unpacking makes it clearer what getmembers returns.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introdu...
null
trailofbits__manticore__250
trailofbits/manticore
250
defect
1e76998eb78fd2b3240e1131c5480f02c2335620
2be7b2c5e138a4a46051a1980e5320214fcb3f16
Rm unused Slinux ctor params
Fixes #109
diff --git a/manticore/manticore.py b/manticore/manticore.py index 4ea1f1ee8..55e49afcc 100644 --- a/manticore/manticore.py +++ b/manticore/manticore.py @@ -41,7 +41,7 @@ def makeLinux(program, argv, env, concrete_start = ''): logger.info('Loading program %s', program) constraints = ConstraintSet() - pla...
1
1
1
[{"id": "G0", "claim": "The stale SLinux docstring/comment should be corrected in this PR as well, since it still describes a Decree OS platform and documents parameters (constraints, mem) that no longer match the changed constructor.", "category": "documentation", "verdict": "supported", "priority": "P1", "scope": "in...
null
trailofbits__manticore__2504
trailofbits/manticore
2,504
defect
9f55b09aa36f088f21fc9f9a31f488a9b7b318fa
abbfa01cdc790f7ccaf3c24d6726362e53f88e79
Add SMT simplifications for bitvec subtraction
This PR adds the following simplifications for expressions: `A-A ==> 0` `A-0 ==> A`
diff --git a/manticore/core/smtlib/visitors.py b/manticore/core/smtlib/visitors.py index f64dfd621..a23255391 100644 --- a/manticore/core/smtlib/visitors.py +++ b/manticore/core/smtlib/visitors.py @@ -395,7 +395,7 @@ def visit_BoolAnd(self, expression, a, b): return a def _visit_operation(self, expr...
1
1
1
[{"id": "G0", "claim": "The `left is right` identity check in visit_BitVecSub should use `==` (more correct), or at least carry a TODO/comment explaining why identity is used.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
trailofbits__manticore__2527
trailofbits/manticore
2,527
defect
93211002a9cea6074790c0de974fb9e603881577
958bb80f8dd8903e439ac924e0bde79c887ffe84
Optimise forking when there is only 1 solution
This PR improves the forking process when there is only one possible solution for the symbolic expression upon which we fork. In that case, we re-use the same `State` instead of copying the entire state to create a new one. I don't think that Manticore has many tests for forks except this one: https://github.com/tr...
diff --git a/manticore/core/manticore.py b/manticore/core/manticore.py index 579068221..3d5b8cf0e 100644 --- a/manticore/core/manticore.py +++ b/manticore/core/manticore.py @@ -523,30 +523,48 @@ def setstate(x, y): self._publish("will_fork_state", state, expression, solutions, policy) - # Build and ...
2
1
1
[{"id": "G0", "claim": "Publishing the normal did_fork_state event for the single-solution path (since there is no dedicated event for concretising without forking) could be controversial and may require downstream consumers of the introspection API, such as MUI, to be tweaked, because it will appear as multiple fork e...
null
trailofbits__manticore__2553
trailofbits/manticore
2,553
defect
9e11bc9ae9cc961d38c2a4932372d89fec2c6b26
a23afea637139c2e769c08bc3aa6f95566ac6b3e
Add `psubq` instruction (x86)
Adds support for `psubq` x86 instruction. Implementation very similar to `psubb`.
diff --git a/manticore/native/cpu/x86.py b/manticore/native/cpu/x86.py index 49ca8b6eb..5d3467d88 100644 --- a/manticore/native/cpu/x86.py +++ b/manticore/native/cpu/x86.py @@ -5881,6 +5881,31 @@ def PSUBB(cpu, dest, src): result.append((a - b) & 0xFF) dest.write(Operators.CONCAT(8 * len(result), ...
1
1
0
[{"id": "G0", "claim": "Masking the PSUBQ result with 0xFFFFFFFFFFFFFFFF is unnecessary because the subtraction is already performed on 64 bits.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
trailofbits__manticore__2563
trailofbits/manticore
2,563
defect
e7619328c8613841c50a2cb4bba49e813b60d57e
f646cad07e2b42b4d30c25522f05ed7aa6325801
Add boolean simplifications
This PR adds the following simplification patterns on constraints that we often encounter within `MATE`: ``` !(a||b) -> !a && !b !(a&&b) -> !a || !b a == True -> a a == False -> !a 1*a -> a ```
diff --git a/manticore/core/smtlib/visitors.py b/manticore/core/smtlib/visitors.py index 3c21aa3f8..594a5e479 100644 --- a/manticore/core/smtlib/visitors.py +++ b/manticore/core/smtlib/visitors.py @@ -503,13 +503,31 @@ def visit_BoolAnd(self, expression, *operands): ) == BitVecExtract(operand=v...
2
2
0
[{"id": "G0", "claim": "The docstring lines of visit_BoolNot list the simplifications in a different order than the implementation; reorder them so !(a&&b) comes before !(a||b).", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The visit_BitVecMul do...
null
trailofbits__manticore__2575
trailofbits/manticore
2,575
defect
04cc68dbf164af976df23e3a435207aa8fcb246d
1a913de6eee21b74fa5a865119a836fe176f76ae
Rework logging setup
This allows projects to have more control over how Manticore logs are handled. However, this also means that you need to explicitly enable logging in Manticore scripts to see the logs. See `manticore/__main__.py` file changes in this commit.
diff --git a/docs/utilities.rst b/docs/utilities.rst index 514f50741..1b3bc9c8f 100644 --- a/docs/utilities.rst +++ b/docs/utilities.rst @@ -4,4 +4,7 @@ Utilities Logging ^^^^^^^ +.. autofunction:: manticore.utils.log.init_logging +.. autofunction:: manticore.utils.log.get_manticore_logger_names .. autofunction:: ...
2
2
1
[{"id": "G0", "claim": "Clearing the root logger's handlers in main() may interfere with other modules that also use logging, so the clearing should not happen unconditionally in main() but only when running as the CLI entry point.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introdu...
null
trailofbits__manticore__370
trailofbits/manticore
370
defect
fcb375ac76f77b7875b0b389aa00770b0c32565f
cc8ceec53b313903aaa01015d46afdce4e87f5fe
Catch and refactor MemoryExceptions
Fixes #359 Previously, raised `MemoryExceptions` were uncaught and caught output like below, which makes it seem like Manticore crashed. This pull request - catches MemoryExceptions and generates a testcase - refactors StateException/TerminateState to use `*args, **kwargs` less for better readability - refact...
diff --git a/manticore/core/executor.py b/manticore/core/executor.py index 1f8daa363..e7ddfe9ca 100644 --- a/manticore/core/executor.py +++ b/manticore/core/executor.py @@ -479,7 +479,7 @@ def run(self): current_state = None except TerminateState as e: - ...
1
1
0
[{"id": "G0", "claim": "Remove all the commented-out code lines around the TerminateState handler in manticore/core/executor.py.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}]
null
trailofbits__manticore__371
trailofbits/manticore
371
defect
b6a71375cfc8e186d8ce4c9d9ba04f3e5ad5b664
da331619046b98b7d2a26ea53a3d049380eb1d79
Pub-sub like events
Make every eventful object Eventful. https://gist.github.com/feliam/0bee4c6826dfc0cccdde18b9eaaafa8a ( Fixes https://github.com/trailofbits/manticore/issues/352 ) self.publish('did_add_state', state_id, state) self.publish('did_emulate_instruction', instruction) self.publish('did_execute_instruction', instruct...
diff --git a/manticore/core/cpu/abstractcpu.py b/manticore/core/cpu/abstractcpu.py index 3ff3ff371..1b3354cad 100644 --- a/manticore/core/cpu/abstractcpu.py +++ b/manticore/core/cpu/abstractcpu.py @@ -8,7 +8,7 @@ import sys from functools import wraps from itertools import islice, imap -from ...utils.event import Si...
12
10
1
[{"id": "G0", "claim": "The publish('will_decode_instruction', ) call in Cpu.execute has a stray trailing comma.", "category": "style", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Dev-policy machinery (executor subscription, shared-context handling, prepare/choice protocol) ...
null
trailofbits__manticore__403
trailofbits/manticore
403
defect
7f54a4342c8833b37063ff5c19831c918a12f079
68a802c4d1c14ba86e3523194cf304b347368f8c
Instructions and tests to support issue binary for issue #182
Implementation of and tests for the `orn`, `it`, `uadd8`, `sel`, `cbnz`, `rev`, and `sxth` instructions. Update the `add` implementation to support the `add <dest>, <op>` form. Fixes #182
diff --git a/manticore/core/cpu/arm.py b/manticore/core/cpu/arm.py index 9b09aaa14..59621f6b6 100644 --- a/manticore/core/cpu/arm.py +++ b/manticore/core/cpu/arm.py @@ -199,6 +199,7 @@ def __init__(self): self._regs['APSR_Z'] = Register(1) self._regs['APSR_C'] = Register(1) self._regs['APSR_V...
9
8
4
[{"id": "G0", "claim": "The new _it_conditional should be an instance variable rather than a class variable.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "UADD8 should set GE via cpu.setFlags(GE=...) (updating _last_flags) plus a shouldCommitFlags ...
null
trailofbits__manticore__414
trailofbits/manticore
414
defect
d1ead7a7be1727675dd0a311f843c7663da80d5c
e1f1d257ddf24cc4c05f45ee0b2dd3fe64692764
Add Taint Parameters
Adds parameters allowing the user to specify an ID for taint tracking to `state.new_symbolic_buffer` and `state.symbolicate_buffer`. Also adds a property to `smtlib.expression.ArrayProxy` that allows the taint of the proxied ArrayVariable to be returned.
diff --git a/manticore/core/smtlib/expression.py b/manticore/core/smtlib/expression.py index 76836fe41..07794ed03 100644 --- a/manticore/core/smtlib/expression.py +++ b/manticore/core/smtlib/expression.py @@ -612,6 +612,10 @@ def __init__(self, array): @property def operands(self): return self._array...
1
1
0
[{"id": "G0", "claim": "The docstrings for new_symbolic_buffer and symbolicate_buffer should be updated to document the new taint parameter, e.g. with ':param taint: Taint identifier of this buffer' and ':type taint: tuple or frozenset'.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": ...
null
trailofbits__manticore__425
trailofbits/manticore
425
defect
51837df98b705149b814738aa6973321ab22a008
45bbc12f06f61c3233ffdffaabe26ac4be3f766b
Fix context serialization
replace __reduce__ by collaborative __set/getstate__
diff --git a/manticore/core/cpu/abstractcpu.py b/manticore/core/cpu/abstractcpu.py index 6920c4487..b120643dc 100644 --- a/manticore/core/cpu/abstractcpu.py +++ b/manticore/core/cpu/abstractcpu.py @@ -379,7 +379,7 @@ def __init__(self, regfile, memory, **kwargs): assert 'PC' in self._regfile def __getst...
4
3
1
[{"id": "G0", "claim": "Internal methods should use the private `_constraints` and `_platform` attributes instead of the public properties (e.g. `__enter__` builds the child state with `self.constraints`/`self.platform`).", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"},...
null
trailofbits__manticore__445
trailofbits/manticore
445
defect
eef3cd20e24d18980b9f4345c79249a8dcb85e71
f20d84ffa75ffacee6588a603c7046d46e454b6c
Implement logging presets
Fixes #431
diff --git a/manticore/__main__.py b/manticore/__main__.py index 351f034e9..a0f48102e 100644 --- a/manticore/__main__.py +++ b/manticore/__main__.py @@ -9,6 +9,7 @@ from threading import Timer from core.smtlib import Expression from manticore import Manticore +from utils.mlogging import set_verbosity try: impo...
7
6
4
[{"id": "G0", "claim": "The new set_verbosity function should also be exposed to the API via `from manticore import set_verbosity`, which requires modifying manticore's __init__.py.", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new logging module shou...
null
trailofbits__manticore__495
trailofbits/manticore
495
defect
f6fea10376d7c4ddd46c9225e39d8ef45b32ea9d
2b7ede46c53eae44c335ab603fd40afa3b6bddef
Fix stderr file creation and test for it going forwards
Fixes #484
diff --git a/manticore/core/workspace.py b/manticore/core/workspace.py index efa7e705b..4ec95f209 100644 --- a/manticore/core/workspace.py +++ b/manticore/core/workspace.py @@ -534,7 +534,7 @@ def solve_to_fd(data, fd): fd.write('{SolverException}') with self._named_stream('stdout') as _out:...
2
2
0
[{"id": "G0", "claim": "Instead of a separate test function, simply add another assertIn line for stderr to the existing test_output test.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The imports in tests/test_workspace.py should be cleaned up.", "cat...
null
trailofbits__manticore__610
trailofbits/manticore
610
defect
e50cc6b9b2a451a6f2eedb94ed3d85bbc4d5bf83
620811820137f153e7ceeb57bb128ce4607f398f
Updates for thumb mode
Fixes #605 Adds correct handling of PC relative addressing for thumb mode. Adds correct handling of mode swaps in more cases, as well as more thumb specific instruction implementations. Adds test cases for instruction implementations. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable....
diff --git a/manticore/core/cpu/arm.py b/manticore/core/cpu/arm.py index dd3b89236..9d2afb611 100644 --- a/manticore/core/cpu/arm.py +++ b/manticore/core/cpu/arm.py @@ -86,9 +86,9 @@ def read(self, nbits=None, withCarry=False): carry = self.cpu.regfile.read('APSR_C') if self.type == 'register': ...
6
6
4
[{"id": "G0", "claim": "POP's mode-switching logic should handle symbolic val (e.g. by switching mode on executing rather than switching prior to jumping) instead of assuming a concrete value.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The LDR-t...
null
trailofbits__manticore__616
trailofbits/manticore
616
defect
7875aaf5fd6c4f8fecbacef5bf58b4794733454f
2b54dd1d1aced466490a95b26bb95dd1ca7251ea
Fix Unicorn exception handling; add a symbolic wrapper for exit(2)
We originally had a very broad `except Exception` that was added to deal with emulating the `UD2` instruction. Now that we have a UcError-specific exception handler, we can remove the generic one. The generic one also broke how `ConcretizeRegister`/`ConcretizeMemory` were handled when produced by emulation code. ...
diff --git a/manticore/core/cpu/abstractcpu.py b/manticore/core/cpu/abstractcpu.py index 5e5a7f5b3..d22ed68aa 100644 --- a/manticore/core/cpu/abstractcpu.py +++ b/manticore/core/cpu/abstractcpu.py @@ -851,8 +851,6 @@ def emulate(self, insn): logger.error("Unimplemented instruction: 0x%016x:\t%s\t%s\t%s...
2
2
1
[{"id": "G0", "claim": "Raising ConcretizeArgument for a symbolic exit status makes manticore fork (MINMAX explores 0 and -1); it should instead just solve the status to one value.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The exit-status outpu...
null
trailofbits__manticore__632
trailofbits/manticore
632
defect
c6902d7265e66e8cd07a5a6b0e8c6e0e72c48cfa
9f16fb8534eb80f973d9a6dfd5123074d5b8c80a
Introduce a 'force' parameter to memory access functions
Introduces a `force` parameter to impacted Memory and Cpu methods. Fixes #549
diff --git a/manticore/core/cpu/abstractcpu.py b/manticore/core/cpu/abstractcpu.py index 5e5a7f5b3..82b97b42c 100644 --- a/manticore/core/cpu/abstractcpu.py +++ b/manticore/core/cpu/abstractcpu.py @@ -553,7 +553,7 @@ def __setattr__(self, name, value): def memory(self): return self._memory - def writ...
2
1
1
[{"id": "G0", "claim": "In SMemory.write's symbolic-address path, honoring force could mask writes to unmapped memory, so add an assert that force is False there (or otherwise ensure unmapped writes are still caught).", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": ...
null
trailofbits__manticore__640
trailofbits/manticore
640
defect
df9af1fd12f9bbe944f801a6ade2fddbf0b6f6a7
d822a044636e8cad7a5be4072ba356b9871d6384
System calls addition - sys_getrandom and sys_openat
**Summary:** System call addition at linux.py * sys_getrandom * sys_openat **Progress:** Tested with some binaries making the respective system calls **Pending tasks -** Unit test code Fixes #707 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" a...
diff --git a/manticore/platforms/linux.py b/manticore/platforms/linux.py index 620766ced..47a33da3c 100644 --- a/manticore/platforms/linux.py +++ b/manticore/platforms/linux.py @@ -1314,6 +1314,39 @@ def sys_open(self, buf, flags, mode): return self._open(f) + def sys_openat(self, dirfd, buf, flags, mod...
8
8
3
[{"id": "G0", "claim": "The body of the `if os.path.isdir(...)` block in sys_openat is over-indented and should be fixed.", "category": "style", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "sys_getrandom should use named flag constants in the body instead of turning flags int...
null
trailofbits__manticore__656
trailofbits/manticore
656
defect
aac83ada10c4426f0a0a570255fb73421339840d
c45b7648bbb00e5486f2a7011e0ed925d6f002da
eth int overflow: tests, mul support
this pr improves eth int overflow detection to check for overflows due to the mul instruction. it adds a test file for eth tests, restructure the code to make it testable, and changes the CI scripts to install solc.
diff --git a/.travis.yml b/.travis.yml index a42109c44..49cb43893 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,8 +15,6 @@ os: python: - 2.7.13 install: -- travis_retry pip install -U pip -- travis_retry pip uninstall -y Manticore || echo "Manticore not cached" # uninstall any old, cached Manticore -- travis_re...
3
2
1
[{"id": "G0", "claim": "The IntegerOverflow detector should also support the ADDMOD and MULMOD instructions, not just ADD, SUB and MUL.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The detector could use instruction.is_arithmetic to generalize its...
null
trailofbits__manticore__679
trailofbits/manticore
679
defect
4c0f4bc6cf7509eb0f3399327fb494188b137671
025c95984550b35281c2b1e6e47f9438166a9dd1
Quick evm header fix
Populates current implementation of the block header. Fixes https://github.com/trailofbits/manticore/issues/676 Research needed.
diff --git a/manticore/platforms/evm.py b/manticore/platforms/evm.py index 7987252dc..1535babe2 100644 --- a/manticore/platforms/evm.py +++ b/manticore/platforms/evm.py @@ -1077,7 +1077,6 @@ def __init__(self, constraints, address, origin, price, data, caller, value, cod self.address = address self.or...
4
3
1
[{"id": "G0", "claim": "BLOCKHASH should not derive its return value from a placeholder 'FIXTHIS' salt; the placeholder magic must be replaced (once the behaviour is agreed) with a proper naming.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The pa...
null
trailofbits__manticore__732
trailofbits/manticore
732
defect
a1f809732d0a1bfedb0bd09c1115bb1857635385
5ba7634433ffafaea04c1f3e93e2b809b851186a
Array value configurable. 8,16,32..256 bits (not prefixed to 8)
Expression expanded to handle arrays to arbitrary sized values (not just 8 bits) Previously Array represented smtlib arrays from Bitvec(?) to Bitvec(8). With this patch you can now have Arrays of any to any bitsize. (usable for EVM storage for example) <!-- Reviewable:start --> --- This change is [<img src="ht...
diff --git a/manticore/core/smtlib/constraints.py b/manticore/core/smtlib/constraints.py index 15361fad1..13c416396 100644 --- a/manticore/core/smtlib/constraints.py +++ b/manticore/core/smtlib/constraints.py @@ -103,20 +103,20 @@ def related_to(self, expression): elif isinstance(exp, Bool): ...
6
5
0
[{"id": "G0", "claim": "The constraint-string checks should compare with `!=` instead of identity (`is`) against the string literal 'true', in both the while-loop and the for-loop over constraints.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The ...
null
trailofbits__manticore__787
trailofbits/manticore
787
defect
454fe67ce424c216deee517bb86ef6018396f08a
23d893ba3948ef13741fd817640b5572287016ce
Fixes for dynargs PR
This address PR review comments and fixes some bugs present in the original branch #715 : - ABI._consume_type buggs regarding offset math with address[] - ArrayProxy.__getitem__ incorrectly calls the constructor of ArrayVariable, resulting in TypeError ``` In [1]: from manticore.core.smtlib import * In [2]: ...
diff --git a/manticore/ethereum.py b/manticore/ethereum.py index d51ac2134..155bafd5d 100644 --- a/manticore/ethereum.py +++ b/manticore/ethereum.py @@ -330,7 +330,7 @@ def make_function_arguments(*args): args = list(args) for i in range(len(args)): if isinstance(args[i], EVMAccount): - ...
5
4
0
[{"id": "G0", "claim": "The PR should consider using a simplifier with constant folding in the future (noted so it is remembered).", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G2", "claim": "Something in this branch causes test_eth_regressions to take significantly l...
null
trailofbits__manticore__815
trailofbits/manticore
815
defect
eaa0e524b44cbdb4a7bcf3ba6808bbd86c2a16c3
85afe20dc693df6d97b1a469ef6f6a11d9bc050b
Graceful exit when no states to run
Fixes #795 Fixes #802 Rather than assertion error'ing out when there are no states, to run, simply return. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/trailofbits/manticore/815) <!...
diff --git a/manticore/ethereum.py b/manticore/ethereum.py index effcdf6c2..865dcba9e 100644 --- a/manticore/ethereum.py +++ b/manticore/ethereum.py @@ -947,8 +947,10 @@ def run(self, **kwargs): # Check if there is a pending transaction with self.locked_context('seth') as context: assert ...
1
1
1
[{"id": "G0", "claim": "Calling contract_account.f(m.SValue) when there are no alive states should raise an exception instead of appearing to work.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
trailofbits__manticore__817
trailofbits/manticore
817
defect
eaa0e524b44cbdb4a7bcf3ba6808bbd86c2a16c3
e6eab14bd8f1a2394f0adb4c323dc5843d9dc707
evm: add per state trace file
previously, we would report the 'visited.txt' which is the complete coverage that all states achieved, but it's often desirable to see what trace a particular state took. this implements some changes to the workspace files. we now emit a `.init.trace` and `.rt.trace` for the init and runtime traces for the state. op...
diff --git a/manticore/ethereum.py b/manticore/ethereum.py index effcdf6c2..5a7e8350f 100644 --- a/manticore/ethereum.py +++ b/manticore/ethereum.py @@ -1272,6 +1272,13 @@ def flagged(flag): logger.debug("Using iterpickle to dump state") statef.write(iterpickle.dumps(state, 2)) + ...
2
1
1
[{"id": "G0", "claim": "The emitted per-state trace file mixes initcode and runtime execution in one stream, and should separate the init trace from the runtime trace the way 'runtime_coverage' already does.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G3", "claim": ...
null
trailofbits__manticore__873
trailofbits/manticore
873
defect
bfffa78b5fdece3a18b87d205e130701efc9d243
baec575ce384fb687bdaeb849f125c09ffdf716e
Support Solidity compilation of a file handle
Issue #705 reports that Manticore doesn’t support Solidity code with imports. This is because Manticore currently only supports loading source code via strings. This PR adds support for compiling code via a file handle, which then allows the Solidity compiler to resolve the imports. --- This preserves the curre...
diff --git a/manticore/ethereum.py b/manticore/ethereum.py index 700d9b6c2..dd0631129 100644 --- a/manticore/ethereum.py +++ b/manticore/ethereum.py @@ -660,6 +660,26 @@ def compile(source_code, contract_name=None): name, source_code, bytecode, runtime, srcmap, srcmap_runtime, hashes, abi, warnings = Manticore...
2
2
1
[{"id": "G0", "claim": "The `isinstance(source_code, file)` check fails on Python 3 because `file` does not exist there, and should instead resolve the type once with a try/except NameError falling back to io.IOBase.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "...
null
trailofbits__manticore__908
trailofbits/manticore
908
defect
78df0e9ab9de970656011ae6a0cc0a0e79e68a38
cb473ec2f0c313bbb858f3b241984fef61f7d9c7
incremental py3: print statements, octals, and more
print statements, octal literals, and various small changes to support identical calling between py2 and py3. Plus a few missed exception syntax, etc. There will surely be more... refs #904 (This may not pass until it gets rebased against #907 but if it does then it's good to review/merge) <!-- Reviewable:start...
diff --git a/manticore/binary/__init__.py b/manticore/binary/__init__.py index 1f85d476a..173ca96ce 100644 --- a/manticore/binary/__init__.py +++ b/manticore/binary/__init__.py @@ -14,6 +14,7 @@ and common API. interpreters? linkers? linked DLLs? ''' +from __future__ import print_function class Binary(object)...
1
1
1
[{"id": "G0", "claim": "Converting py2 print statements to print(e, ...) calls without adding `from __future__ import print_function` is a behavior change, and it applies to several files in this pull request.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
trailofbits__manticore__910
trailofbits/manticore
910
defect
058943763b6aa44ee834538b60593667cf4f1070
8aefa9423c70d1ae5a3f1b8e0ab9fd88e05cec03
Dev evm INVALID detector
* Some Detector improvements and rearrangements. * Command line arguments for enabling detectors ``` --detect-io Enable integer overflow detection (Ethereum only) --detect-invalid Enable INVALID instruction detection (Ethereum only) --detect-uninitialized-memory Enable...
diff --git a/manticore/__main__.py b/manticore/__main__.py index dcc551ed8..3c28e8c14 100644 --- a/manticore/__main__.py +++ b/manticore/__main__.py @@ -80,6 +80,24 @@ def positive(value): parser.add_argument('--contract', type=str, help='Contract name to analyze in case of multiple ones (...
8
6
0
[{"id": "G0", "claim": "In the new source-map parsing loop, `if k` would also work instead of `if len(k)` when filtering the split parts.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Rename the single-letter source-map variables (s, l, f, j, d...
null
trailofbits__multiplier__106
trailofbits/multiplier
106
defect
78025470b0cc59feee21d70796e004bc99478be5
18b6be14db962913ccc6f950da09883ca9060d7c
Add table for symbol category
Add different table for each symbol category in the database. The example tool go through all the category and query the symbol name
diff --git a/bin/Examples/FindSymbol.cpp b/bin/Examples/FindSymbol.cpp index 42b76d54e..b5f9535fc 100644 --- a/bin/Examples/FindSymbol.cpp +++ b/bin/Examples/FindSymbol.cpp @@ -42,11 +42,13 @@ extern "C" int main(int argc, char *argv[]) { mx::Index index(mx::EntityProvider::from_remote( FLAGS_host, FLAGS_port...
9
8
1
[{"id": "G0", "claim": "The FindSymbol example should iterate categories with the enumerator/enumeration iterator from Iterator.h instead of a manual loop bounded by NumEnumerators.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Drop the line-continuatio...
null
trailofbits__pe-parse__145
trailofbits/pe-parse
145
defect
d38c7daa7e74b9307080a7c9d91486cc41ec37f6
35baa3f8a1aa9632b8ed3b5b60e955a0690d65f2
Add simple test and corkami test suite using Catch2
closes #2 closes #1 * Enable testing with CMake option '-DPEPARSE_ENABLE_TESTING=ON'. * The simple test is extremely basic just as an example of using Catch2. * Corkami test suite is a git submodule within assets and the tests can be run with or without cloning it. You are able to configure CMake without t...
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d25599a..e6d99779 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ on: jobs: lint: - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 @@ -30,7 +30,7 @@...
4
3
0
[{"id": "G0", "claim": "The reviewer questions whether the std::experimental::filesystem discovery in tests/filesystem.h and the accompanying CMake filesystem hacks are needed at all, since C++17-conformant compilers should always have std::filesystem.", "category": "design", "verdict": "opposed", "priority": "P2", "sc...
null
trailofbits__test-fuzz__557
trailofbits/test-fuzz
557
defect
0b979220ee7ef54b89221cbe08fb0113db0c3fc7
4e184dfe461af0c822fa480802b1027baabc5224
Added integration test for cargo sort
This PR fixes one of the changes mentioned in #413 about converting `cargo_sort` into rust test. **Changes:** * Added a new test function `cargo_sort` to `test-fuzz/tests/integration/ci.rs`. * The test ensures `cargo-sort` is installed using `cargo install cargo-sort`. * It uses the `walkdir` crate to rec...
diff --git a/test-fuzz/Cargo.toml b/test-fuzz/Cargo.toml index 2c8f1907..6249b2d2 100644 --- a/test-fuzz/Cargo.toml +++ b/test-fuzz/Cargo.toml @@ -28,6 +28,7 @@ regex = { workspace = true } semver = { workspace = true } serde_json = { workspace = true } similar-asserts = { workspace = true } +walkdir = "2" testin...
3
3
0
[{"id": "G0", "claim": "Use the workspace dependency form for walkdir (walkdir = { workspace = true }) instead of pinning walkdir = \"2\" in test-fuzz/Cargo.toml.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Compare the walked file name agains...
null
trailofbits__test-fuzz__567
trailofbits/test-fuzz
567
defect
f31d1e378db54a13daeced791aa0bdc8532398bf
94beee8b7952853c36e3b63b8c1bb4b8beee06ce
Convert prettier github workflow test to rust test
This PR addresses #413 by converting the prettier github workflow test to rust test
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e09abfac..3afa97e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,6 +129,7 @@ jobs: cargo install cargo-supply-chain || true cargo install cargo-unmaintained || true cargo in...
2
2
0
[{"id": "G0", "claim": "Rename the new integration test function `prettier_check` to `prettier`.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Move the newly added `npm install -g prettier` line to the bottom of the tool-install list in .github...
null
trailofbits__test-fuzz__685
trailofbits/test-fuzz
685
defect
ea637d3cb6ea02008b9cdb0339ad47fbf508ac06
e4fcc4c5b62d3ee144a79e596bd2531a28ad6a74
fix: add warning for missing test_fuzz attributes
Summary Adds a compile-time warning when no #[test_fuzz] attributes are found in an impl block. Why? Previously, missing test_fuzz attributes failed silently. This warning helps users notice the issue early without breaking compilation. Related Issue Fixes [#676](https://github.com/trailofbits/test-fuzz/is...
diff --git a/macro/src/lib.rs b/macro/src/lib.rs index de36705d..1c44dade 100644 --- a/macro/src/lib.rs +++ b/macro/src/lib.rs @@ -69,6 +69,17 @@ pub fn test_fuzz_impl(args: TokenStream, item: TokenStream) -> TokenStream { }); let (impl_items, modules) = map_impl_items(&generics, trait_path.as_ref(), &self_...
3
3
1
[{"id": "G0", "claim": "Rather than add generated code with a `deprecated` attribute, emit the warning with a plain `eprintln!`, modeling after the existing warning in cargo-test-fuzz/src/lib.rs.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Add a test ...
null
trailofbits__vast__316
trailofbits/vast
316
defect
e3d876546841eac78225c3a644206a24455b88b0
0d30ebfed36b7f6aa36253df3463aaff2bef769e
Initial support for C++
Missing in this PR: - `friend` declarations - Separate operations for methods, constructors and destructors (with support for the various attributes that those declarations have, like `virtual`, `volatile`, `const`, `&`, `&&`...) - Constructor initializers
diff --git a/include/vast/Dialect/HighLevel/HighLevelOps.td b/include/vast/Dialect/HighLevel/HighLevelOps.td index 2ac041a921..1a9f34666b 100644 --- a/include/vast/Dialect/HighLevel/HighLevelOps.td +++ b/include/vast/Dialect/HighLevel/HighLevelOps.td @@ -269,6 +269,76 @@ def UnionDeclOp : RecordLikeDeclOp< "union" > { ...
9
7
1
[{"id": "G0", "claim": "The TODO comment on CxxRecordLikeDeclOp should read `TODO(hl:cxx): Add region constraints.` instead of `TODO(Heno): add region constraints`.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "AccessSpecifierOp is declared with ...
null
translate__translate__4440
translate/translate
4,440
defect
f2e856c15c85f30b6f9897f1f964874511ba4495
430cd8e5117f0d1eac0647a50319c3d194c31b78
Use double quote for xml header
Solve https://github.com/WeblateOrg/weblate/issues/6563 cc @nijel.
diff --git a/tests/cli/data/test_po2flatxml/out.xml b/tests/cli/data/test_po2flatxml/out.xml index 33149e057a..a1f0927293 100644 --- a/tests/cli/data/test_po2flatxml/out.xml +++ b/tests/cli/data/test_po2flatxml/out.xml @@ -1,4 +1,4 @@ -<?xml version='1.0' encoding='UTF-8'?> +<?xml version="1.0" encoding="UTF-8"?> <roo...
7
7
6
[{"id": "G0", "claim": "The now-redundant `XMLdoublequotes = True` overrides can be removed from the LISAfile subclasses, since the base-class default was flipped to True.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Many tests in the convert ...
null
translate__translate__4481
translate/translate
4,481
defect
f1fc103d43f867917cf114565c9833fce8f9008d
4d3a8222205f1947e71808f281160446c1a24073
Better handling of multiline stringtable translations in po2rc
When outputting a STRINGTABLE: - Construct msgid correctly when it's multiline - If a translation isn't available, output the continuation lines indented (not separated by ',') - If a translation is available, it's output on a single line (since we don't know where to break lines) Fixes #4115
diff --git a/translate/convert/po2rc.py b/translate/convert/po2rc.py index 163af0325b..7d86146ed7 100644 --- a/translate/convert/po2rc.py +++ b/translate/convert/po2rc.py @@ -164,14 +164,22 @@ def convert_string_table(self, s, loc, toks): out.append(c0[0].ljust(24)) name = rc.generate_st...
4
2
0
[{"id": "G0", "claim": "Replace the in-place modification of the list c in convert_string_table with constructing a fresh list (tmp) as drafted in the suggestions, because mutating the list makes the code hard to read.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"...
null
translate__translate__4798
translate/translate
4,798
defect
5e728c81bc0da5f6a994d89097ee1a6b5887a334
7391c8238305604295b35e6cc647c4f435838c7f
json: support gotext JSON format
I started experimenting with this as I'd very much like this to be supported in Weblate, however my Python is extremely rusty, so let me know if anything is amiss. Fixes #4450 Signed-off-by: Sam Whited <sam@samwhited.com>
diff --git a/translate/storage/jsonl10n.py b/translate/storage/jsonl10n.py index 15579cc9ef..8e09744282 100644 --- a/translate/storage/jsonl10n.py +++ b/translate/storage/jsonl10n.py @@ -416,6 +416,94 @@ def _extract_units( yield from parent +class GoTextJsonUnit(BaseJsonUnit): + ID_FORMAT = "{}" + ...
3
3
3
[{"id": "G0", "claim": "The new gotext store should implement gettargetlanguage/settargetlanguage so they operate on the file's `language` field instead of hardcoding the locale in the store constructor.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim":...
null
translate__translate__4988
translate/translate
4,988
defect
2d666a90af8e3121f01ca0bbd410e726ea88c277
b3f07e00d01d8ede268aafa64fa53803490ee799
getlocations should return a list instead of string
Hello. A bit of background on why I'm proposing this change. In commit 9061cac1db35a98f2196c14546a456b98ce0b15f, the method _xliffunit.getlocations_ changed its return type from a Python list to a string. Consider that xliffunit._getlocations_ inherits from class lisa.LISAunit which inherits from class base.Trans...
diff --git a/translate/storage/test_xliff.py b/translate/storage/test_xliff.py index da858c9cb5..c19f548427 100644 --- a/translate/storage/test_xliff.py +++ b/translate/storage/test_xliff.py @@ -721,6 +721,7 @@ def test_getlocations(): """ xlifffile = xliff.xlifffile.parsestring(xlfsource) locations ...
2
2
0
[{"id": "G0", "claim": "None should not be returned as a location: the None-filtering the PR added in the testcases belongs inside getlocations itself (or, if no None can occur in the list, it should be dropped from the testcases).", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}...
null
translate__translate__5185
translate/translate
5,185
defect
f461fa4d339593ee847b1cc1ad5a5c9796bb41e3
91cc70d9e217373c43d0efa26f3556c20fcd0a85
pypo: avoid adding extra msgctxt if there are 3 or more same msgids
Hello, This make json2po avoids multiple msgctxt in the resulting PO file. The cause was in the duplicate removal phase; the location of the first occurrence, among other two or more PO entries with the same keys, was added after the third time and later. Close #4394. This also adds a minimal example case as fo...
diff --git a/tests/translate/convert/test_json2po.py b/tests/translate/convert/test_json2po.py index 2e41704629..0856ac8190 100644 --- a/tests/translate/convert/test_json2po.py +++ b/tests/translate/convert/test_json2po.py @@ -1,3 +1,23 @@ +# +# Copyright 2023 Stuart Prescott +# Copyright 2023 Michal Čihař <michal@ciha...
1
1
0
[{"id": "G0", "claim": "The condition `if origpo not in markedpos and id:` appears to rest on the wrong assumption that `id` is blank/None once msgctxt was already handled; if so, `id` should be removed from the condition, the stale comment removed, and the `origpo.msgctxt` check merged into the condition.", "category"...
null
translate__translate__5203
translate/translate
5,203
defect
ee2e6a6b187a7f1aefbd55fb8adc214c286d77e1
27a110841b915121a824f8ed5c249cec041e6e6a
quote: handle all control chars equally
This makes the behavior consistent for all control characters, not just to these few defined. Fixes #5199 I'd really like to get this reviewed because I could not find reasoning for the previous behavior and I might have missed something. <!-- This is an auto-generated comment: release notes by coderabbit.ai -->...
diff --git a/tests/translate/misc/test_quote.py b/tests/translate/misc/test_quote.py index 81d91c5cff..4faa4b14b1 100644 --- a/tests/translate/misc/test_quote.py +++ b/tests/translate/misc/test_quote.py @@ -138,7 +138,7 @@ def test_mozilla_control_escapes(): prefix, suffix = "bling", "blang" for contr...
3
3
1
[{"id": "G0", "claim": "The \\x escape codes in the controlchars table should really be four-digit \\u escape codes, since \\x is not one of the Java escape sequences, and the same applies to all of the \\x codes below.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id"...
null
translate__translate__5423
translate/translate
5,423
defect
a021ff6bc4ab3bb8207e5f10029aa70cb4223df1
c96747aa3f9256dc2059cb4d8b2c90c347761b77
Allow po2rc output encoding to be specified
Allow po2rc output encoding to be specified with the '--charset-output' option, defaulting to automatically choosing cp1252 if possible, otherwise utf-16-le, as before.
diff --git a/tests/translate/convert/test_po2rc.py b/tests/translate/convert/test_po2rc.py index fd173149c0..ac1a1d8dd7 100644 --- a/tests/translate/convert/test_po2rc.py +++ b/tests/translate/convert/test_po2rc.py @@ -77,6 +77,7 @@ class TestPO2RCCommand(test_convert.TestConvertCommand): "-t TEMPLATE, --templ...
2
1
1
[{"id": "G0", "claim": "Maybe utf-8 would be a more reasonable default output encoding for RC files these days (instead of the PR's 'auto' default of cp1252 with UTF-16 fallback).", "category": "design", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Add a test so that the new ...
null
translate__translate__5480
translate/translate
5,480
defect
8a2302854416e48eb6d037453fc6f321eb7913f6
d2641350d3c660b72a5b1cf9cc404f8f7965fc9a
fix(yaml): gracefully handle blank plural values
We can not use them as None as that makes us later serialize as "None" string. See https://github.com/WeblateOrg/weblate/discussions/13441
diff --git a/tests/translate/storage/test_yaml.py b/tests/translate/storage/test_yaml.py index 701d7f3a49..b152a83176 100644 --- a/tests/translate/storage/test_yaml.py +++ b/tests/translate/storage/test_yaml.py @@ -598,3 +598,23 @@ def test_add(self): unit.setid("days_on[1]") store.addunit(unit) ...
1
1
1
[{"id": "G0", "claim": "Converting blank (None) plural values to empty strings makes 'no translation' indistinguishable from an explicitly empty translation in Ruby (I18n.t returns '' instead of a translation-missing error), so that distinction should be preserved (the reviewer offers a _parse_dict reordering approach ...
null
translate__translate__5601
translate/translate
5,601
defect
037facc2379e248dcd4fa891b93d47e70ec7e0c2
7b1bd59a2d8b94f4a83c296765d31924f1f56a24
Parse "administrativeStatus" and "Translation needed" metadata in TBX files
Related to https://github.com/WeblateOrg/weblate/issues/12795
diff --git a/tests/translate/storage/test_tbx.py b/tests/translate/storage/test_tbx.py index 56fcad9f7d..0aaffa7702 100644 --- a/tests/translate/storage/test_tbx.py +++ b/tests/translate/storage/test_tbx.py @@ -136,3 +136,67 @@ def test_note_from(self): assert unit.getnotes(origin="translator") == "Translator ...
1
1
1
[{"id": "G0", "claim": "Mapping TBX administrativeStatus values to isobsolete() may not be a good mapping because Weblate never imports obsolete units (they are kept as translation memory), and per the TBX spec the deprecated status (deprecatedTerm-admn-sts) is what should map to the obsolete concept, with Weblate's ow...
null
translate__translate__5723
translate/translate
5,723
defect
166ab1f9fdda19ed553037feaf3fe685a19a1fed
350ad7e17354814e292bd173d592d872a7f5d753
fix(po): improve text wrapping
- switch to wcwidth from cwcwidth for newer Unicode support and locale idendependency (fixes #5722) - do not perform wcwidth on characters only, that doesn't work well for compositing characters - wrap wcwidth with a safety wrapper to avoid using -1 length and to cache the calculations - implement breaking of wide s...
diff --git a/pyproject.toml b/pyproject.toml index 8c0d6fe8f7..5f84e79e62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,8 @@ test = [ ] types = [ "setuptools>=61.2", - "types-lxml==2025.3.30" + "types-lxml==2025.3.30", + "wcwidth-stubs==0.2.14.0" ] [project] @@ -61,8 +62,8 @@ classifiers = [...
3
1
0
[{"id": "G0", "claim": "The ValueError message 'Unprintable character in a string' is misleading because wcswidth returns -1 also for control characters or characters that cannot be displayed, so it should be reworded to something more accurate.", "category": "documentation", "verdict": "supported", "priority": "P2", "...
null
translate__translate__5753
translate/translate
5,753
defect
1f255985de7392767df63417bcb5db92625bf7ae
203f42de59afafafb4f9607cc1d037cdb090f04f
Fix: Don't translate lang attribute on non-html elements
## Problem When translating HTML files using the po2html converter, the `lang` attribute was being incorrectly translated on **all** HTML elements, not just on the `<html>` element. This caused language markers on other elements (such as `<a>`, `<strong>`, `<p>`, etc.) to be inappropriately changed to the target langu...
diff --git a/tests/translate/convert/test_po2html.py b/tests/translate/convert/test_po2html.py index b8ea824f78..d17dd9294f 100644 --- a/tests/translate/convert/test_po2html.py +++ b/tests/translate/convert/test_po2html.py @@ -167,6 +167,44 @@ def test_untranslated_attributes(self): expected = '<meta name="key...
1
1
0
[{"id": "G0", "claim": "The assertion that non-html elements keep lang=\"en\" should be tightened to check the anchor tag specifically, asserting 'lang=\"en\" href=\"/en\">English</a>' in result instead of the vague 'lang=\"en\" in result'.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "in...
null
translate__translate__5756
translate/translate
5,756
defect
81d930c23464e3fd8ea58900042d482d94210451
7a7fe10e9c44218ead57056b6ae6ed792a0665cf
feat(tmx): Add support for context in TMX
The suggestion here is to use the `<prop type="x-content">` tag for context ```xml <prop type="x-context">Context</prop> ``` the other alternative (not implemented here) is to use the `<note>` tag with a keyword like "Context: " ```xml <note>Context: Software UI</note> ```
diff --git a/docs/releases/3.16.4.rst b/docs/releases/3.16.4.rst new file mode 100644 index 0000000000..0a11e429f1 --- /dev/null +++ b/docs/releases/3.16.4.rst @@ -0,0 +1,28 @@ +Translate Toolkit 3.16.4 +************************ + +*Not yet released* + +This release contains improvements and bug fixes. + +Changes +====...
3
3
2
[{"id": "G0", "claim": "TranslationUnit.getcontext should not remain a @staticmethod because that creates minor inconsistencies with descendant classes.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "docs/releases/3.16.4.rst should not be hand-added to...
null
translate__translate__5759
translate/translate
5,759
defect
6825f80822ef4b5641ac0738c94629eab3f8eec3
ff46243f813aaeea78c83ca2fc33b7d697910e3a
Add translation ignore sections support for Markdown format
- [x] Explore repository structure and understand markdown translation implementation - [x] Run existing tests to establish baseline - [x] Understand how mistletoe parses HTML comments - [x] Implement translation ignore logic for `<!-- translate:off -->` and `<!-- translate:on -->` comments - [x] Add tests for translat...
diff --git a/docs/formats/md.rst b/docs/formats/md.rst index 7dfca13432..284bb319b4 100644 --- a/docs/formats/md.rst +++ b/docs/formats/md.rst @@ -36,6 +36,48 @@ Conformance as the source. +.. _md#excluding_content: + +Excluding Content from Translation +=================================== + +You can exclude sec...
5
5
4
[{"id": "G0", "claim": "The feature should be documented in docs/formats/md.rst, coding-style issues should be fixed using pre-commit, and tests covering full conversion (md2po and po2md with a PO file containing a translated string that must not be translated) should be added.", "category": "testing", "verdict": "supp...
null
translate__translate__5766
translate/translate
5,766
defect
d46571af1ca80e1c433d6a9753b33c8e505ce41d
139de5d1ce72bf4224693c31cfcd1fdf12949346
Add support for data-translate-comment attribute in HTML extraction
## Implementation Complete ✅ Successfully implemented support for `data-translate-comment` attribute in HTML parsing and html2po conversion. ### Summary of Changes **Modified Files:** - `translate/storage/html.py` - Core HTML parser implementation - `tests/translate/storage/test_html.py` - Storage layer tests - `tes...
diff --git a/tests/translate/convert/test_html2po.py b/tests/translate/convert/test_html2po.py index e807f6a90e..973eb3040a 100644 --- a/tests/translate/convert/test_html2po.py +++ b/tests/translate/convert/test_html2po.py @@ -749,6 +749,47 @@ def test_meta_mixed_translatable_and_non_translatable(self): self.c...
3
3
1
[{"id": "G0", "claim": "The comment '# Collect comments from HTML comments' is redundant with the variable name and comprehension condition and should be removed or made more descriptive.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The commen...
null
translate__translate__5775
translate/translate
5,775
defect
cfece07fe499c6018d740d006a1c0283122d6dec
45526aeede040c3e9d10d3010fdeb4c48b9f49c3
Fix Java properties encoding to respect target encoding with performance optimization
## Plan to fix Java properties ISO-8859-1 encoding issue - [x] Understand the issue: Java properties files with ISO-8859-1 encoding should preserve characters that are valid in ISO-8859-1 (0-255), only encoding characters outside that range as \uXXXX - [x] Explore the codebase and identify the problematic function: `j...
diff --git a/tests/translate/misc/test_quote.py b/tests/translate/misc/test_quote.py index 7ec83aea15..d49d13643e 100644 --- a/tests/translate/misc/test_quote.py +++ b/tests/translate/misc/test_quote.py @@ -113,6 +113,38 @@ def test_javapropertiesencode(self): assert quote.javapropertiesencode("abcḓ") == r"abc...
4
4
2
[{"id": "G0", "claim": "The initial fix will break with non-standard encodings; it should be tested with ASCII, where all non-ASCII values should be encoded.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Trying to encode each character individually...
null
translate__translate__5776
translate/translate
5,776
defect
cfece07fe499c6018d740d006a1c0283122d6dec
c37b66752e29ba6b80f2e51ed51a044e409ed931
Fix TMX element ordering to comply with TMX DTD
- [x] Revert incorrect creationdate changes - [x] Fix actual issue: TMX note and prop element ordering - [x] Ensure notes and props appear before tuv elements per TMX DTD - [x] Add tests for element ordering - [x] Verify all existing tests pass - [x] Refactor code to eliminate duplication - [x] Simplify helper method a...
diff --git a/tests/translate/storage/test_tmx.py b/tests/translate/storage/test_tmx.py index 9adfdda27e..e92a3c1cde 100644 --- a/tests/translate/storage/test_tmx.py +++ b/tests/translate/storage/test_tmx.py @@ -133,3 +133,59 @@ def test_context(self): newstore = self.StoreClass().parsestring(newsource) ...
6
6
2
[{"id": "G0", "claim": "The proposed fix is wrong: the TMX specification has no required attributes, so adding a required creationdate attribute to <tu> is incorrect, and instead <note> and <prop> elements should be placed before <tuv> elements.", "category": "correctness", "verdict": "supported", "priority": "P1", "sc...
null
translate__translate__5781
translate/translate
5,781
defect
ae1b90b9763912d8fa5eefa3121f5759c64a87cf
982d135624c7619be5a5e712ac42e559d31bf330
fix(bundle): gracefully handle non-text files
Open the file as binary and use copyfile instead of doing that manually. Fixes #1655 Replaces #5778
diff --git a/tests/translate/storage/test_bundleprojstore.py b/tests/translate/storage/test_bundleprojstore.py new file mode 100644 index 0000000000..41ef01715b --- /dev/null +++ b/tests/translate/storage/test_bundleprojstore.py @@ -0,0 +1,227 @@ +"""Tests for the bundleprojstore module.""" + +import contextlib +import...
1
1
0
[{"id": "G0", "claim": "Import `copyfileobj` directly from the shutil module on the existing shutil import line rather than adding a separate import statement.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}]
null
translate__translate__5786
translate/translate
5,786
defect
959733d44491400d636d9ddaf0a0e3ac90f8c549
2f5272a5cff951e369e7caa3ca85704a2e7dd5ba
Support YAML source string descriptions via comment extraction
## Plan to implement YAML comment extraction Based on the issue and agent instructions, I need to: - [x] Understand the repository structure and YAML storage implementation - [x] Research how ruamel.yaml's CommentedMap.ca stores comments - [x] Run existing tests to ensure baseline functionality - [x] Implement commen...
diff --git a/tests/translate/convert/test_yaml2po.py b/tests/translate/convert/test_yaml2po.py index fe8d1dd514..cfb81ce285 100644 --- a/tests/translate/convert/test_yaml2po.py +++ b/tests/translate/convert/test_yaml2po.py @@ -130,6 +130,62 @@ def test_convert_with_template(self): assert target_store.units[2]....
4
3
0
[{"id": "G0", "claim": "The backward-compatibility handling of the old 2-tuple `_flatten` output in `parse` should be removed: `_flatten` is an internal interface and should be fixed to always provide consistent output, with a type annotation added to help spot issues.", "category": "maintainability", "verdict": "suppo...
null
translate__translate__5787
translate/translate
5,787
defect
959733d44491400d636d9ddaf0a0e3ac90f8c549
391545382ca24a3fe7c4f8679309b6b885ed9c20
Fix YAML formatting to use literal block scalars for multiline strings
Fix YAML formatting to use literal block scalars for multiline strings ## Problem When Weblate creates new translation files or updates strings, multiline content (especially code examples) was being serialized as quoted strings with `\n` escape sequences instead of using YAML's literal block scalar format (`|` or `|...
diff --git a/tests/translate/storage/test_yaml.py b/tests/translate/storage/test_yaml.py index b1f0a41ad8..cf0076e703 100644 --- a/tests/translate/storage/test_yaml.py +++ b/tests/translate/storage/test_yaml.py @@ -485,6 +485,55 @@ def test_quotes_roundtrip(self): store.units[0].target = "Changed" ass...
4
3
1
[{"id": "G0", "claim": "storevalue() should preserve LiteralScalarString even when the new value does not contain a newline, and a test covering that should be added.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The docstring of _get_original_valu...
null
translate__translate__5788
translate/translate
5,788
defect
959733d44491400d636d9ddaf0a0e3ac90f8c549
0a2d136d1485741c7ea6e4881ccb1000adcd6f2d
Fix missing deprecatedstart marker in XWiki Page translation format
Fix missing deprecatedstart marker in XWiki Page translation format ## Problem When translation management tools like Weblate process XWiki properties files, the `#@deprecatedstart` marker can be lost, causing inconsistent deprecated block structure. The issue occurs when only some units within a deprecated block are...
diff --git a/tests/translate/storage/test_properties.py b/tests/translate/storage/test_properties.py index 9902219936..e46fc8ebf6 100644 --- a/tests/translate/storage/test_properties.py +++ b/tests/translate/storage/test_properties.py @@ -1409,6 +1409,45 @@ def test_translate_source(self): in generatedcont...
4
4
3
[{"id": "G0", "claim": "The drop_comments check after stripping the missing prefix should test the raw `line` against drop_comments, not the combined missing-prefix string, to match the pattern used elsewhere in the codebase.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"},...
null
translate__translate__5789
translate/translate
5,789
defect
57bb2d6395b9951f5ecfacd9b8db0fe6af6ec707
eabe7307803b903bb86e8af89541b920af00ae96
Automatically set dir attribute based on lang when translating HTML
- [x] Explore repository structure and understand HTML translation flow - [x] Review existing lang attribute handling in html.py - [x] Fetch RTL language data from Weblate repository - [x] Add RTL language data to translate/lang/data.py - [x] Add dir attribute to TRANSLATABLE_ATTRIBUTES for html tag - [x] Implement aut...
diff --git a/tests/translate/convert/test_po2html.py b/tests/translate/convert/test_po2html.py index 889a1eb999..1e4b0acfd1 100644 --- a/tests/translate/convert/test_po2html.py +++ b/tests/translate/convert/test_po2html.py @@ -180,6 +180,84 @@ def test_escapes(self): htmlexpected = '<p>"ek is dom"</p>' ...
8
8
2
[{"id": "G0", "claim": "The dir attribute logic in translate_attributes is written in more than one place and should be consolidated so the value is set just once, outside the loop, when translated_lang is available.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id...
null
translate__translate__5796
translate/translate
5,796
defect
8cb845852e479108fd27e6d1010b7256bb33457d
4769e58bfc5ee168418bbdd04611597a88169622
Fix reconstruction of XLIFF translation file structure with group and file preservation
Fixes the issue where XLIFF translation files lose their `<group>` and `<file>` structure when units are added from one storage to another, particularly affecting Weblate's workflow when updating translations with new source strings. ## Problem The reconstruction of XLIFF translation files produces an incorrect struc...
diff --git a/tests/translate/storage/test_xliff_multifile_groups.py b/tests/translate/storage/test_xliff_multifile_groups.py new file mode 100644 index 0000000000..3d8bd5e6d1 --- /dev/null +++ b/tests/translate/storage/test_xliff_multifile_groups.py @@ -0,0 +1,229 @@ +"""Tests for preserving file and group structure wh...
11
11
4
[{"id": "G0", "claim": "Adding units with a different `file` than the existing ones is not covered: add a test that parses two documents with different `<file>` tags, adds a unit from one to the other, and verifies the resulting `<file>` tags.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": ...
null
translate__translate__5810
translate/translate
5,810
defect
371d118110f2126f1789ed7faaf810a217b4f8c2
82fd1743dc8fc5cdfeb04fb323e2a9005d3ddace
Remove pickle completely from codebase
## Summary Successfully removed pickle completely from the codebase to avoid triggering security scanners. ### Changes Made - [x] Analyze the codebase to understand pickle usage - [x] Remove pickle import from base.py - [x] Replace serialize() method to raise NotImplementedError - [x] Replace parse() method to raise...
diff --git a/tests/translate/storage/test_base.py b/tests/translate/storage/test_base.py index 57fdcedfb5..56d3dbb743 100644 --- a/tests/translate/storage/test_base.py +++ b/tests/translate/storage/test_base.py @@ -19,6 +19,7 @@ """tests for storage base classes.""" import os +import pickle from io import BytesIO ...
3
2
2
[{"id": "G0", "claim": "The test-only store added by this PR uses pickle for serialization; pickle.loads on serialized data is unsafe deserialization of user-provided data, and pickle should be omitted or replaced with a safe format such as JSON.", "category": "security", "verdict": "supported", "priority": "P1", "scop...
null
translate__translate__5811
translate/translate
5,811
defect
fa88300975ef45b640978615e618ad3061803da8
f22e0c751bb70d4787a9e187e873e4dae532acf0
Add support for Nextcloud JSON translation format
- [x] Understand the Nextcloud JSON format structure - [x] Review existing JSON format implementations (WebExtension, i18next, etc.) - [x] Analyze Nextcloud format requirements from issue and comments - [x] Identify key features: `translations` wrapper, plural support with gettext-style keys, `pluralForm` preserv...
diff --git a/tests/translate/storage/test_jsonl10n.py b/tests/translate/storage/test_jsonl10n.py index f56be36a71..f4f9e0ba6b 100644 --- a/tests/translate/storage/test_jsonl10n.py +++ b/tests/translate/storage/test_jsonl10n.py @@ -1545,3 +1545,220 @@ def test_invalid(self): store = self.StoreClass() w...
3
3
1
[{"id": "G0", "claim": "pre-commit reported errors (spelling-check failures) in the PR's German test text should be addressed, most likely by turning spellchecking off for the problematic lines.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The new...
null
translate__translate__5812
translate/translate
5,812
defect
3e51c62c6a8365396b3daf99dc1da28606241187
7b2f97a35776b7be9db9603a827d9b4656dcd84f
Add po2odf converter for direct PO to ODF conversion
## Implementation Complete: po2odf Converter Successfully implemented a direct po2odf converter that eliminates the need to run `po2xliff` followed by `xliff2odf` as two separate steps. ### Changes Made: - [x] Explore the repository structure and understand existing converters - [x] Understand the xliff2odf and po2xl...
diff --git a/pyproject.toml b/pyproject.toml index 84c7710509..802776bc9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -162,6 +162,7 @@ po2json = "translate.convert.po2json:main" po2md = "translate.convert.po2md:main" po2moz = "translate.convert.po2moz:main" po2mozlang = "translate.convert.po2mozlang:main" +p...
1
1
0
[{"id": "G0", "claim": "The convertpo function lacks type annotations, which the coding guidelines call for; add type hints for the parameters and the return type.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
translate__translate__5814
translate/translate
5,814
defect
3972e71f18249b6eb6396716a1ea751e77dfbc3e
e40d51a34601367580fe2dc4687f25cfe669f6db
Add support for RESJSON (JavaScript Resource File) format
Add support for JavaScript Resource File (RESJSON) format ✅ **Implementation Complete** This PR adds full support for the RESJSON (JavaScript Resource File) format to the translate toolkit. ## What is RESJSON? RESJSON is a JSON-based translation format that uses the `_KEY.DATA` syntax to attach metadata to translat...
diff --git a/docs/formats/json.rst b/docs/formats/json.rst index 4816728a68..90c677536a 100644 --- a/docs/formats/json.rst +++ b/docs/formats/json.rst @@ -40,3 +40,4 @@ Following JSON dialects are supported * `gotext <https://pkg.go.dev/golang.org/x/text/cmd/gotext>`_ * `ARB <https://github.com/google/app-resource-bu...
7
6
0
[{"id": "G0", "claim": "The actual key should be extracted directly with `metadata_key[1:].rsplit('.', 1)[0]` instead of the complex loop.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Iterating backwards through the whole string character by c...
null
translate__translate__5815
translate/translate
5,815
defect
efacbfeba03cb566fd3dee4155790242102a0167
563a6fded361cd62bbbe362f0a44b275d3e68fa2
Strip Laravel PHP return prefix from translation keys
- [x] Understand the current behavior and issue - [x] Override `getid()` method in `LaravelPHPUnit` to strip the `return[]->` or `return->` prefix - [x] Override `getlocations()` method in `LaravelPHPUnit` to return stripped keys - [x] Strip surrounding quotes from keys after removing prefix - [x] Override `setid()` me...
diff --git a/tests/translate/storage/test_php.py b/tests/translate/storage/test_php.py index 7b2a30be90..dae596c1d1 100644 --- a/tests/translate/storage/test_php.py +++ b/tests/translate/storage/test_php.py @@ -1296,3 +1296,132 @@ def test_plurals(self): assert bytes(phpfile).decode() == phpsource php...
6
5
5
[{"id": "G0", "claim": "Stripping the return prefix in getid() will break serialization; round trip tests should be added and the breakage addressed.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1", "claim": "The default array syntax chosen in setid() should ma...
null
translate__translate__5816
translate/translate
5,816
defect
efacbfeba03cb566fd3dee4155790242102a0167
c92321ceb32515852ad1bd1763f2a838c1dfefd1
Fix plural form handling in ts2po and po2ts converters with intelligent (s) notation merging
Fix plural form handling in ts2po and po2ts converters with intelligent (s) notation merging ## Problem Solved The ts2po and po2ts converters now properly handle plural forms as reported in the issue, including intelligent merging of singular and plural forms into Qt TS format's (s) notation. ## Changes Made ### ts2...
diff --git a/tests/translate/convert/test_po2ts.py b/tests/translate/convert/test_po2ts.py index 58f1758a51..00dfb66f80 100644 --- a/tests/translate/convert/test_po2ts.py +++ b/tests/translate/convert/test_po2ts.py @@ -143,6 +143,41 @@ def test_linebreak_consecutive(self): in tsfile ) + def t...
3
3
2
[{"id": "G0", "claim": "The po2ts converter should merge PO msgid/msgid_plural forms that differ only by an (s)-style suffix into a single (s)-notation source during conversion, instead of using msgid_plural as-is, and the tests should expect that output.", "category": "correctness", "verdict": "supported", "priority":...
null
translate__translate__5819
translate/translate
5,819
defect
b9b97f5b0d49e1f0f3a23fe6ad9531c65820c2bc
2de22d41097914c6badc42eb8a5b6628ef1c46cc
Combine DTD parser portions into a single method
This PR refactors the DTD file parsing logic by moving the parsing implementation from the unit level (`dtdunit.parse()`) to the file level (`dtdfile.parse()`), consolidating parsing into a single method and eliminating the legacy two-parser architecture. ## Changes Made - **Removed** `dtdunit.parse()` method entirel...
diff --git a/translate/storage/dtd.py b/translate/storage/dtd.py index 10d4928d6a..087575a41d 100644 --- a/translate/storage/dtd.py +++ b/translate/storage/dtd.py @@ -294,199 +294,60 @@ def istranslatable(self): return getattr(self, "entityparameter", None) != "SYSTEM" and not self.isblank() def parse(s...
18
13
5
[{"id": "G0", "claim": "When entitytype is 'external', the local entityparameter is initialized but never assigned to the dtdunit instance, so external entities do not get entityparameter initialized on the unit; initialize newdtd.entityparameter instead.", "category": "correctness", "verdict": "supported", "priority":...
null
translate__translate__5821
translate/translate
5,821
defect
773fb012fce6b9b91534cfad97d2840dfd44b2d7
03787c07d041aa2d774bf481200e94f852377c0c
Fix comment preservation in XWiki deprecated blocks (regression from PR #5788)
Fix regression from PR #5788 where comments inside deprecated blocks are not preserved correctly ## Summary Fixed the regression from PR #5788 by properly handling comments that appear before and after deprecated block markers (#@deprecatedstart and #@deprecatedend). The solution splits comments at marker positions an...
diff --git a/tests/translate/storage/test_properties.py b/tests/translate/storage/test_properties.py index 89817b0c1e..78bfcc9983 100644 --- a/tests/translate/storage/test_properties.py +++ b/tests/translate/storage/test_properties.py @@ -1002,21 +1002,27 @@ def test_deprecated_comments_preserved(self): #@deprecateden...
7
6
3
[{"id": "G0", "claim": "Add a regression test based on the one in the Weblate repository so that this regression would be caught here as well, fix the coding style issues (install pre-commit and run `pre-commit check --all-files`), and review the code changes to make simplifications.", "category": "testing", "verdict":...
null
translate__translate__5830
translate/translate
5,830
defect
4b9f68bf703ee95d85611e20b73e20b7f3ff4139
997a2eb47455562f40e976b787ac212a485a5ff4
Support monolingual CSV files without source column
Fix monolingual CSV handling - [x] Understand the problem: CSV files require 'source' column, preventing monolingual use - [x] Run existing tests to verify current behavior - [x] Create test to demonstrate the issue - [x] Modify `valid_fieldnames()` to accept monolingual CSV files - [x] Add proper tests for monolingua...
diff --git a/tests/translate/storage/test_csvl10n.py b/tests/translate/storage/test_csvl10n.py index 2eed18eace..5608cfb225 100644 --- a/tests/translate/storage/test_csvl10n.py +++ b/tests/translate/storage/test_csvl10n.py @@ -190,3 +190,56 @@ def test_encoding_save(self): assert len(store.units) == 1 ...
4
4
0
[{"id": "G0", "claim": "The docstring and inline comment should say that passing None to DictReader makes it use the first row as field names rather than saying it 'auto-detects' the header.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The FIXME...
null
translate__translate__5871
translate/translate
5,871
defect
afbea284107892709cdad93dbd7ca1ad61943026
d927a49a6136ed1d326b7b57d1799d30196924b0
feat(html): use ID for automatic msgctxt deduplication instead of full DOM tree when available
Follow-up to <https://github.com/translate/translate/pull/5867>. Suggested in <https://github.com/translate/translate/issues/4369>. > `{filename}:{element_id}` if an ID is present? Ideally, if the element is a child of an element with an id, the path should be `{filename}:{element_id}:{tag}:{pos}` This automa...
diff --git a/docs/formats/html.rst b/docs/formats/html.rst index 185646a2ea..6491441416 100644 --- a/docs/formats/html.rst +++ b/docs/formats/html.rst @@ -157,6 +157,15 @@ cases using the ``data-translate-context`` attribute. Its value becomes the same ``msgid``, without the excessively differentiated contexts from au...
9
8
6
[{"id": "G0", "claim": "The PR introduces a msgctxt for every string instead of only for strings that appear multiple times, so with standard gettext behavior all these strings will have to be retranslated, and duplicating location into context is undesirable.", "category": "correctness", "verdict": "supported", "prior...
null
translate__translate__5916
translate/translate
5,916
defect
70543081fa19e92a491f3b99460446f2a741302c
f9facc12b262f64be95bf3b980536d0aeadccdb5
Fix .strings file parsing with C-style comments
## Summary Fixed parsing of .strings files with C-style comments. Previously, inline comments like `/*description*/` at the end of a line caused the parser to incorrectly treat the next line as a continuation, merging multiple units into one. .strings files follow C syntax, so comments can now appear anywhere in the ...
diff --git a/tests/translate/storage/test_properties.py b/tests/translate/storage/test_properties.py index 87450acfee..36ce6f1c63 100644 --- a/tests/translate/storage/test_properties.py +++ b/tests/translate/storage/test_properties.py @@ -664,6 +664,24 @@ def test_mac_strings_comments_dropping(self): assert pr...
10
9
2
[{"id": "G0", "claim": "The dialect base class should always define extract_inline_comment (no-op by default) instead of the parser probing for it with hasattr.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "is_line_continuation duplicates the inline-com...
null
translate__translate__5956
translate/translate
5,956
defect
620489f687e6ae30760a8c17007f53530d773d75
43c7167955608e21d47ca4dc108deff9addb817f
chore: use inheritance to share methods
This is a better approach than manually setting the perse attribute.
diff --git a/translate/storage/placeables/general.py b/translate/storage/placeables/general.py index ff7ff9debd..fe2376f267 100644 --- a/translate/storage/placeables/general.py +++ b/translate/storage/placeables/general.py @@ -25,7 +25,8 @@ import re -from translate.storage.placeables.base import G, Ph, StringElem...
3
2
0
[{"id": "G0", "claim": "The type annotation for the regex attribute should be `re.Pattern[str] | None` instead of `re.Pattern`, because the parse method checks `if cls.regex is None`, and the `[str]` type parameter should be included for better type safety.", "category": "maintainability", "verdict": "supported", "prio...
null
translate__translate__5963
translate/translate
5,963
defect
1d10e18a73b1f21fb77cfdbb6043dc39a782ac1f
791a7c39a17a309a3cc90a21ad1161811e568dee
Optimize pocount.calcstats with single-pass iteration
- [x] Analyze the pocount.calcstats performance issue - [x] Identify bottlenecks: multiple iterations through units list - [x] Optimize calcstats to use single-pass iteration - [x] Fix unit categorization logic to match original behavior - [x] Remove unused helper functions (translatedmessages, fuzzymessages, untransla...
diff --git a/translate/tools/pocount.py b/translate/tools/pocount.py index 21f3ee0af0..5647e0c51e 100644 --- a/translate/tools/pocount.py +++ b/translate/tools/pocount.py @@ -156,55 +156,50 @@ def calcstats(filename): logger.warning("Error in %s: %s", filename, e) return {} - units = [unit for un...
3
2
0
[{"id": "G0", "claim": "The helper functions such as `translatedmessages` that the single-pass rewrite left unused should be removed.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The rewritten elif categorization could mis-count units that are...
null
translate__translate__5964
translate/translate
5,964
defect
62508f5220f0bda7798668ab4ef130a71f961dce
e44781dcf887496bf3a341854be8585f4fa5c971
Fix substring replacement in po2txt when using templates
## Fix txt2po handling of line feeds around text block ### Plan: - [x] Verify and reproduce the issue with test case - [x] Analyze the root cause in po2txt.py merge_stores() method - [x] Implement fix: Sort units by source length (descending) before replacement - [x] Add test case to test_po2txt.py to prevent regressi...
diff --git a/tests/translate/convert/test_po2txt.py b/tests/translate/convert/test_po2txt.py index b80562ccdf..4a7aeb55be 100644 --- a/tests/translate/convert/test_po2txt.py +++ b/tests/translate/convert/test_po2txt.py @@ -177,6 +177,33 @@ def test_convert_completion_above_threshold(self) -> None: ) a...
2
2
1
[{"id": "G0", "claim": "The multiple checks combined in the single conditional expression in merge_stores() should be broken up (into intermediate variables or a helper method) because it is hard to understand and maintain.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"...
null
translate__translate__5968
translate/translate
5,968
defect
6618902930141839270bcbfa7513f57fa1f30f0e
6081106ec169fdbc30e13ced873b3f25f6b6d732
Preserve SSA/ASS style metadata in subtitle file serialization
## Fix sub2po to preserve style field for .ass/.ssa subtitle files - [x] Explore repository structure and understand the issue - [x] Identify root cause: SubtitleUnit doesn't preserve SSA container with style info - [x] Modify SubtitleUnit to store SSA container metadata (style, layer, margins, etc.) - [x] Update _par...
diff --git a/tests/translate/storage/test_subtitles.py b/tests/translate/storage/test_subtitles.py index da2883ec12..4c87ceb88d 100644 --- a/tests/translate/storage/test_subtitles.py +++ b/tests/translate/storage/test_subtitles.py @@ -40,6 +40,86 @@ class TestMicroDVDFile(TestSubRipFile): class TestAdvSubStationAlphaF...
4
3
0
[{"id": "G0", "claim": "The pull request's changes have linting and test suite issues that need to be fixed.", "category": "correctness", "verdict": "uncertain", "priority": "P0", "scope": "introduced"}, {"id": "G1", "claim": "The set_ssa_metadata parameters lack type annotations, which the custom coding guidelines req...
null
translate__translate__5970
translate/translate
5,970
defect
6618902930141839270bcbfa7513f57fa1f30f0e
f5adb8fbd5cdaf558718a0d86fe245cf67a5d701
Add fuzzy flag clearing to podebug --rewrite=blank
## Plan: Test and Document podebug --rewrite=blank Based on the issue requirements and review feedback: - [x] Explore the repository structure and locate podebug files - [x] Understand current `--rewrite=blank` implementation - [x] Test current behavior with translations, fuzzy entries, and plurals - [x] Enhance blan...
diff --git a/docs/commands/option_rewrite.rst b/docs/commands/option_rewrite.rst index 51fbe025f5..54f1e98f0c 100644 --- a/docs/commands/option_rewrite.rst +++ b/docs/commands/option_rewrite.rst @@ -44,16 +44,39 @@ derived translation such as British English. It produces the same results as blank ===== -This simpl...
4
4
0
[{"id": "G0", "claim": "The fuzzy-flag clearing block would flow more logically if moved to run immediately before the `unit.rich_target = add_prefix(prefix, rich_string)` assignment.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The plural-for...
null
translate__translate__5971
translate/translate
5,971
defect
6618902930141839270bcbfa7513f57fa1f30f0e
b504f9ab04cd5e58e734fa24f3764f14fc85a10d
Fix po2html entity mismatch between template and PO file
## Summary Applied changes based on code review feedback: ### Changes Made 1. **Added type annotations** to the `lookup` method in `translate/convert/po2html.py`: - `def lookup(self, string: str) -> str:` 2. **Improved test assertions** in `tests/translate/convert/test_po2html.py`: - **Case 1**: Verify ampers...
diff --git a/tests/translate/convert/test_po2html.py b/tests/translate/convert/test_po2html.py index 8ef7e26b61..12a4bd301a 100644 --- a/tests/translate/convert/test_po2html.py +++ b/tests/translate/convert/test_po2html.py @@ -115,6 +115,48 @@ def test_entities(self) -> None: htmlexpected = "<p>Vis &amp; skyfi...
2
2
0
[{"id": "G0", "claim": "The new test's assertions only check that the translation appears in the output and should also add assertions verifying how the HTML entities/symbols (&amp;, &lt;, &gt;) from the template or the PO translation are represented in the final HTML output.", "category": "testing", "verdict": "suppor...
null
translate__translate__5972
translate/translate
5,972
defect
6618902930141839270bcbfa7513f57fa1f30f0e
ff1a3f7ad51b635c965d1bed98e187970af9c94d
Fix po2txt using segment-based replacement instead of full-text replace
- [x] Understand the issue and initial feedback - [x] Implement initial fix with count=1 parameter - [x] Receive feedback that fix is insufficient - [x] Understand that proper solution requires segment-based replacement - [x] Revert count=1 fix - [x] Implement segment-based replacement using TxtFile parsing - [x] Add c...
diff --git a/tests/translate/convert/test_po2txt.py b/tests/translate/convert/test_po2txt.py index 9d0787e91a..ec5241995c 100644 --- a/tests/translate/convert/test_po2txt.py +++ b/tests/translate/convert/test_po2txt.py @@ -204,6 +204,70 @@ def test_substring_replacement(self) -> None: vor-Konstrukteur""" # codespell:...
3
2
2
[{"id": "G0", "claim": "The duplicate-replacement issue appears to already be fixed by the pre-existing length-based sorting, even without this patch.", "category": "correctness", "verdict": "opposed", "priority": "P3", "scope": "pre_existing"}, {"id": "G1", "claim": "The `, 1` first-occurrence-only replacement is insu...
null
translate__translate__5973
translate/translate
5,973
defect
6618902930141839270bcbfa7513f57fa1f30f0e
46d4abf032b53d6395556435c9de528cf0fe4064
Fix handling of values with no key in properties files
- [x] Understand the issue: `=value` extracts correctly but doesn't merge back - [x] Verify current behavior with test - [x] Fix prop2po to use special marker for empty keys - [x] Fix po2prop to handle special marker - [x] Add tests for the fix - [x] Run existing tests to ensure no regressions - [x] Address code review...
diff --git a/tests/translate/convert/test_po2prop.py b/tests/translate/convert/test_po2prop.py index 0694f72401..629882b5b4 100644 --- a/tests/translate/convert/test_po2prop.py +++ b/tests/translate/convert/test_po2prop.py @@ -94,6 +94,15 @@ def test_no_separator(self) -> None: print(propfile) assert ...
2
2
0
[{"id": "G0", "claim": "Both converters should share the EMPTY_KEY_MARKER constant (defined once and imported) so that it is ensured to be the same.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The pre-commit linting errors in the added code s...
null
translate__translate__5974
translate/translate
5,974
defect
6618902930141839270bcbfa7513f57fa1f30f0e
eff3141ea2811fec1eecdf11dd6af0e73d65d485
Fix parsing of whitespace delimiters in Java properties files
- [x] Understand the issue with whitespace delimiters in Java .properties files - [x] Update `find_delimiter` method to recognize any whitespace (not just space) as a delimiter for parsing - [x] Keep output simple - normalize to standard format (no whitespace preservation) - [x] Add tests for tab delimiter parsing (bot...
diff --git a/tests/translate/storage/test_properties.py b/tests/translate/storage/test_properties.py index 96a82744de..9009b4ca8d 100644 --- a/tests/translate/storage/test_properties.py +++ b/tests/translate/storage/test_properties.py @@ -501,6 +501,29 @@ def test_key_value_delimiters_simple(self) -> None: ...
3
3
1
[{"id": "G0", "claim": "The pull request should not preserve whitespace in delimiters on output (complex logic not worth maintaining); it should instead correctly parse all valid Java properties files, treating any whitespace character as a valid delimiter, and this should apply only to the Java dialect.", "category": ...
null
translate__translate__5977
translate/translate
5,977
defect
6618902930141839270bcbfa7513f57fa1f30f0e
3174bd6a6ad18a04ee7c1cfca630ebf7ea8112b2
Add line numbers to csv2po error messages
## Plan: Add line numbers to csv2po error messages - [x] Explore repository structure and understand csv2po implementation - [x] Modify csvl10n.csvunit to store line number information during parsing - [x] Update csvl10n.csvfile.parse() to track and store line numbers for each unit - [x] Update csv2po.handlecsvunit() ...
diff --git a/tests/translate/convert/test_csv2po.py b/tests/translate/convert/test_csv2po.py index 6217e98692..3065023005 100644 --- a/tests/translate/convert/test_csv2po.py +++ b/tests/translate/convert/test_csv2po.py @@ -139,6 +139,30 @@ def test_escaped_newlines(self) -> None: assert pofile.findunit("yellow...
4
4
1
[{"id": "G0", "claim": "When the CSV file has no name (e.g. created from BytesIO), _get_csv_location produces error messages like \" line 2\" instead of \"(unknown) line 2\"; handle empty-string filenames with getattr(...) or \"(unknown)\".", "category": "correctness", "verdict": "supported", "priority": "P1", "scope":...
null
translate__translate__5980
translate/translate
5,980
defect
f9d335cb49be798f46bf9099c4df3ef0183e148d
244d05b32b55f9313f7e62c4c6534ec871fbdf67
Add line number tracking to translation units
- [x] Add `getlinenumber()` method to base `TranslationUnit` class in base.py - [x] Update CSV implementation to use the new base class method - [x] Implement line number tracking in pypo parser and unit classes - [x] Add tests for line number functionality - [x] Validate changes with existing tests - [x] Verify line n...
diff --git a/tests/translate/storage/test_base.py b/tests/translate/storage/test_base.py index 38c7723ad7..40d95366a3 100644 --- a/tests/translate/storage/test_base.py +++ b/tests/translate/storage/test_base.py @@ -226,6 +226,11 @@ def test_note_sanity(self) -> None: actual_notes = unit.getnotes() ass...
6
6
5
[{"id": "G0", "claim": "The PR should expose the line number as a `line_number` property backed by a class variable initialized to `None` in the base class and updated in subclasses, instead of the `getlinenumber()` method.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id":...
null
translate__translate__5995
translate/translate
5,995
defect
25e603ae4068f32f10a11b88c25ade25c7285f10
0c7c993c6bdabc937cd6c68a20b4f6042b6cc5ae
chore(storage): remove directory and zipfile storages
These were not really a storages and passing directory to `factory.getobject()` might have unexpected consequences as consumers expect storage there. Issue #4018
diff --git a/docs/api/storage.rst b/docs/api/storage.rst index e833de76af..bced237e17 100644 --- a/docs/api/storage.rst +++ b/docs/api/storage.rst @@ -53,14 +53,6 @@ csvl10n :inherited-members: -directory ---------- - -.. automodule:: translate.storage.directory - :members: - :inherited-members: - - dtd -...
1
1
0
[{"id": "G0", "claim": "The error message \"Directories are not supported!\" should be more descriptive and helpful, providing context about what was attempted and suggesting alternatives.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
translate__translate__6063
translate/translate
6,063
defect
4768ef944571a6c5e61903aa34e157e71f98cd2f
01e6864cb66a63f06c58690afd947fcc96b59338
Add tests for Trados storage and fix parsing issues
The Trados TM storage implementation lacked test coverage. Testing revealed three bugs in the parsing code. ## Tests Added - **TradosTxtDate**: Timestring parsing, time struct handling, initialization modes - **TradosUnit**: Source/target access, RTF escape sequences (endash, quotes, NBSP) - **TradosTxtTmFile**: Sing...
diff --git a/tests/translate/storage/test_trados.py b/tests/translate/storage/test_trados.py index f8eec59ee1..fe118fa95a 100644 --- a/tests/translate/storage/test_trados.py +++ b/tests/translate/storage/test_trados.py @@ -1,5 +1,9 @@ +import time + from pytest import importorskip +from . import test_base + trados ...
1
1
0
[{"id": "G0", "claim": "The import of 'test_base' on line 5 of tests/translate/storage/test_trados.py is unused and should be deleted.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
translate__translate__6087
translate/translate
6,087
defect
688fce65eff0a433965c24aaa3dc2b714ab49482
20a99e08a2b49e455eb3408f2a94492ce553e97a
feat: add arb2po command
Examples: ``` mkdir -p /tmp/arb_test/openfoodfacts /tmp/arb_test/converternow curl -sL -o /tmp/arb_test/openfoodfacts/app_en.arb "https://raw.githubusercontent.com/openfoodfacts/smooth-app/refs/heads/develop/packages/smooth_app/lib/l10n/app_en.arb" curl -sL -o /tmp/arb_test/openfoodfacts/app_ca.arb "https://raw.g...
diff --git a/docs/commands/arb2po.rst b/docs/commands/arb2po.rst new file mode 100644 index 0000000000..ecd7f41965 --- /dev/null +++ b/docs/commands/arb2po.rst @@ -0,0 +1,71 @@ + +.. _arb2po: + +arb2po +****** + +Converts ARB (Application Resource Bundle) files to Gettext PO format. + +ARB is a JSON-based localization ...
2
2
1
[{"id": "G0", "claim": "In merge_store's `elif translatedpo is not None` branch, the error log references `origpo.name` while `origpo` is always None there, so the statement would raise if executed; it should log `template_unit_name` or similar instead.", "category": "correctness", "verdict": "supported", "priority": "...
null
translate__translate__6088
translate/translate
6,088
defect
688fce65eff0a433965c24aaa3dc2b714ab49482
3c98c74dbf51171fca4411dc4201c0bac0cf1b5b
feat: add fluent2po command
Example: ``` curl -sL https://raw.githubusercontent.com/ankitects/anki-core-i18n/refs/heads/main/core/templates/search.ftl -o /tmp/search_template.ftl curl -sL https://raw.githubusercontent.com/ankitects/anki-core-i18n/refs/heads/main/core/ca/search.ftl -o /tmp/search_ca.ftl fluent2po -t /tmp/search_template.ftl ...
diff --git a/docs/commands/fluent2po.rst b/docs/commands/fluent2po.rst new file mode 100644 index 0000000000..7d27455500 --- /dev/null +++ b/docs/commands/fluent2po.rst @@ -0,0 +1,74 @@ + +.. _fluent2po: + +fluent2po +********* + +Converts Fluent (.ftl) files to Gettext PO format. + +`Fluent <https://projectfluent.org/...
2
2
1
[{"id": "G0", "claim": "Remove the unused 'import logging' and 'logger = ...' lines (or actually use the logger for an error path), since they are never used in the module and will trigger lint failures such as F401.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id...
null
translate__translate__6094
translate/translate
6,094
defect
9c6fa120d1ac23ffb9a106452e0bc89d3130aac6
7746eb1462974e1f0ef331036c0fb6f7bc6a6c49
Add logical document path (docpath) to HTML and Markdown units
- [x] Understand the problem: HTML and Markdown formats need a stable "logical location" (document path) that doesn't change between translations - [x] Add `getdocpath()` / `setdocpath()` methods to base `TranslationUnit` class (returns empty string by default) - [x] Add `docpath` support to `htmlunit` class in `html.p...
diff --git a/tests/translate/storage/test_html.py b/tests/translate/storage/test_html.py index 955de7f552..90f9cc25b0 100644 --- a/tests/translate/storage/test_html.py +++ b/tests/translate/storage/test_html.py @@ -582,3 +582,78 @@ def test_data_translate_comment_attribute(self) -> None: assert store.units[0]....
4
4
1
[{"id": "G0", "claim": "In `_build_docpath` and `_enter_heading`, the heading parts should be built with a list comprehension that binds `level` instead of an underscore-prefixed loop variable, as suggested in both places.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}...
null
translate__translate__6104
translate/translate
6,104
defect
f982e94a7c2fdb60a6697682a9727a237bc95a5c
d50eaf298399a45ba13100be4da541716697fefc
Add support for Apple XLIFF plural format
## Apple XLIFF Plural Support Implementation Plan - [x] Explore repository structure and understand existing XLIFF and stringsdict implementations - [x] Understand Apple XLIFF plural format specification - [x] Design the implementation approach - [x] Created AppleStringsXliffUnit extending Xliff1Unit - [x] Created...
diff --git a/docs/formats/strings.rst b/docs/formats/strings.rst index bcd07ebfe5..c683663fea 100644 --- a/docs/formats/strings.rst +++ b/docs/formats/strings.rst @@ -13,6 +13,26 @@ po2prop are used for conversion. This format is standardized as PWG 5100.13 and used on NeXTSTEP/OpenSTEP as well. +.. _strings#strin...
7
6
2
[{"id": "G0", "claim": "The import of 'base' in translate/storage/applestrings_xliff.py is unused and should be removed, leaving 'from translate.storage import xliff'.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The import of 'BytesIO' in tes...
null
translate__translate__6112
translate/translate
6,112
defect
75e2bae9c6462df9d9bfdb589934ce19836bde52
16f48e9dc19989373f1dec5c425800712993fea5
wxl2po: implement proper template (merge) support
- [x] Analyze existing wxl2po and rc2po patterns - [x] Add `merge_store()` method to `wxl2po` class for template handling - [x] Update `__init__` to store `templatefile` - [x] Update `run()` to call `merge_store()` when templatefile is provided - [x] Update `formats` dict to include `("wxl", "wxl"): ("po", run_converte...
diff --git a/tests/translate/convert/test_wxl2po.py b/tests/translate/convert/test_wxl2po.py index 4c89a258ff..cabfe3fe8b 100644 --- a/tests/translate/convert/test_wxl2po.py +++ b/tests/translate/convert/test_wxl2po.py @@ -20,6 +20,14 @@ class TestWxl2PO: <String Id="WixUIBack">Voltar</String> <String Id="WixUICa...
2
2
1
[{"id": "G0", "claim": "The new template merge may not work as expected for non-translatable units (UI elements without a text) and XML comments — the converted output should exactly match the input with only the translatable text changed — and tests verifying the full output text against that expectation should be add...
null
translate__translate__6113
translate/translate
6,113
defect
75e2bae9c6462df9d9bfdb589934ce19836bde52
bcaa489f3e4f6a0b3be94792b586db7b104fc40d
Fix wxl2po BOM handling and expose wxl2po/po2wxl as installed commands
- [x] Fix `_detect_encoding` in `wxl.py` to detect UTF-8 BOM (`\xef\xbb\xbf`) and UTF-16 BOM, returning the correct encoding before any other checks - [x] Fix `parse` in `wxl.py` to not re-parse based on Codepage when encoding was determined authoritatively from a BOM or XML declaration - [x] Add `wxl2po` and `po2wxl` ...
diff --git a/pyproject.toml b/pyproject.toml index b420edbad1..d094473d65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -176,6 +176,7 @@ po2ts = "translate.convert.po2ts:main" po2txt = "translate.convert.po2txt:main" po2web2py = "translate.convert.po2web2py:main" po2wordfast = "translate.convert.po2wordfast:ma...
6
1
0
[{"id": "G0", "claim": "Fix the linting errors found by running `pre-commit run --all-files`.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Add type annotations to the new code (check with `ty check`).", "category": "maintainability", "verdict"...
null
translate__translate__6134
translate/translate
6,134
defect
b81245325b347c7c8c46bd4936cb59f8c364df7a
1f3960ac1a3b05296455e9a6c5d55368b6e21b83
Improve Apple strings round trip: preserve comments and blank lines
- [x] Understand the issue: Apple .strings files drop `/* No comment provided by engineer. */` comments and lose single blank lines between entries during round-trip - [x] Fix 1: Stop dropping `/* No comment provided by engineer. */` comment during parsing (remove from `drop_comments`), but filter it from `getnotes()` ...
diff --git a/tests/translate/storage/test_properties.py b/tests/translate/storage/test_properties.py index ed59ac53cc..0468719a15 100644 --- a/tests/translate/storage/test_properties.py +++ b/tests/translate/storage/test_properties.py @@ -693,15 +693,21 @@ def test_mac_strings_multilines_comments(self) -> None: ...
4
4
2
[{"id": "G0", "claim": "The test's propsource should be written with a real newline instead of escaped \\n sequences in the triple-quoted literal, as proposed in the suggestion block.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The trailing \...
null
translate__translate__6168
translate/translate
6,168
defect
b2c1ba9b14ad4fb35599610b94fa0fb50222d701
ee44395f8f3abb6583b7fee539e58ef441da3b79
feat(android): preserve XML formatting
Android can use both escaped and unescaped XML depending on the used SDK API. The used formatting is now preserved and can be forcibly set when saving.
diff --git a/tests/translate/storage/test_aresource.py b/tests/translate/storage/test_aresource.py index af900bb556..23c0909be7 100644 --- a/tests/translate/storage/test_aresource.py +++ b/tests/translate/storage/test_aresource.py @@ -284,6 +284,22 @@ def test_parse_html_code(self) -> None: xml = '<string name...
2
1
0
[{"id": "G0", "claim": "In the singular branch of the target setter, the isinstance(target, list) check is unreachable because hasplurals() already routes lists to the plural branch, making the control flow misleading; remove the list handling there.", "category": "design", "verdict": "supported", "priority": "P2", "sc...
null
translate__translate__6170
translate/translate
6,170
defect
250eb5a86b102f25fe689804e06a8ea6f7195f57
c1b73b1f03fdefa19148d941ad06d25db8585b54
chore: consolidate xml parsing code
- use exclusively lxml - consistenly initialize parser
diff --git a/docs/api/misc.rst b/docs/api/misc.rst index 41e0fbc1e9..578ede69bb 100644 --- a/docs/api/misc.rst +++ b/docs/api/misc.rst @@ -36,15 +36,6 @@ optrecurse :members: :inherited-members: - -ourdom ------- - -.. automodule:: translate.misc.ourdom - :members: - :inherited-members: - - progressbar ...
2
2
1
[{"id": "G0", "claim": "For input TS files that lack a doctype, getxml() still emits \"<!DOCTYPE TS>\", contradicting the stated goal of preserving the original declaration shape and changing round-tripped output; the doctype should be tracked as optional and only passed to etree.tostring() when the parsed input actual...
null
translate__translate__6171
translate/translate
6,171
defect
250eb5a86b102f25fe689804e06a8ea6f7195f57
a0996bc90114962797573d810e207032f28190b5
fix(storage): apply limits on zip processing
This reduces risk of processing crafted zip files that could cause problems.
diff --git a/tests/translate/storage/test_idml.py b/tests/translate/storage/test_idml.py new file mode 100644 index 0000000000..fe7703933c --- /dev/null +++ b/tests/translate/storage/test_idml.py @@ -0,0 +1,52 @@ +from zipfile import ZIP_DEFLATED, ZipFile + +import pytest + +from translate.storage import idml + + +def ...
3
1
1
[{"id": "G0", "claim": "The new ODF and IDML tests reference MAX_ARCHIVE_MEMBER_SIZE / MAX_ARCHIVE_TOTAL_SIZE through the odf_io and idml modules, which do not define those names, so the tests will fail with AttributeError before exercising the size-limit behavior; the constants should be imported from translate.misc.z...
null
translate__translate__6181
translate/translate
6,181
defect
2d083c4ee9856b79134ed7b9dd41976b7f84faff
563cb33b3f48b33f183e1e9a6397d3fa726574b3
Fix po2yaml losing keys when converting PO files built with --duplicates=merge
- [x] Fix `po2yaml` to handle PO files created with `--duplicates=merge` - [x] Modify `convert_unit` in `po2yaml.py` to accept an optional `unit_id` parameter - [x] Modify `merge_stores` to pass the template unit's ID to `convert_unit` - [x] Add type annotations to `convert_unit` signature - [x] Add tests for t...
diff --git a/tests/translate/convert/test_po2yaml.py b/tests/translate/convert/test_po2yaml.py index 25304d865f..2bc7486ee2 100644 --- a/tests/translate/convert/test_po2yaml.py +++ b/tests/translate/convert/test_po2yaml.py @@ -197,6 +197,47 @@ def test_convert_completion_above_threshold(self) -> None: ) ...
1
1
0
[{"id": "G0", "claim": "Type annotations should be added to the new code in convert_unit in po2yaml.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
translate__translate__6187
translate/translate
6,187
defect
1f9e5c1e53c3cf3998969d276d2b5aeb7eee997d
b728ef023ea2ffb0530bee5372edd289ba7317c4
fix(poxliff): imporove plural handling
- do not treat units outside group as a plurals - gracefully handle switching betwen plural and singular units
diff --git a/tests/translate/storage/test_poxliff.py b/tests/translate/storage/test_poxliff.py index 0035e4ad04..21a64912d3 100644 --- a/tests/translate/storage/test_poxliff.py +++ b/tests/translate/storage/test_poxliff.py @@ -1,3 +1,5 @@ +from lxml import etree + from translate.misc.multistring import multistring fr...
5
5
3
[{"id": "G0", "claim": "If a plural group has no trans-unit children, nextplural.units stays empty and the iterator never advances, which can prevent later plural groups from ever being added — advance nextplural in a loop until it is None or has at least one unit.", "category": "correctness", "verdict": "supported", "...
null
translate__translate__6192
translate/translate
6,192
defect
a3f5cc9c6b03f9c7aa238c0f9e4c804c08b37584
4f292812640f432a293ce1d094af59d8dcc03fc0
chore(properties): refactor parser
Split out parser and fix corner case on parsing comments.
diff --git a/tests/translate/storage/test_properties.py b/tests/translate/storage/test_properties.py index 3e75960783..23637eb511 100644 --- a/tests/translate/storage/test_properties.py +++ b/tests/translate/storage/test_properties.py @@ -454,6 +454,19 @@ def test_space(self) -> None: store.units[1].source = "...
1
1
0
[{"id": "G0", "claim": "In `_consume_comment_line`, the final `elif state.in_multiline_comment and comment_end is not None:` branch is unreachable because the earlier `if` with the same condition already returns after handling it, so the redundant branch should be removed as dead code.", "category": "maintainability", ...
null
translate__translate__6208
translate/translate
6,208
defect
fdcb81af2e94c92b42331c69e377af9f2070fdac
3130614d64fe300587b3e640ea8cf31f53c1c733
feat(markdown): improve frontmatter handling
- make it regular unit - fixed processing in po2md - make the frontmatter processing optional
diff --git a/tests/translate/convert/test_md2po.py b/tests/translate/convert/test_md2po.py index 82d2171c95..cb988480a8 100644 --- a/tests/translate/convert/test_md2po.py +++ b/tests/translate/convert/test_md2po.py @@ -18,6 +18,7 @@ class TestMD2PO(test_convert.TestConvertCommand): "--duplicates=DUPLICATESTYLE...
2
2
0
[{"id": "G0", "claim": "The front matter unit should be built from self.UnitClass(...) (or addsourceunit) instead of the hard-coded MarkdownUnit(...) so subclasses of MarkdownFile keep working and the unit is created consistently with the store's configured unit type.", "category": "maintainability", "verdict": "suppor...
null
translate__translate__6218
translate/translate
6,218
defect
5f996132d997bc13bf95913a9204a19feb33e338
538cf6c8c5a38dd59bf153047a70b5999272d023
Fix subclass options missing from Usage line in converter help/error output
- [x] Investigate the root cause: `set_usage()` called in `ConvertOptionParser.__init__()` before subclass options are added - [x] Fix by moving `set_usage()` from `__init__()` to `run()`, following the same pattern as pogrep/poterminology/poconflicts/porestructure - [x] Add test for `--no-code-blocks` CLI option in `t...
diff --git a/tests/translate/convert/test_md2po.py b/tests/translate/convert/test_md2po.py index 90c2a758bf..59df290f90 100644 --- a/tests/translate/convert/test_md2po.py +++ b/tests/translate/convert/test_md2po.py @@ -115,6 +115,32 @@ def test_markdown_frontmatter_not_extracted_when_disabled(self) -> None: so...
2
2
2
[{"id": "G0", "claim": "The _custom_usage flag is a workaround; the set_usage inheritance issue should be fixed properly (set_usage should run after subclass options are added) rather than papered over with a flag.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "c...
null
translate__translate__6231
translate/translate
6,231
defect
1471cd6b8a7961e652cdac47465954b1b00f5519
5ebc2fc95c3b5967b3fc6c5e64232c4b08ec2d89
Add opt-in --no-placeholders mode to md2po and po2md
The existing `{1}` placeholder-based extraction is a deliberate design decision: it keeps typically non-translatable content (URLs, HTML spans) out of the main translation unit while exposing translatable sub-attributes (e.g. link titles, image titles) as separate units. This PR keeps that behavior as the default and a...
diff --git a/tests/translate/convert/test_md2po.py b/tests/translate/convert/test_md2po.py index 59df290f90..422c5c2961 100644 --- a/tests/translate/convert/test_md2po.py +++ b/tests/translate/convert/test_md2po.py @@ -169,24 +169,28 @@ def then_po_file_is_written(self) -> str: return content def test_m...
2
2
2
[{"id": "G0", "claim": "Calling translate_callback with expanded_content_md can make PO lookups miss for links/images that have separately translated metadata, producing a mixed source/target string that no longer matches the extracted msgid and causing po2md to skip a full-paragraph translation that is present in the ...
null
translate__translate__6234
translate/translate
6,234
defect
1471cd6b8a7961e652cdac47465954b1b00f5519
fd3342f8bbee2c56b8e0f35f7b5fac9df466eceb
feat(android): expose more detailed target markup state
This allows more fine-grained control when serializing.
diff --git a/tests/translate/storage/test_aresource.py b/tests/translate/storage/test_aresource.py index ee9061215e..d9221e197c 100644 --- a/tests/translate/storage/test_aresource.py +++ b/tests/translate/storage/test_aresource.py @@ -1,5 +1,6 @@ from copy import copy, deepcopy +import pytest from lxml import etree...
4
4
4
[{"id": "G0", "claim": "Escaped namespaced tags (e.g. an xliff prefix declared only on <resources>) are misclassified as plain text because the bare-wrapper parse fails with an unknown-prefix XMLSyntaxError, so on later target writes the same literal text can be reinterpreted as real XML markup, changing serialized out...
null
translate__translate__6241
translate/translate
6,241
defect
f06f06d21df3e5e7bfac3343b267cf4be6def83a
b625260229bd9b70965995f2f1c2174c6c7662ab
fix(fluent): use specific exception on serialization error
Generic TypeError makes it impossible to catch it.
diff --git a/tests/translate/storage/test_fluent.py b/tests/translate/storage/test_fluent.py index cd6885e9cb..99ccf2e5cc 100644 --- a/tests/translate/storage/test_fluent.py +++ b/tests/translate/storage/test_fluent.py @@ -25,7 +25,7 @@ from pytest import raises -from translate.storage import fluent +from translat...
1
1
1
[{"id": "G0", "claim": "The `to_entry()` docstring still says it raises `ValueError` when the unit source contains an error, but the code now raises `FluentContentError`; update the docstring (and any related docs) to reflect the new exception type so callers know what to catch.", "category": "documentation", "verdict"...
null
transloadit__uppy__3534
transloadit/uppy
3,534
defect
32ea099a93f2a3306f665eb0d62e99b956fc729e
5c830878a71b365c36aecc8a3b0668c59b104775
@uppy/utils: modernize `getDroppedFiles`
`webkitGetAsEntry` is a non-standard/deprecated API, replacing it with `getAsFileSystemHandle` when available. This also work around a Chromium bug with symlinks. Fixes: https://github.com/transloadit/uppy/issues/3505.
diff --git a/packages/@uppy/utils/src/getDroppedFiles/index.js b/packages/@uppy/utils/src/getDroppedFiles/index.js index 499bbc1841..7153ca629f 100644 --- a/packages/@uppy/utils/src/getDroppedFiles/index.js +++ b/packages/@uppy/utils/src/getDroppedFiles/index.js @@ -15,11 +15,16 @@ const fallbackApi = require('./utils/...
1
1
0
[{"id": "G0", "claim": "A test should be added for the modernized getDroppedFiles behavior.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
transloadit__uppy__3591
transloadit/uppy
3,591
defect
431790ee7d910d24b285940b3172b68550ef60c3
9eb8155936fea452075bff63ce2d1813cf43fd9e
@uppy/transloadit: close assembly if upload is cancelled
Fixes: https://github.com/transloadit/uppy/issues/3156
diff --git a/packages/@uppy/transloadit/src/index.js b/packages/@uppy/transloadit/src/index.js index 3c93c86b76..9e0fc60634 100644 --- a/packages/@uppy/transloadit/src/index.js +++ b/packages/@uppy/transloadit/src/index.js @@ -217,6 +217,19 @@ module.exports = class Transloadit extends BasePlugin { ...update...
1
1
1
[{"id": "G0", "claim": "The new assembly-close-on-cancel behaviour should have a test covering it.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null