It looks to me that 171.b applies to official state or local buildings, but not any and all "public buildings". For example- the length limit would apply to a town hall building, but not a store or restaurant open to the public. In post #21 you only said "public buildings", with no reference to them being official government buildings. That was the source of my dispute. EDIT- In a search of California's official legislative website
http://leginfo.legislature.ca.gov/faces/codes.xhtml , 171.b is not recognized as "valid". I strongly suspect that 171.b was not included in a recent revision of California state law and is therefore no longer an active law in California. State laws are occasionally revised, and not every statute survives those revisions. I suspect that officer Warren was relying on an outdated copy of the penal code.
And as far as length limits on openly carried knives in Los Angeles, there is most certainly a 3" blade length limit.
To find the Los Angeles municipal codes, look here-
http://www.amlegal.com/library/ca/losangeles.shtml For the knife laws of Los Angeles municipality, look up section 55.10
And for the county of Los Angeles, look here-
http://www.lacounty.gov/wps/portal/lac/government/public/ For the knife laws of Los Angeles county, look up section 13.62.010 (zzyzzogeton provided that one above).
Both the municipality of LA, and LA county, have a 3 inch blade length limit on openly carried knives, folders and fixed-blades.
Source
https://www.municode.com/webcontent/statelawpamphlets/ca.pdf
"In Fisher v. City of Berkeley, 209 Cal. Rep. 682, 729, 37 Cal. 3d 644, 693 P.2d 261, 308 (S. Ct. 1984), the following statement was made about municipal powers.
Every California city possesses the general power to 'make and enforce within its limits all local, police, sanitary, and other ordinances and regulations not in conflict with general laws.' (Cal. Const., art. XI, § 7.) In addition, charter cities have even greater authority: they have exclusive power to legislate over 'municipal affairs.' (Cal. Const., art. XI, § 5, subd. (a).)
In Isaac v. City of Los Angles, 77 Cal. Rep. 2d 752, 760, 66 Cal. App. 4th 586, 599---600 (2nd Dist. 1998), the court presented the following analysis of municipal powers and the effect of statutes upon them:
Every California city may enact and enforce within its limits local ordinances not in conflict with general laws. (Cal. Const., art. XI, § 7.) Chartered cities, such as Los Angeles, are granted exclusive power to legislate their municipal affairs. (Cal. Const., art. XI, § 5; Government Code § 34101.) Under home rule, the state Legislature's authority to intrude into matters of local concern is curtailed. The benefits of home rule are numerous, because cities are familiar with their own local problems and can often act more promptly to address problems than the state Legislature. Therefore, cities are only precluded from enacting laws on non-local matters if it is the intent of the Legislature to occupy the field to the exclusion of municipal regulation. (See Bishop v. City of San Jose (1969) 1 Cal. 3d 56, 61-62, 81 Cal. Rptr. 465, 460 P.2d 137.)
Whether a city ordinance is valid therefore requires a determination of whether (1) the local regulation or ordinance is a 'municipal affair,' upon which the municipality has the exclusive authority to regulate, or (2) whether the subject is a matter of statewide concern such that state legislation preempts any municipal attempt at lawmaking. Because the California Constitution does not define 'municipal affairs,' it has become a question to be decided on the facts of each case, as the concept of a municipal affair changes over time as local issues become issues of statewide concern. (Bishop, supra, at p. 62, 81 Cal. Rptr. 465, 460 P.2d 137; Century Plaza Hotel (1970) 7 Cal. App. 3d 616, 620, 87 Cal. Rptr. 166.) Although the state Legislature may have attempted to deal with a particular field, this does not automatically ordain preemption. The Legislature may also express its intent to permit local legislation in the field, or the statutory scheme may recognize local regulations. (City of Dublin v. County of Alameda (1993) 14 Cal. App. 4th 264, 276, 17 Cal. Rptr. 2d 845.)
Whether a particular matter is of 'statewide concern' is another way of stating that the matter is preempted and conflicting local legislation is prohibited. Fisher recognized a three-part test to infer a legislative intent to preempt conflicting municipal enactments only where (1) the subject matter has been so fully and completely covered by general law as to clearly indicate it has become exclusively a matter of state concern, (2) the subject matter has been partially covered by general law stated in such terms as to indicate clearly a matter of paramount state concern which will not tolerate further or additional local action, and (3) the subject matter has been partially covered by general law, and the subject is of such a nature that the adverse effect of a local ordinance outweighs the possible benefit of the law to the municipality. (Fisher, supra, at p. 708, 209 Cal. Rptr. 682, 693 P.2d 261.)"
Basically no city or county may pass code or ordnance counter to well established state law. The LA language would present clear difficulty to any DA for conviction of the city of county limits on blade length. But hey I'm not a lawyer and this isn't legal advice.