profile
viewpoint
Christian Clauss cclauss Christian Clauss Switzerland https://www.patreon.com/cclauss Working hard to find and fix bugs in software and to ensure that Python code is properly ported to Python 3. Building related tools and automated systems.

cclauss/500lines 1

500 Lines or Less

cclauss/adapter_pattern 1

Python adapter pattern where adapters are autoloaded from an adapters directory

cclauss/100-Days-Of-ML-Code 0

100 Days of ML Coding

cclauss/12306 0

12306智能刷票,订票

cclauss/2D_detection 0

TensorFlow implementation of SqueezeDet, trained on the KITTI dataset.

cclauss/30-Days-Of-Python 0

A 30 days of python programming challenge

cclauss/3D-SDN 0

[NeurIPS 2018] 3D-Aware Scene Manipulation via Inverse Graphics

cclauss/3dpwn 0

VirtualBox 3D exploits & PoCs

cclauss/AB3DMOT 0

Official python implementation for "A Baseline for 3D Multi-Object Tracking"

cclauss/acai 0

Code for "Understanding and Improving Interpolation in Autoencoders via an Adversarial Regularizer"

pull request commentsivy/pystatsd

Create a GitHub Actions alternative to Travis CI

I use Actions for testing and have never used them to deploy to PyPI.

cclauss

comment created time in 2 hours

delete branch cclauss/pystatsd

delete branch : patch-1

delete time in 2 hours

delete branch cclauss/pystatsd

delete branch : patch-3

delete time in 2 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha 9e180a4d614982fe91d16cebe1a390b4b4ebb484

Fix the link to GitHub Actions results

view details

push time in 2 hours

PR opened sivy/pystatsd

README.md: Link to GitHub Action results, update Py versions
+5 -8

0 comment

1 changed file

pr created time in 2 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha 5ab171d1cdc2ee5f9992bc146b75c860a66db42f

Update README.md

view details

push time in 2 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha 8ee81bb9793cb1196c314191719f43150bfe96d0

README.md: Link to GitHub Action results, update Py versions

view details

push time in 2 hours

delete branch cclauss/pystatsd

delete branch : patch-3

delete time in 2 hours

delete branch cclauss/pystatsd

delete branch : patch-5

delete time in 2 hours

delete branch cclauss/pystatsd

delete branch : patch-4

delete time in 2 hours

PR opened sivy/pystatsd

setup.py: Add PyPI trove classifiers for Py2.7, 3.5-3.8

Adds compatibility information to https://pypi.org/project/pystatsd on the next release.

+5 -0

0 comment

1 changed file

pr created time in 2 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha ba7c1e9153d6f0de129568470f55949549845a94

setup.py: Add PyPI trove classifiers for Py2.7, 3.5-3.8 Adds compatibility information to https://pypi.org/project/pystatsd on the next release.

view details

push time in 2 hours

PR opened sivy/pystatsd

assert_any_call(), not assert_call_any() and add a colon

https://docs.python.org/3/library/unittest.mock.html?highlight=any#unittest.mock.Mock.assert_any_call

+6 -6

0 comment

2 changed files

pr created time in 2 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha ffac6dfe20618aadb5d39ecc7aeef1670392ce7c

nosetests pass!

view details

push time in 2 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha 1e04f1253e1244c49b6501fcaf08ef71fdcc9b46

:

view details

push time in 2 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha 8436c8e847efa5645ef95c41a0261b1193fde693

strategy: fail-fast: false

view details

push time in 2 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha 474029236bc91d1d1b151b2b79697fa60b31d814

Turn on nosetests and pytest

view details

push time in 2 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha 465a48e00fdf8e4adc4d3928561537f04cbdcfdd

unittest.mock.Mock.assert_any_call(), not assert_call_any() https://docs.python.org/3/library/unittest.mock.html?highlight=any#unittest.mock.Mock.assert_any_call

view details

push time in 3 hours

PR opened sivy/pystatsd

Delete .travis.yml in favor of GitHub Actions
+0 -14

0 comment

1 changed file

pr created time in 3 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha cee173f58a509cdf5a1b76cc22dcfe3af604ffb5

Delete .travis.yml in favor of GitHub Actions

view details

push time in 3 hours

delete branch cclauss/pystatsd

delete branch : patch-3

delete time in 3 hours

pull request commentsivy/pystatsd

Fix typo found by codespell: whetehr --> whether

Ready for review.

cclauss

comment created time in 3 hours

PR opened sivy/pystatsd

Fix typo found by codespell: whetehr --> whether

GitHub Action: Turn on codespell GitHub Action: Run black only on Python 3

+7 -4

0 comment

2 changed files

pr created time in 3 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha 03b402bd7b7023558e24e7f52d6cbfa992e991fe

black . --diff --skip-string-normalization

view details

push time in 3 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha d903690f891425cf1315a485d46bfdf86b612ea1

if: matrix.python-version != 2.7

view details

push time in 3 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha 46bb43dc68982ce7a6707fadded4cf859bd0a503

GitHub Action: Turn on codespell Also run `black . --diff || true` only on Python 3.

view details

push time in 3 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha df66aaa614b78dcd051f5f756ca560b4ae775eed

whether

view details

push time in 4 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha e728405f972a79e40a761a4cc01c3701db0a5a03

Fix typo found by codespell: whetehr --> whether

view details

push time in 4 hours

pull request commentsivy/pystatsd

Create a GitHub Actions alternative to Travis CI

Yes.

cclauss

comment created time in 4 hours

Pull request review commentapache/cordova-ios

Add Python 3 compatibility to bin/cordova_plist_to_config_xml

 def UpdateProjectFile(path):     if 'Cordova.plist' in line:       line = line.replace('Cordova.plist', 'config.xml')       line = line.replace('lastKnownFileType = text.plist.xml', 'lastKnownFileType = text.xml')-    print(line, end='')+    print(line, end=' ')

Which do we want?

>>> for char in "abcdefg":
...     print(char, end="")  # --> abcdefg
    -- or --
>>> for char in "abcdefg":
...     print(char, end="")  # --> a b c d e f g
cclauss

comment created time in 4 hours

Pull request review commentapache/cordova-ios

Add Python 3 compatibility to bin/cordova_plist_to_config_xml

 def UpdateProjectFile(path):     if 'Cordova.plist' in line:       line = line.replace('Cordova.plist', 'config.xml')       line = line.replace('lastKnownFileType = text.plist.xml', 'lastKnownFileType = text.xml')-    print(line, end='')+    print(line, end=' ')

To put a space between each line.

cclauss

comment created time in 4 hours

push eventcclauss/cordova-ios

Christian Clauss

commit sha 230795b75f84464d8bbce76c0046050d02463030

space

view details

push time in 5 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha 3b2549c4b28971f28ac48a79a5e0f666b1140b48

Commenting out nosetests so we can land this PR We can uncomment nosetests in the next PR.

view details

push time in 5 hours

pull request commentsivy/pystatsd

Create a GitHub Actions alternative to Travis CI

I think we will have the same problem with assert_call_with() too.

cclauss

comment created time in 5 hours

pull request commentsivy/pystatsd

Create a GitHub Actions alternative to Travis CI

https://github.com/cclauss/pystatsd/runs/453299837?check_suite_focus=true#step:9:11

cclauss

comment created time in 5 hours

pull request commentsivy/pystatsd

Travis CI: Remove EOL versions of Python

Were you able to More options, Trigger build on https://travis-ci.com/sivy/pystatsd ?

cclauss

comment created time in 6 hours

Pull request review commentTheAlgorithms/Python

Added False Position algorithm

+"""+Created on Sat Feb  8 19:25:41 2020++@author: MatteoRaso+"""+++def main(f, lower_bound: float, upper_bound: float, error: float):+    """An implementation of the false position method used for root-finding.+    The algorithm is extremely similar to the secant method in that it uses+    the x-intercept of the line connecting f(lower_bound) and f(upper_bound) +    in order to approximate the root of the function. The primary difference is that+    the false position method has a defined interval that the root is bounded+    by. This makes this method slightly slower but guarantees convergence.+    +    INPUTS:+    f: The function which who's root we want to find.+    lower_bound: A value at which f(lower_bound) < 0+    upper_bound: A value at which f(upper_bound) > 0+    error: The maximum tolerated error+    +    OUTPUT:+    The approximated root bounded by lower_bound and upper_bound+    """+    if f(lower_bound) > 0:
if f(lower_bound) > 0:
    raise ValueError("f(lower_bound) must be less than zero")
MatteoRaso

comment created time in 6 hours

pull request commentsivy/pystatsd

Create a GitHub Actions alternative to Travis CI

pystatsd/tests/client.py", line 83

cclauss

comment created time in 6 hours

pull request commentsivy/pystatsd

Travis CI: Remove EOL versions of Python

https://travis-ci.com/cclauss/pystatsd same failures as the GitHub Actions

cclauss

comment created time in 6 hours

pull request commentsivy/pystatsd

Travis CI: Remove EOL versions of Python

https://travis-ci.com/sivy/pystatsd did change! ;-) Go to that page and in the upperright click More options and then Trigger build. After the first one, it will become automatic.

cclauss

comment created time in 6 hours

pull request commentsivy/pystatsd

Create a GitHub Actions alternative to Travis CI

I get AttributeError: Attributes cannot start with 'assert' or 'assret' on both Python 2 and 3 but do not know how to fix that issue.

cclauss

comment created time in 6 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha 4892dd7ea93fadf4e31060f3cf8c221cf669ff8c

black does not run on legacy Python

view details

push time in 6 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha 343542b9d1cb965460e3abb5e5e3fdfe14f8baae

with: python-version: ${{ matrix.python-version }}

view details

push time in 6 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha 6545b3e17d3cfd972292b5ef0f8762e0adb77b55

Test on both Python 2.7 and 3.8

view details

push time in 7 hours

pull request commentsivy/pystatsd

Create a GitHub Actions alternative to Travis CI

Run nosetests tests
.....E..
======================================================================
ERROR: test_basic_client_update_stats_multi (tests.transplant_class.<locals>.C)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/pystatsd/pystatsd/tests/client.py", line 83, in test_basic_client_update_stats_multi
    self.mock_socket.return_value.sendto.assert_call_any(
  File "/opt/hostedtoolcache/Python/3.8.1/x64/lib/python3.8/site-packages/mock/mock.py", line 637, in __getattr__
    raise AttributeError("Attributes cannot start with 'assert' "
AttributeError: Attributes cannot start with 'assert' or 'assret'

----------------------------------------------------------------------
Ran 8 tests in 0.052s
cclauss

comment created time in 7 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha 66c5380a922a8797165c33265705076e4f510e7e

nosetests instead of pytest

view details

push time in 7 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha ab95472b4031686c051f81f8fd610cf4488d6cfc

Undefined name: metric --> key

view details

push time in 7 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha da78db870479fd78929ae8fdaad7a7499ad0e3c8

file() was removed in Python 3 in favor of open()

view details

push time in 7 hours

delete branch cclauss/creme

delete branch : patch-1

delete time in 7 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha 9ed30eb07f825b60cd52f179a86ab420d61d3992

file() was removed in Python 3 in favor of open()

view details

push time in 7 hours

PR opened sivy/pystatsd

Create a GitHub Actions alternative to Travis CI
+19 -0

0 comment

1 changed file

pr created time in 7 hours

push eventcclauss/pystatsd

Christian Clauss

commit sha 0ec1b88fb70bc1810e4e1b769ab12ca0cecb8d08

Create a GitHub Actions alternative to Travis CI

view details

push time in 7 hours

pull request commentsivy/pystatsd

Travis CI: Remove EOL versions of Python

Yes but neither of the URLs above are currently enabled. Can you please go to the .com address and kick off a manual build to prime the pump?

cclauss

comment created time in 7 hours

delete branch cclauss/pystatsd

delete branch : patch-1

delete time in 7 hours

push eventcclauss/itinerant-tester

Christian Clauss

commit sha d8d138843ba79ac4c6e28852c3310b2e7d612c56

sivy/pystatsd

view details

push time in 7 hours

delete branch internetarchive/openlibrary

delete branch : Remove-unused-pmap-function

delete time in 8 hours

push eventcclauss/itinerant-tester

Christian Clauss

commit sha 1fb5411b6c25d1a8ede26f1f34c8ba73588fe922

internetarchive

view details

push time in 9 hours

issue commentadam-p/markdown-here

Use print() function in both Python 2 and Python 3

@adam-p

cclauss

comment created time in 9 hours

PR opened v8/v8

Define basestring in Python 3

The Python builtin basestring has been removed from all currently supported versions of Python so define basestring in Python3 so that line 60 does not raise a NameError at runtime. @bmsdave @targos Please submit upstream.

+5 -0

0 comment

1 changed file

pr created time in 10 hours

push eventcclauss/v8

Christian Clauss

commit sha 3c89da9d29dd45425b57e30f862ae14c91a2850a

Define basestring in Python 3 The Python builtin `basestring` has been removed from all [currently supported version of Python](https://devguide.python.org/#status-of-python-branches) so define `basestring` in Python3 so that line 60 does not raise a NameError at runtime. @bmsdave @targos Please submit upstream.

view details

push time in 10 hours

PR opened creme-ml/creme

CI: Lint for undefined names in Python code

flake8 testing of https://github.com/creme-ml/creme on Python 3.8.0

$ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

./creme/reco/baseline.py:80:65: F821 undefined name 'u_optimizer'
        self.loss = optim.losses.Squared() if loss is None else u_optimizer
                                                                ^
1     F821 undefined name 'u_optimizer'
1```
https://flake8.pycqa.org/en/latest/user/error-codes.html

Also, pip will soon have a real dependancy resolver so it is better to give it more requirements in a single command so that it can a more complete job of resolving the dependancies.

On the flake8 test selection, this PR does _not_ focus on "_style violations_" (the majority of flake8 error codes that [__psf/black__](https://github.com/psf/black) can autocorrect).  Instead these tests are focus on runtime safety and correctness:
* E9 tests are about Python syntax errors usually raised because flake8 can not build an Abstract Syntax Tree (AST).  Often these issues are a sign of unused code or code that has not been ported to Python 3.  These would be compile-time errors in a compiled language but in a dynamic language like Python they result in the script halting/crashing on the user.
* F63 tests are usually about the confusion between identity and equality in Python.  Use ==/!= to compare str, bytes, and int literals is the classic case.  These are areas where __a == b__ is True but __a is b__ is False (or vice versa).  Python >= 3.8 will raise SyntaxWarnings on these instances.
* F7 tests logic errors and syntax errors in type hints
* F82 tests are almost always _undefined names_ which are usually a sign of a typo, missing imports, or code that has not been ported to Python 3.  These also would be compile-time errors in a compiled language but in Python a __NameError__ is raised which will halt/crash the script on the user.
+2 -2

0 comment

1 changed file

pr created time in 10 hours

push eventcclauss/creme

Christian Clauss

commit sha 84f49385658b6ce73fcd69586ee26e3efd8b5ce9

CI: Lint for undefined names in Python code [flake8](http://flake8.pycqa.org) testing of https://github.com/creme-ml/creme on Python 3.8.0 $ __flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics__ ``` ./creme/reco/baseline.py:80:65: F821 undefined name 'u_optimizer' self.loss = optim.losses.Squared() if loss is None else u_optimizer ^ 1 F821 undefined name 'u_optimizer' 1``` https://flake8.pycqa.org/en/latest/user/error-codes.html Also, pip will soon have a real dependancy resolver so it is better to give it more requirements in a single command so that it can a more complete job of resolving the dependancies. On the flake8 test selection, this PR does _not_ focus on "_style violations_" (the majority of flake8 error codes that [__psf/black__](https://github.com/psf/black) can autocorrect). Instead these tests are focus on runtime safety and correctness: * E9 tests are about Python syntax errors usually raised because flake8 can not build an Abstract Syntax Tree (AST). Often these issues are a sign of unused code or code that has not been ported to Python 3. These would be compile-time errors in a compiled language but in a dynamic language like Python they result in the script halting/crashing on the user. * F63 tests are usually about the confusion between identity and equality in Python. Use ==/!= to compare str, bytes, and int literals is the classic case. These are areas where __a == b__ is True but __a is b__ is False (or vice versa). Python >= 3.8 will raise SyntaxWarnings on these instances. * F7 tests logic errors and syntax errors in type hints * F82 tests are almost always _undefined names_ which are usually a sign of a typo, missing imports, or code that has not been ported to Python 3. These also would be compile-time errors in a compiled language but in Python a __NameError__ is raised which will halt/crash the script on the user.

view details

push time in 10 hours

fork cclauss/creme

:custard: Online machine learning in Python

https://creme-ml.github.io

fork in 10 hours

fork cclauss/mentalist

Mentalist is a graphical tool for custom wordlist generation. It utilizes common human paradigms for constructing passwords and can output the full wordlist as well as rules compatible with Hashcat and John the Ripper.

fork in 11 hours

push eventcclauss/itinerant-tester

Christian Clauss

commit sha 6042997edc6d206e372da9486c311bb469c2fa3f

trigger a new build

view details

push time in 11 hours

delete branch cclauss/openlibrary

delete branch : more-absolute-imports

delete time in 12 hours

PR closed internetarchive/openlibrary

Reviewers
Fix remaining Python absolute imports Needs: Review Theme: Upgrade to Python 3 python

These changes were made via futurize -f libfuturize.fixes.fix_absolute_import -w . https://python-future.org/index.html

These changes plus #2892 and #2999 will close all currently visible Python 3 errors.

<!-- What issue does this PR close? --> Closes #

<!-- What does this PR achieve? [feature|hotfix|fix|refactor] -->

Technical

<!-- What should be noted about the implementation? -->

Testing

<!-- Steps for reviewer to reproduce/verify what this PR does/fixes. -->

Evidence

<!-- If this PR touches UI, please post evidence (screenshots) of it behaving correctly. -->

Stakeholders

<!-- @ tag stakeholders of this bug -->

+132 -79

2 comments

53 changed files

cclauss

pr closed time in 12 hours

issue commentinternetarchive/openlibrary

43 undefined names on Python 2.7

#3054 makes a huge improvement and would drop us down to just 10 undefined names which are all covered in other single-file PRs or issues.

cclauss

comment created time in 12 hours

delete branch cclauss/openlibrary

delete branch : Fix-undefined-names

delete time in 12 hours

PR closed internetarchive/openlibrary

Reviewers
Fix all but 4 undefined names State: Backlogged python

<!-- What issue does this PR close? --> Resolves most of #1684

Fixes #3041 https://travis-ci.org/internetarchive/openlibrary/jobs/650558602#L223

<!-- What does this PR achieve? [feature|hotfix|fix|refactor] -->

Technical

<!-- What should be noted about the implementation? -->

Testing

<!-- Steps for reviewer to reproduce/verify what this PR does/fixes. -->

Evidence

<!-- If this PR touches UI, please post evidence (screenshots) of it behaving correctly. -->

Stakeholders

<!-- @ tag stakeholders of this bug -->

+81 -44

2 comments

25 changed files

cclauss

pr closed time in 12 hours

pull request commentinternetarchive/openlibrary

Fix all but 4 undefined names

Closing. These items have all been fixed or will be fixed in #3054 or other single-file PRs or issues.

cclauss

comment created time in 12 hours

PR opened internetarchive/openlibrary

Py3 has stricter scoping rules for list comprehensions

In Python 3 variables created inside a comprehension are not available outside that comprehension. This change avoids the comprehension to ensure that doc is available to be printed in the except clause.

./openlibrary/utils/bulkimport.py:133:24: F821 undefined name 'doc'
            print(repr(doc))
                       ^

<!-- What issue does this PR close? --> Closes #

<!-- What does this PR achieve? [feature|hotfix|fix|refactor] -->

Technical

<!-- What should be noted about the implementation? -->

Testing

<!-- Steps for reviewer to reproduce/verify what this PR does/fixes. -->

Evidence

<!-- If this PR touches UI, please post evidence (screenshots) of it behaving correctly. -->

Stakeholders

<!-- @ tag stakeholders of this bug -->

+5 -4

0 comment

1 changed file

pr created time in 12 hours

issue openedinternetarchive/openlibrary

Resolving the undefined names in catalog/marc/html.py

<!-- What problem are we solving? What does the experience look like today? What are the symptoms? --> Related to #3057 which will require modifications to the same file.

  • html_subfields() is an undefined name on line 44
  • html_line() is an undefined name on line 55
./openlibrary/catalog/marc/html.py:44:16: F821 undefined name 'html_subfields'
        assert html_subfields(input) == output
               ^
./openlibrary/catalog/marc/html.py:55:16: F821 undefined name 'html_line'
        assert html_line(tag, input) == expect
               ^

In this file, both are called as functions but defined as methods of class html_record(). To fix these undefined names, we would need to create an instance of html_record() and then change these lines to: assert html_subfields(input) == output assert html_line(tag, input) == expect

What is a valid data parameter for the call my_html_record = html_record(data)?

Evidence / Screenshot (if possible)

Relevant url?

<!-- https://openlibrary.org/... -->

Steps to Reproduce

<!-- What steps caused you to find the bug? -->

  1. Go to ...
  2. Do ...

<!-- What actually happened after these steps? What did you expect to happen? -->

  • Actual:
  • Expected:

Details

  • Logged in (Y/N)?
  • Browser type/version?
  • Operating system?
  • Environment (prod/dev/local)? prod <!-- If not sure, put prod -->

Proposal & Constraints

<!-- What is the proposed solution / implementation? Is there a precedent of this approach succeeding elsewhere? -->

Related files

<!-- Files related to this issue; this is super useful for new contributors who might want to help! If you're not sure, leave this blank; a maintainer will add them. -->

Stakeholders

<!-- @ tag stakeholders of this bug -->

created time in 12 hours

pull request commentTheAlgorithms/Python

Create square_root_using_netwon_repson.py

If this algorithm is exactly the same as an existing algorithm then this PR should be closed especially given https://travis-ci.com/TheAlgorithms/Python/builds/149131996#L820

Lablnet

comment created time in 13 hours

PR opened internetarchive/openlibrary

Reviewers
Fix undefined name re_isbn Needs: Review Theme: Upgrade to Python 3 python

Fix undefined name with re_isbn = re.compile(r'([^ ()]+[\dX])(?: \((?:v\. (\d+)(?: : )?)?(.*)\))?')

https://github.com/internetarchive/openlibrary/pull/3040#discussion_r379621016 says that this solution is wrong but I am unable to find a better one.

./openlibrary/catalog/marc/marc_binary.py:197:17: F821 undefined name 're_isbn'
            m = re_isbn.match(f.line[3:-1])
                ^

<!-- What issue does this PR close? --> Closes #

<!-- What does this PR achieve? [feature|hotfix|fix|refactor] -->

Technical

<!-- What should be noted about the implementation? -->

Testing

<!-- Steps for reviewer to reproduce/verify what this PR does/fixes. -->

Evidence

<!-- If this PR touches UI, please post evidence (screenshots) of it behaving correctly. -->

Stakeholders

<!-- @ tag stakeholders of this bug -->

+1 -1

0 comment

1 changed file

pr created time in 13 hours

create barnchinternetarchive/openlibrary

branch : Fix-undefined-name-re_isbn

created branch time in 13 hours

delete branch cclauss/pymatting

delete branch : patch-2

delete time in 13 hours

push eventinternetarchive/openlibrary

Christian Clauss

commit sha 07b0305c6589c1446e8cafbbb210a0793012c42e

Reverse order to avoid NameErrors

view details

push time in 14 hours

PR opened internetarchive/openlibrary

Remove unused pmap() function
  1. There is no mention of this function anywhere in this repo:
    • https://github.com/internetarchive/openlibrary/search?q=pmap
  2. This code overwrites the unused Pool (title case)
    • subprocess has no Pool.map_async() but multiprocessing does...
    • https://docs.python.org/2/library/multiprocessing.html#multiprocessing.pool.multiprocessing.Pool.map_async
  3. Line 138 contains two undefined names pool (lowercase) and results.
./openlibrary/data/dump.py:138:13: F821 undefined name 'pool'
        r = pool.map_async(f, tasks, callback=results.append)
            ^
./openlibrary/data/dump.py:138:47: F821 undefined name 'results'
        r = pool.map_async(f, tasks, callback=results.append)
                                              ^

<!-- What issue does this PR close? --> Closes #

<!-- What does this PR achieve? [feature|hotfix|fix|refactor] -->

Technical

<!-- What should be noted about the implementation? -->

Testing

<!-- Steps for reviewer to reproduce/verify what this PR does/fixes. -->

Evidence

<!-- If this PR touches UI, please post evidence (screenshots) of it behaving correctly. -->

Stakeholders

<!-- @ tag stakeholders of this bug -->

+0 -12

0 comment

1 changed file

pr created time in 14 hours

create barnchinternetarchive/openlibrary

branch : Remove-unused-pmap-function

created branch time in 14 hours

PR opened internetarchive/openlibrary

Fix undefined name mock_site
./openlibrary/tests/core/test_sponsors.py:69:16: F821 undefined name 'mock_site'
        work = mock_site.quicksave("/works/OL1W", "/type/work", title="Foo")
               ^

<!-- What issue does this PR close? --> Closes #

<!-- What does this PR achieve? [feature|hotfix|fix|refactor] -->

Technical

<!-- What should be noted about the implementation? -->

Testing

<!-- Steps for reviewer to reproduce/verify what this PR does/fixes. -->

Evidence

<!-- If this PR touches UI, please post evidence (screenshots) of it behaving correctly. -->

Stakeholders

<!-- @ tag stakeholders of this bug -->

+1 -0

0 comment

1 changed file

pr created time in 14 hours

create barnchinternetarchive/openlibrary

branch : Fix-undefined-name-mock_site

created branch time in 14 hours

PR opened internetarchive/openlibrary

Fix monkeypatch of urlopen

Following the Python porting best practice use-feature-detection-instead-of-version-detection to allow us to simplify the code and avoid an undefined name. I can not find anywhere in this repo that this function is called so it might be dead code.

<!-- What issue does this PR close? --> Closes #

<!-- What does this PR achieve? [feature|hotfix|fix|refactor] -->

Technical

<!-- What should be noted about the implementation? -->

Testing

<!-- Steps for reviewer to reproduce/verify what this PR does/fixes. -->

Evidence

<!-- If this PR touches UI, please post evidence (screenshots) of it behaving correctly. -->

Stakeholders

<!-- @ tag stakeholders of this bug -->

+8 -17

0 comment

1 changed file

pr created time in 14 hours

create barnchinternetarchive/openlibrary

branch : Fix-monkeypatch-of-urlopen

created branch time in 14 hours

PR opened internetarchive/openlibrary

Undefined name: search(self) --> self.search()

search() is an undefined name in this context but `self.search() is defined 7 lines below.

./openlibrary/plugins/search/solr_client.py:207:17: F821 undefined name 'search'
            s = search(self, query, start=loc)
                ^

<!-- What issue does this PR close? --> Closes #

<!-- What does this PR achieve? [feature|hotfix|fix|refactor] -->

Technical

<!-- What should be noted about the implementation? -->

Testing

<!-- Steps for reviewer to reproduce/verify what this PR does/fixes. -->

Evidence

<!-- If this PR touches UI, please post evidence (screenshots) of it behaving correctly. -->

Stakeholders

<!-- @ tag stakeholders of this bug -->

+1 -1

0 comment

1 changed file

pr created time in 16 hours

create barnchinternetarchive/openlibrary

branch : self.search

created branch time in 16 hours

PR opened internetarchive/openlibrary

Undefined name: path --> type[key]

path is an undefined name in this context and the thing that is not recognised is the /type/key.

<!-- What issue does this PR close? --> Closes #

<!-- What does this PR achieve? [feature|hotfix|fix|refactor] -->

Technical

<!-- What should be noted about the implementation? -->

Testing

<!-- Steps for reviewer to reproduce/verify what this PR does/fixes. -->

Evidence

<!-- If this PR touches UI, please post evidence (screenshots) of it behaving correctly. -->

Stakeholders

<!-- @ tag stakeholders of this bug -->

+1 -1

0 comment

1 changed file

pr created time in 16 hours

create barnchinternetarchive/openlibrary

branch : Undefined-name-path

created branch time in 16 hours

pull request commentinternetarchive/openlibrary

Fix remaining Python absolute imports with full paths

Agreed. PRs that touch many files age rapidly.

cclauss

comment created time in 16 hours

Pull request review commentinternetarchive/openlibrary

Fix remaining Python absolute imports with full paths

 import gzip import web -from update_work import process_edition_data, process_work_data+from openlibrary.solr.update_work import process_edition_data, process_work_data

openlibrary/solr/solrdump.py should work as expected. If this is a standalone script then it should be in /scripts/

cclauss

comment created time in 16 hours

Pull request review commentinternetarchive/openlibrary

Fix remaining Python absolute imports with full paths

 from __future__ import print_function import socket -# akismet module changes socket default timeout.-# Undoing it as it might effect other parts of the system.-timeout = socket.getdefaulttimeout()--from akismet import Akismet-socket.setdefaulttimeout(timeout) import web  from infogami import config from infogami.infobase import client +from openlibrary.plugins.akismet.akismet import Akismet+# akismet module changes socket default timeout.+# Undoing it as it might effect other parts of the system.+timeout = socket.getdefaulttimeout()

I took the comment to mean that the akismet import would change the timing so it was necessary to change it back after.

cclauss

comment created time in 16 hours

Pull request review commentinternetarchive/openlibrary

Fix remaining Python absolute imports with full paths

  import simplejson import re-from normalize import normalize+from openlibrary.catalog.onix.normalize import normalize

This is a literal translation of what Python 2 would do with this relative import. This is what is currently running in production because Python 2 looks for and findS normalize.py in the same directory as __file__.

cclauss

comment created time in 16 hours

Pull request review commentnodejs/node

build: support android build on ndk version equal or above 23(Android…

       'includes': ['config/archs/linux-ppc64/no-asm/openssl.gypi'],     }, 'target_arch=="s390x" and OS=="linux"', {       'includes': ['config/archs/linux64-s390x/no-asm/openssl.gypi'],-    }, 'target_arch=="arm" and OS=="linux"', {+    }, 'target_arch=="arm" and OS in "linux android"', {       'includes': ['config/archs/linux-armv4/no-asm/openssl.gypi'],-    }, 'target_arch=="arm64" and OS=="linux"', {+    }, 'target_arch=="arm64" and OS in "linux android"', {

"linux android" —> ("linux", "android") because nux and droid are in the former but not in the latter.

forfun414

comment created time in 17 hours

issue commentomz/Pythonista-Issues

Project live?

Screen keyboard:

  • On-screen keyboard covers part of the console
  • No prompts visible on screen keyboard
  • There is no way to make a multiple comment with the on-screen keyboard

External keyboard:

  • Quick access toolbar closes console input
ppskmg

comment created time in 17 hours

pull request commentinternetarchive/openlibrary

Feature/3049 catalog clean out

openlibrary/catalog/get_ia.py:25:1: E302 expected 2 blank lines, found 1

hornc

comment created time in 21 hours

issue closedinternetarchive/openlibrary

Undefined name: Which import_author() should we use in openlibrary/catalog/load.py?

Question

<!-- What question needs to be answered to close this issue? This should be one sentence. --> Which of the three versions of import_author() should we import into openlibrary/catalog/load.py?

[ ] from openlibrary.catalog.importer.load import import_author [ ] from openlibrary.catalog.add_book.load_book import import_author [ ] from openlibrary.catalog.onix.onix-import import import_author

Additional context

<!-- Add any other context or details here. -->

Stakeholders

<!-- @ tag stakeholders of this bug -->

closed time in 21 hours

cclauss

delete branch cclauss/openlibrary

delete branch : from_openlibrary.catalog.read_rc_import_read_rc

delete time in 21 hours

PR closed internetarchive/openlibrary

Reviewers
from openlibrary.catalog.read_rc import read_rc Needs: Review Theme: Upgrade to Python 3 python

<!-- What issue does this PR close? --> Fixes undefined name rc in two files.

The syntax openlibrary.catalog.read_rc import read_rc ; rc = read_rc() is used in 60+ Python files in this repo but rc is an undefined name in the two files of this PR. Here we propose to adopt that syntax to resolve those undefined names.

<!-- What does this PR achieve? [feature|hotfix|fix|refactor] -->

Technical

<!-- What should be noted about the implementation? -->

Testing

<!-- Steps for reviewer to reproduce/verify what this PR does/fixes. -->

Evidence

<!-- If this PR touches UI, please post evidence (screenshots) of it behaving correctly. -->

Stakeholders

<!-- @ tag stakeholders of this bug -->

+15 -10

1 comment

3 changed files

cclauss

pr closed time in 21 hours

more